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 static java.util.Collections.unmodifiableList;
026import java.util.ArrayList;
027import java.util.List;
028import com.restfb.Facebook;
029import com.restfb.annotation.GraphAPI;
030
031/**
032 * Represents information about the place where an event occurred, for example a {@link Checkin} or {@link Photo}.
033 * 
034 * @author <a href="http://ex-nerd.com">Chris Petersen</a>
035 * @author <a href="http://restfb.com">Mark Allen</a>
036 * @since 1.6.10
037 */
038public class Place extends NamedFacebookType {
039  /**
040   * Location containing geographic information such as latitude, longitude, country, and other fields (fields will vary
041   * based on geography and availability of information).
042   *
043   * It is possible for Facebook to return either this value or {@link #getLocationAsString()}.
044   * 
045   */
046  @Facebook
047  private Location location;
048  /**
049   * Overall Rating of Place, on a 5-star scale. 0 means not enough data to get a combined rating.
050   */
051  @Facebook("overall_rating")
052  @GraphAPI(since = "2.5")
053  private Double overallRating;
054  /**
055   * Description for this location.
056   * <p>
057   * It is possible for Facebook to return either this value or {@link #getLocation()}. If {@link #getLocation()}
058   * returns {@code null}, then check this method to see if it has data, e.g. {@code "Philadelphia, PA"}.
059   * 
060   * @since 1.6.12
061   */
062  @Facebook("location")
063  private String locationAsString;
064  @Facebook("category_list")
065  private List<Category> categoryList = new ArrayList<>();
066
067  /**
068   * List of other categories for this place.
069   * 
070   * @return List of other categories for this place.
071   * @since 1.6.15
072   */
073  public List<Category> getCategoryList() {
074    return unmodifiableList(categoryList);
075  }
076
077  public boolean addCategory(Category category) {
078    return categoryList.add(category);
079  }
080
081  public boolean removeCategory(Category category) {
082    return categoryList.remove(category);
083  }
084
085  private static final long serialVersionUID = 1L;
086
087  /**
088   * Location containing geographic information such as latitude, longitude, country, and other fields (fields will vary
089   * based on geography and availability of information).
090   *
091   * It is possible for Facebook to return either this value or {@link #getLocationAsString()}.
092   * 
093   * @return Location containing geographic information such as latitude, longitude, country, and other fields.
094   */
095  @java.lang.SuppressWarnings("all")
096  public Location getLocation() {
097    return this.location;
098  }
099
100  /**
101   * Location containing geographic information such as latitude, longitude, country, and other fields (fields will vary
102   * based on geography and availability of information).
103   *
104   * It is possible for Facebook to return either this value or {@link #getLocationAsString()}.
105   * 
106   */
107  @java.lang.SuppressWarnings("all")
108  public void setLocation(final Location location) {
109    this.location = location;
110  }
111
112  /**
113   * Overall Rating of Place, on a 5-star scale. 0 means not enough data to get a combined rating.
114   *
115   * @return Overall Rating of Place, on a 5-star scale.
116   */
117  @GraphAPI(since = "2.5")
118  @java.lang.SuppressWarnings("all")
119  public Double getOverallRating() {
120    return this.overallRating;
121  }
122
123  /**
124   * Overall Rating of Place, on a 5-star scale. 0 means not enough data to get a combined rating.
125   */
126  @java.lang.SuppressWarnings("all")
127  public void setOverallRating(final Double overallRating) {
128    this.overallRating = overallRating;
129  }
130
131  /**
132   * Description for this location.
133   * <p>
134   * It is possible for Facebook to return either this value or {@link #getLocation()}. If {@link #getLocation()}
135   * returns {@code null}, then check this method to see if it has data, e.g. {@code "Philadelphia, PA"}.
136   * 
137   * @return Description for this location.
138   * @since 1.6.12
139   */
140  @java.lang.SuppressWarnings("all")
141  public String getLocationAsString() {
142    return this.locationAsString;
143  }
144
145  /**
146   * Description for this location.
147   * <p>
148   * It is possible for Facebook to return either this value or {@link #getLocation()}. If {@link #getLocation()}
149   * returns {@code null}, then check this method to see if it has data, e.g. {@code "Philadelphia, PA"}.
150   * 
151   * @since 1.6.12
152   */
153  @java.lang.SuppressWarnings("all")
154  public void setLocationAsString(final String locationAsString) {
155    this.locationAsString = locationAsString;
156  }
157}