001// Generated by delombok at Thu Aug 13 13:56:44 UTC 2026
002/*
003 * Copyright (c) 2010-2026 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("total_value")
054  private InsightTotalValue totalValue;
055  @Facebook
056  private List<JsonObject> values = new ArrayList<>();
057
058  /**
059   * Data for this Insight as a list of <tt>{@link JsonObject}</tt> because its structure can vary depending on which
060   * type of Insight you're looking at.
061   *
062   * @return Data for this Insight.
063   */
064  public List<JsonObject> getValues() {
065    return unmodifiableList(values);
066  }
067
068  public boolean addValue(JsonObject json) {
069    return values.add(json);
070  }
071
072  public boolean removeValue(JsonObject json) {
073    return values.remove(json);
074  }
075
076  private static final long serialVersionUID = 1L;
077
078  /**
079   * Length of the period during which the insights were collected, e.g. 'day', 'week' or 'month'.
080   *
081   * @return Length of the period during which the insights were collected.
082   */
083  @java.lang.SuppressWarnings("all")
084  @lombok.Generated
085  public String getPeriod() {
086    return this.period;
087  }
088
089  /**
090   * Length of the period during which the insights were collected, e.g. 'day', 'week' or 'month'.
091   */
092  @java.lang.SuppressWarnings("all")
093  @lombok.Generated
094  public void setPeriod(final String period) {
095    this.period = period;
096  }
097
098  /**
099   * The human-readable title of this Insight data.
100   *
101   * @return The human-readable title of this Insight data.
102   */
103  @java.lang.SuppressWarnings("all")
104  @lombok.Generated
105  public String getTitle() {
106    return this.title;
107  }
108
109  /**
110   * The human-readable title of this Insight data.
111   */
112  @java.lang.SuppressWarnings("all")
113  @lombok.Generated
114  public void setTitle(final String title) {
115    this.title = title;
116  }
117
118  /**
119   * The human-readable description of this Insight data.
120   *
121   * @return The human-readable description of this Insight data.
122   */
123  @java.lang.SuppressWarnings("all")
124  @lombok.Generated
125  public String getDescription() {
126    return this.description;
127  }
128
129  /**
130   * The human-readable description of this Insight data.
131   */
132  @java.lang.SuppressWarnings("all")
133  @lombok.Generated
134  public void setDescription(final String description) {
135    this.description = description;
136  }
137
138  @java.lang.SuppressWarnings("all")
139  @lombok.Generated
140  public InsightTotalValue getTotalValue() {
141    return this.totalValue;
142  }
143
144  @java.lang.SuppressWarnings("all")
145  @lombok.Generated
146  public void setTotalValue(final InsightTotalValue totalValue) {
147    this.totalValue = totalValue;
148  }
149}