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