001// Generated by delombok at Sun Jul 07 22:01:31 CEST 2019
002/**
003 * Copyright (c) 2010-2019 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  @Facebook
046  private Location location;
047  /**
048   * Overall Rating of Place, on a 5-star scale. 0 means not enough data to get a combined rating.
049   */
050  @Facebook("overall_rating")
051  @GraphAPI(since = "2.5")
052  private Double overallRating;
053  /**
054   * Description for this location.
055   * <p>
056   * It is possible for Facebook to return either this value or {@link #getLocation()}. If {@link #getLocation()}
057   * returns {@code null}, then check this method to see if it has data, e.g. {@code "Philadelphia, PA"}.
058   *
059   * @since 1.6.12
060   */
061  @Facebook("location")
062  private String locationAsString;
063  @Facebook("category_list")
064  private List<Category> categoryList = new ArrayList<>();
065
066  /**
067   * List of other categories for this place.
068   * 
069   * @return List of other categories for this place.
070   * @since 1.6.15
071   */
072  public List<Category> getCategoryList() {
073    return unmodifiableList(categoryList);
074  }
075
076  public boolean addCategory(Category category) {
077    return categoryList.add(category);
078  }
079
080  public boolean removeCategory(Category category) {
081    return categoryList.remove(category);
082  }
083
084  private static final long serialVersionUID = 1L;
085
086  /**
087   * Location containing geographic information such as latitude, longitude, country, and other fields (fields will vary
088   * based on geography and availability of information).
089   *
090   * It is possible for Facebook to return either this value or {@link #getLocationAsString()}.
091   * 
092   * @return Location containing geographic information such as latitude, longitude, country, and other fields.
093   */
094  @java.lang.SuppressWarnings("all")
095  public Location getLocation() {
096    return this.location;
097  }
098
099  /**
100   * Location containing geographic information such as latitude, longitude, country, and other fields (fields will vary
101   * based on geography and availability of information).
102   *
103   * It is possible for Facebook to return either this value or {@link #getLocationAsString()}.
104   */
105  @java.lang.SuppressWarnings("all")
106  public void setLocation(final Location location) {
107    this.location = location;
108  }
109
110  /**
111   * Overall Rating of Place, on a 5-star scale. 0 means not enough data to get a combined rating.
112   *
113   * @return Overall Rating of Place, on a 5-star scale.
114   */
115  @GraphAPI(since = "2.5")
116  @java.lang.SuppressWarnings("all")
117  public Double getOverallRating() {
118    return this.overallRating;
119  }
120
121  /**
122   * Overall Rating of Place, on a 5-star scale. 0 means not enough data to get a combined rating.
123   */
124  @java.lang.SuppressWarnings("all")
125  public void setOverallRating(final Double overallRating) {
126    this.overallRating = overallRating;
127  }
128
129  /**
130   * Description for this location.
131   * <p>
132   * It is possible for Facebook to return either this value or {@link #getLocation()}. If {@link #getLocation()}
133   * returns {@code null}, then check this method to see if it has data, e.g. {@code "Philadelphia, PA"}.
134   * 
135   * @return Description for this location.
136   * @since 1.6.12
137   */
138  @java.lang.SuppressWarnings("all")
139  public String getLocationAsString() {
140    return this.locationAsString;
141  }
142
143  /**
144   * Description for this location.
145   * <p>
146   * It is possible for Facebook to return either this value or {@link #getLocation()}. If {@link #getLocation()}
147   * returns {@code null}, then check this method to see if it has data, e.g. {@code "Philadelphia, PA"}.
148   *
149   * @since 1.6.12
150   */
151  @java.lang.SuppressWarnings("all")
152  public void setLocationAsString(final String locationAsString) {
153    this.locationAsString = locationAsString;
154  }
155}