PageRenderTime 28ms CodeModel.GetById 17ms app.highlight 6ms RepoModel.GetById 1ms app.codeStats 0ms

/RestFB/library/src/main/java/com/restfb/types/Insight.java

http://restfb.googlecode.com/
Java | 80 lines | 23 code | 10 blank | 47 comment | 0 complexity | a850451a59ef7c916a7493da6414db65 MD5 | raw file
 1/*
 2 * Copyright (c) 2010-2011 Mark Allen.
 3 * 
 4 * Permission is hereby granted, free of charge, to any person obtaining a copy
 5 * of this software and associated documentation files (the "Software"), to deal
 6 * in the Software without restriction, including without limitation the rights
 7 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 8 * copies of the Software, and to permit persons to whom the Software is
 9 * furnished to do so, subject to the following conditions:
10 * 
11 * The above copyright notice and this permission notice shall be included in
12 * all copies or substantial portions of the Software.
13 * 
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20 * THE SOFTWARE.
21 */
22
23package com.restfb.types;
24
25import java.util.ArrayList;
26import java.util.List;
27
28import com.restfb.Facebook;
29import com.restfb.json.JsonObject;
30
31/**
32 * Represents the <a
33 * href="http://developers.facebook.com/docs/reference/api/insights" >Insight
34 * Graph API type</a>.
35 * 
36 * @author <a href="http://restfb.com">Mark Allen</a>
37 * @since 1.6.3
38 */
39public class Insight extends NamedFacebookType {
40  @Facebook
41  private String period;
42
43  @Facebook
44  private String description;
45
46  @Facebook
47  private List<JsonObject> values = new ArrayList<JsonObject>();
48
49  private static final long serialVersionUID = 1L;
50  
51  /**
52   * Length of the period during which the insights were collected, e.g. 'day',
53   * 'week' or 'month'.
54   * 
55   * @return Length of the period during which the insights were collected.
56   */
57  public String getPeriod() {
58    return period;
59  }
60
61  /**
62   * The human-readable description of this Insight data.
63   * 
64   * @return The human-readable description of this Insight data.
65   */
66  public String getDescription() {
67    return description;
68  }
69
70  /**
71   * Data for this Insight as a list of
72   * <tt>{@link com.restfb.json.JsonObject}</tt> because its structure can vary
73   * depending on which type of Insight you're looking at.
74   * 
75   * @return Data for this Insight.
76   */
77  public List<JsonObject> getValues() {
78    return values;
79  }
80}