001// Generated by delombok at Fri Oct 09 16:27:16 CEST 2020
002/*
003 * Copyright (c) 2010-2020 Mark Allen, Norbert Bartels.
004 *
005 * Permission is hereby granted, free of charge, to any person obtaining a copy
006 * of this software and associated documentation files (the "Software"), to deal
007 * in the Software without restriction, including without limitation the rights
008 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
009 * copies of the Software, and to permit persons to whom the Software is
010 * furnished to do so, subject to the following conditions:
011 *
012 * The above copyright notice and this permission notice shall be included in
013 * all copies or substantial portions of the Software.
014 *
015 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
016 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
017 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
018 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
019 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
020 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
021 * THE SOFTWARE.
022 */
023package com.restfb.types;
024
025import static java.util.Collections.unmodifiableList;
026import java.util.ArrayList;
027import java.util.List;
028import com.restfb.Facebook;
029import com.restfb.json.JsonObject;
030
031/**
032 * Represents the <a href="http://developers.facebook.com/docs/reference/api/insights" >Insight Graph API type</a>.
033 * 
034 * @author <a href="http://restfb.com">Mark Allen</a>
035 * @since 1.6.3
036 */
037public class Insight extends NamedFacebookType {
038  /**
039   * Length of the period during which the insights were collected, e.g. 'day', 'week' or 'month'.
040   */
041  @Facebook
042  private String period;
043  /**
044   * The human-readable title of this Insight data.
045   */
046  @Facebook
047  private String title;
048  /**
049   * The human-readable description of this Insight data.
050   */
051  @Facebook
052  private String description;
053  @Facebook
054  private List<JsonObject> values = new ArrayList<>();
055
056  /**
057   * Data for this Insight as a list of <tt>{@link JsonObject}</tt> because its structure can vary
058   * depending on which type of Insight you're looking at.
059   * 
060   * @return Data for this Insight.
061   */
062  public List<JsonObject> getValues() {
063    return unmodifiableList(values);
064  }
065
066  public boolean addValue(JsonObject json) {
067    return values.add(json);
068  }
069
070  public boolean removeValue(JsonObject json) {
071    return values.remove(json);
072  }
073
074  private static final long serialVersionUID = 1L;
075
076  /**
077   * Length of the period during which the insights were collected, e.g. 'day', 'week' or 'month'.
078   * 
079   * @return Length of the period during which the insights were collected.
080   */
081  @java.lang.SuppressWarnings("all")
082  public String getPeriod() {
083    return this.period;
084  }
085
086  /**
087   * Length of the period during which the insights were collected, e.g. 'day', 'week' or 'month'.
088   */
089  @java.lang.SuppressWarnings("all")
090  public void setPeriod(final String period) {
091    this.period = period;
092  }
093
094  /**
095   * The human-readable title of this Insight data.
096   *
097   * @return The human-readable title of this Insight data.
098   */
099  @java.lang.SuppressWarnings("all")
100  public String getTitle() {
101    return this.title;
102  }
103
104  /**
105   * The human-readable title of this Insight data.
106   */
107  @java.lang.SuppressWarnings("all")
108  public void setTitle(final String title) {
109    this.title = title;
110  }
111
112  /**
113   * The human-readable description of this Insight data.
114   * 
115   * @return The human-readable description of this Insight data.
116   */
117  @java.lang.SuppressWarnings("all")
118  public String getDescription() {
119    return this.description;
120  }
121
122  /**
123   * The human-readable description of this Insight data.
124   */
125  @java.lang.SuppressWarnings("all")
126  public void setDescription(final String description) {
127    this.description = description;
128  }
129}