001// Generated by delombok at Fri Nov 22 22:30:55 CET 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.webhook.messaging.nlp;
024
025import java.util.ArrayList;
026import java.util.Collections;
027import java.util.List;
028import java.util.TimeZone;
029import com.restfb.Facebook;
030import com.restfb.JsonMapper;
031import com.restfb.types.AbstractFacebookType;
032
033public class NlpLocation extends BaseNlpEntity {
034  @Facebook
035  private List<Place> resolved = new ArrayList<>();
036
037  public List<Place> getResolved() {
038    return Collections.unmodifiableList(resolved);
039  }
040
041
042  public static class Place extends AbstractFacebookType {
043    @Facebook
044    private String name;
045    @Facebook
046    private String grain;
047    @Facebook
048    private String type;
049    @Facebook("timezone")
050    private String timezoneAsString;
051    private TimeZone timeZone;
052    @Facebook
053    private Coords coords;
054    @Facebook
055    private External external;
056
057    @JsonMapper.JsonMappingCompleted
058    protected void convertTimezone() {
059      if (timezoneAsString != null) {
060        try {
061          timeZone = TimeZone.getTimeZone(timezoneAsString);
062        } catch (Exception e) {
063        }
064      }
065      // exception during timezone detection is ignored here
066    }
067
068    @java.lang.SuppressWarnings("all")
069    public String getName() {
070      return this.name;
071    }
072
073    @java.lang.SuppressWarnings("all")
074    public void setName(final String name) {
075      this.name = name;
076    }
077
078    @java.lang.SuppressWarnings("all")
079    public String getGrain() {
080      return this.grain;
081    }
082
083    @java.lang.SuppressWarnings("all")
084    public void setGrain(final String grain) {
085      this.grain = grain;
086    }
087
088    @java.lang.SuppressWarnings("all")
089    public String getType() {
090      return this.type;
091    }
092
093    @java.lang.SuppressWarnings("all")
094    public void setType(final String type) {
095      this.type = type;
096    }
097
098    @java.lang.SuppressWarnings("all")
099    public String getTimezoneAsString() {
100      return this.timezoneAsString;
101    }
102
103    @java.lang.SuppressWarnings("all")
104    public void setTimezoneAsString(final String timezoneAsString) {
105      this.timezoneAsString = timezoneAsString;
106    }
107
108    @java.lang.SuppressWarnings("all")
109    public TimeZone getTimeZone() {
110      return this.timeZone;
111    }
112
113    @java.lang.SuppressWarnings("all")
114    public void setTimeZone(final TimeZone timeZone) {
115      this.timeZone = timeZone;
116    }
117
118    @java.lang.SuppressWarnings("all")
119    public Coords getCoords() {
120      return this.coords;
121    }
122
123    @java.lang.SuppressWarnings("all")
124    public void setCoords(final Coords coords) {
125      this.coords = coords;
126    }
127
128    @java.lang.SuppressWarnings("all")
129    public External getExternal() {
130      return this.external;
131    }
132
133    @java.lang.SuppressWarnings("all")
134    public void setExternal(final External external) {
135      this.external = external;
136    }
137  }
138
139
140  public static class Coords extends AbstractFacebookType {
141    @Facebook("lat")
142    private Double latitude;
143    @Facebook("long")
144    private Double longitude;
145
146    @java.lang.SuppressWarnings("all")
147    public Double getLatitude() {
148      return this.latitude;
149    }
150
151    @java.lang.SuppressWarnings("all")
152    public void setLatitude(final Double latitude) {
153      this.latitude = latitude;
154    }
155
156    @java.lang.SuppressWarnings("all")
157    public Double getLongitude() {
158      return this.longitude;
159    }
160
161    @java.lang.SuppressWarnings("all")
162    public void setLongitude(final Double longitude) {
163      this.longitude = longitude;
164    }
165  }
166
167
168  public static class External extends AbstractFacebookType {
169    @Facebook
170    private String geonames;
171    @Facebook
172    private String wikidata;
173    @Facebook
174    private String wikipedia;
175
176    @java.lang.SuppressWarnings("all")
177    public String getGeonames() {
178      return this.geonames;
179    }
180
181    @java.lang.SuppressWarnings("all")
182    public void setGeonames(final String geonames) {
183      this.geonames = geonames;
184    }
185
186    @java.lang.SuppressWarnings("all")
187    public String getWikidata() {
188      return this.wikidata;
189    }
190
191    @java.lang.SuppressWarnings("all")
192    public void setWikidata(final String wikidata) {
193      this.wikidata = wikidata;
194    }
195
196    @java.lang.SuppressWarnings("all")
197    public String getWikipedia() {
198      return this.wikipedia;
199    }
200
201    @java.lang.SuppressWarnings("all")
202    public void setWikipedia(final String wikipedia) {
203      this.wikipedia = wikipedia;
204    }
205  }
206}