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;
024
025import static com.restfb.util.DateUtils.toDateFromShortFormat;
026import java.util.ArrayList;
027import java.util.Collections;
028import java.util.Date;
029import java.util.List;
030import com.restfb.Facebook;
031import com.restfb.JsonMapper;
032
033/**
034 * Represents the <a href="https://developers.facebook.com/docs/graph-api/reference/work-experience/">Work
035 * Experience</a> type
036 * 
037 * @deprecated since breaking change on 4 April, 2018
038 */
039@Deprecated
040public class WorkExperience extends FacebookType {
041  private static final long serialVersionUID = 1L;
042  @Facebook
043  private String description;
044  @Facebook
045  private Page employer;
046  private Date endDate;
047  @Facebook("end_date")
048  private transient String rawEndDate;
049  @Facebook
050  private User from;
051  @Facebook
052  private Page location;
053  @Facebook
054  private Page position;
055  @Facebook
056  private List<ProjectExperience> projects = new ArrayList<>();
057  private Date startDate;
058  @Facebook("start_date")
059  private transient String rawStartDate;
060  @Facebook
061  private List<User> with = new ArrayList<>();
062
063  @JsonMapper.JsonMappingCompleted
064  void convertTime() {
065    startDate = toDateFromShortFormat(rawStartDate);
066    endDate = toDateFromShortFormat(rawEndDate);
067  }
068
069  public List<User> getWith() {
070    return Collections.unmodifiableList(with);
071  }
072
073  public boolean addWith(User withUser) {
074    return with.add(withUser);
075  }
076
077  public boolean removeWith(User withUser) {
078    return with.remove(withUser);
079  }
080
081  public List<ProjectExperience> getProjects() {
082    return Collections.unmodifiableList(projects);
083  }
084
085  public boolean addProject(ProjectExperience projectExperience) {
086    return projects.add(projectExperience);
087  }
088
089  public boolean removeProject(ProjectExperience projectExperience) {
090    return projects.remove(projectExperience);
091  }
092
093  @java.lang.SuppressWarnings("all")
094  public String getDescription() {
095    return this.description;
096  }
097
098  @java.lang.SuppressWarnings("all")
099  public void setDescription(final String description) {
100    this.description = description;
101  }
102
103  @java.lang.SuppressWarnings("all")
104  public Page getEmployer() {
105    return this.employer;
106  }
107
108  @java.lang.SuppressWarnings("all")
109  public void setEmployer(final Page employer) {
110    this.employer = employer;
111  }
112
113  @java.lang.SuppressWarnings("all")
114  public Date getEndDate() {
115    return this.endDate;
116  }
117
118  @java.lang.SuppressWarnings("all")
119  public void setEndDate(final Date endDate) {
120    this.endDate = endDate;
121  }
122
123  @java.lang.SuppressWarnings("all")
124  public User getFrom() {
125    return this.from;
126  }
127
128  @java.lang.SuppressWarnings("all")
129  public void setFrom(final User from) {
130    this.from = from;
131  }
132
133  @java.lang.SuppressWarnings("all")
134  public Page getLocation() {
135    return this.location;
136  }
137
138  @java.lang.SuppressWarnings("all")
139  public void setLocation(final Page location) {
140    this.location = location;
141  }
142
143  @java.lang.SuppressWarnings("all")
144  public Page getPosition() {
145    return this.position;
146  }
147
148  @java.lang.SuppressWarnings("all")
149  public void setPosition(final Page position) {
150    this.position = position;
151  }
152
153  @java.lang.SuppressWarnings("all")
154  public Date getStartDate() {
155    return this.startDate;
156  }
157
158  @java.lang.SuppressWarnings("all")
159  public void setStartDate(final Date startDate) {
160    this.startDate = startDate;
161  }
162}