001// Generated by delombok at Sun Apr 14 14:59:49 CEST 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 java.util.*;
026import com.restfb.Facebook;
027
028/**
029 * Represents the <a href="https://developers.facebook.com/docs/graph-api/reference/open-graph-property-config/">Open
030 * Graph Property Config</a> type
031 */
032public class OpenGraphPropertyConfig {
033  @Facebook("allowed_values")
034  private List<String> allowedValues = new ArrayList<>();
035  /**
036   * For string properties, whether the value is always lowercase
037   */
038  @Facebook("convert_lowercase")
039  private Boolean convertLowercase;
040  /**
041   * For string properties, whether the value is always uppercase
042   */
043  @Facebook("convert_uppercase")
044  private Boolean convertUppercase;
045  /**
046   * Human-readable name of the property
047   */
048  @Facebook("display_name")
049  private String displayName;
050  /**
051   * The name of the property to use in markup and API
052   */
053  @Facebook("formal_name")
054  private String formalName;
055  /**
056   * Whether the property is hidden from News Feed
057   */
058  @Facebook("hide_from_news_feed")
059  private Boolean hideFromNewsFeed;
060  /**
061   * Whether the property takes multiple values
062   */
063  @Facebook("is_array")
064  private Boolean isArray;
065  /**
066   * For numeric properties, the upper bound on the value
067   */
068  @Facebook("max_allowed")
069  private Double maxAllowed;
070  /**
071   * For string properties, the upper bound on the value length
072   */
073  @Facebook("max_length")
074  private Integer maxLength;
075  /**
076   * For numeric properties, the lower bound on the value
077   */
078  @Facebook("min_allowed")
079  private Double minAllowed;
080  /**
081   * For string properties, the lower bound on the value length
082   */
083  @Facebook("min_length")
084  private Integer minLength;
085  /**
086   * For reference properties, the object type associated with the property
087   */
088  @Facebook("reference_object_type")
089  private String referenceObjectType;
090  /**
091   * Whether the property is required
092   */
093  @Facebook
094  private Boolean required;
095  /**
096   * If set, at least one property for each group needs to be set
097   */
098  @Facebook("required_group")
099  private String requiredGroup;
100  @Facebook("struct_config")
101  private Map<String, OpenGraphPropertyConfig> structConfig = new HashMap<>();
102  /**
103   * Type of the property
104   */
105  @Facebook
106  private String type;
107
108  /**
109   * For enum properties, the set of allowed values
110   * 
111   * @return the set of allowed values
112   */
113  public List<String> getAllowedValues() {
114    return Collections.unmodifiableList(allowedValues);
115  }
116
117  public boolean addAllowedValue(String value) {
118    return allowedValues.add(value);
119  }
120
121  public boolean removeAllowedValue(String value) {
122    return allowedValues.remove(value);
123  }
124
125  /**
126   * For struct properties, the config for the nested properties
127   * 
128   * @return the config for the nested properties
129   */
130  public Map<String, OpenGraphPropertyConfig> getStructConfig() {
131    return Collections.unmodifiableMap(structConfig);
132  }
133
134  public void addStructConfig(String key, OpenGraphPropertyConfig value) {
135    structConfig.put(key, value);
136  }
137
138  public void removeStructConfig(String key) {
139    structConfig.remove(key);
140  }
141
142  /**
143   * For string properties, whether the value is always lowercase
144   */
145  @java.lang.SuppressWarnings("all")
146  public Boolean getConvertLowercase() {
147    return this.convertLowercase;
148  }
149
150  /**
151   * For string properties, whether the value is always lowercase
152   */
153  @java.lang.SuppressWarnings("all")
154  public void setConvertLowercase(final Boolean convertLowercase) {
155    this.convertLowercase = convertLowercase;
156  }
157
158  /**
159   * For string properties, whether the value is always uppercase
160   */
161  @java.lang.SuppressWarnings("all")
162  public Boolean getConvertUppercase() {
163    return this.convertUppercase;
164  }
165
166  /**
167   * For string properties, whether the value is always uppercase
168   */
169  @java.lang.SuppressWarnings("all")
170  public void setConvertUppercase(final Boolean convertUppercase) {
171    this.convertUppercase = convertUppercase;
172  }
173
174  /**
175   * Human-readable name of the property
176   */
177  @java.lang.SuppressWarnings("all")
178  public String getDisplayName() {
179    return this.displayName;
180  }
181
182  /**
183   * Human-readable name of the property
184   */
185  @java.lang.SuppressWarnings("all")
186  public void setDisplayName(final String displayName) {
187    this.displayName = displayName;
188  }
189
190  /**
191   * The name of the property to use in markup and API
192   */
193  @java.lang.SuppressWarnings("all")
194  public String getFormalName() {
195    return this.formalName;
196  }
197
198  /**
199   * The name of the property to use in markup and API
200   */
201  @java.lang.SuppressWarnings("all")
202  public void setFormalName(final String formalName) {
203    this.formalName = formalName;
204  }
205
206  /**
207   * Whether the property is hidden from News Feed
208   */
209  @java.lang.SuppressWarnings("all")
210  public Boolean getHideFromNewsFeed() {
211    return this.hideFromNewsFeed;
212  }
213
214  /**
215   * Whether the property is hidden from News Feed
216   */
217  @java.lang.SuppressWarnings("all")
218  public void setHideFromNewsFeed(final Boolean hideFromNewsFeed) {
219    this.hideFromNewsFeed = hideFromNewsFeed;
220  }
221
222  /**
223   * Whether the property takes multiple values
224   */
225  @java.lang.SuppressWarnings("all")
226  public Boolean getIsArray() {
227    return this.isArray;
228  }
229
230  /**
231   * Whether the property takes multiple values
232   */
233  @java.lang.SuppressWarnings("all")
234  public void setIsArray(final Boolean isArray) {
235    this.isArray = isArray;
236  }
237
238  /**
239   * For numeric properties, the upper bound on the value
240   */
241  @java.lang.SuppressWarnings("all")
242  public Double getMaxAllowed() {
243    return this.maxAllowed;
244  }
245
246  /**
247   * For numeric properties, the upper bound on the value
248   */
249  @java.lang.SuppressWarnings("all")
250  public void setMaxAllowed(final Double maxAllowed) {
251    this.maxAllowed = maxAllowed;
252  }
253
254  /**
255   * For string properties, the upper bound on the value length
256   */
257  @java.lang.SuppressWarnings("all")
258  public Integer getMaxLength() {
259    return this.maxLength;
260  }
261
262  /**
263   * For string properties, the upper bound on the value length
264   */
265  @java.lang.SuppressWarnings("all")
266  public void setMaxLength(final Integer maxLength) {
267    this.maxLength = maxLength;
268  }
269
270  /**
271   * For numeric properties, the lower bound on the value
272   */
273  @java.lang.SuppressWarnings("all")
274  public Double getMinAllowed() {
275    return this.minAllowed;
276  }
277
278  /**
279   * For numeric properties, the lower bound on the value
280   */
281  @java.lang.SuppressWarnings("all")
282  public void setMinAllowed(final Double minAllowed) {
283    this.minAllowed = minAllowed;
284  }
285
286  /**
287   * For string properties, the lower bound on the value length
288   */
289  @java.lang.SuppressWarnings("all")
290  public Integer getMinLength() {
291    return this.minLength;
292  }
293
294  /**
295   * For string properties, the lower bound on the value length
296   */
297  @java.lang.SuppressWarnings("all")
298  public void setMinLength(final Integer minLength) {
299    this.minLength = minLength;
300  }
301
302  /**
303   * For reference properties, the object type associated with the property
304   */
305  @java.lang.SuppressWarnings("all")
306  public String getReferenceObjectType() {
307    return this.referenceObjectType;
308  }
309
310  /**
311   * For reference properties, the object type associated with the property
312   */
313  @java.lang.SuppressWarnings("all")
314  public void setReferenceObjectType(final String referenceObjectType) {
315    this.referenceObjectType = referenceObjectType;
316  }
317
318  /**
319   * Whether the property is required
320   */
321  @java.lang.SuppressWarnings("all")
322  public Boolean getRequired() {
323    return this.required;
324  }
325
326  /**
327   * Whether the property is required
328   */
329  @java.lang.SuppressWarnings("all")
330  public void setRequired(final Boolean required) {
331    this.required = required;
332  }
333
334  /**
335   * If set, at least one property for each group needs to be set
336   */
337  @java.lang.SuppressWarnings("all")
338  public String getRequiredGroup() {
339    return this.requiredGroup;
340  }
341
342  /**
343   * If set, at least one property for each group needs to be set
344   */
345  @java.lang.SuppressWarnings("all")
346  public void setRequiredGroup(final String requiredGroup) {
347    this.requiredGroup = requiredGroup;
348  }
349
350  /**
351   * Type of the property
352   */
353  @java.lang.SuppressWarnings("all")
354  public String getType() {
355    return this.type;
356  }
357
358  /**
359   * Type of the property
360   */
361  @java.lang.SuppressWarnings("all")
362  public void setType(final String type) {
363    this.type = type;
364  }
365}