/*
* Copyright (c) 2011 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
* or implied. See the License for the specific language governing permissions and limitations under
* the License.
*/
package com.google.api.services.samples.plus.cmdline;
import com.google.api.services.plus.model.Activity;
import com.google.api.services.plus.model.Person;
/**
* Utility methods to print to the command line.
*
* @author Yaniv Inbar
*/
public class View {
static void header1(String name) {
System.out.println();
System.out.println("================== " + name + " ==================");
System.out.println();
}
static void header2(String name) {
System.out.println();
System.out.println("~~~~~~~~~~~~~~~~~~ " + name + " ~~~~~~~~~~~~~~~~~~");
System.out.println();
}
static void show(Person person) {
System.out.println("id: " + person.getId());
System.out.println("name: " + person.getDisplayName());
System.out.println("image url: " + person.getImage().getUrl());
System.out.println("profile url: " + person.getUrl());
}
static void show(Activity activity) {
System.out.println("id: " + activity.getId());
System.out.println("url: " + activity.getUrl());
System.out.println("content: " + activity.getObject().getContent());
}
static void separator() {
System.out.println();
System.out.println("------------------------------------------------------");
System.out.println();
}
}