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.webhook;
024
025import java.util.ArrayList;
026import java.util.Date;
027import java.util.List;
028import com.restfb.Facebook;
029import com.restfb.JsonMapper.JsonMappingCompleted;
030import com.restfb.types.webhook.messaging.MessagingItem;
031
032public class WebhookEntry {
033  @Facebook
034  private String uid;
035  @Facebook
036  private String id;
037  private Date time = new Date();
038  @Facebook("time")
039  private Long rawTime;
040  @Facebook("changed_fields")
041  private List<String> changedFields = new ArrayList<>();
042  @Facebook
043  private List<Change> changes = new ArrayList<>();
044  @Facebook
045  private List<MessagingItem> messaging = new ArrayList<>();
046  @Facebook
047  private List<MessagingItem> standby = new ArrayList<>();
048
049  public boolean hasStandby() {
050    return !standby.isEmpty();
051  }
052
053  @JsonMappingCompleted
054  private void convertDate() {
055    if (rawTime != null) {
056      time.setTime(rawTime * 1000);
057    }
058  }
059
060  @java.lang.Override
061  @java.lang.SuppressWarnings("all")
062  public java.lang.String toString() {
063    return "WebhookEntry(uid=" + this.getUid() + ", id=" + this.getId() + ", time=" + this.getTime() + ", rawTime=" + this.rawTime + ", changedFields=" + this.getChangedFields() + ", changes=" + this.getChanges() + ", messaging=" + this.getMessaging() + ", standby=" + this.getStandby() + ")";
064  }
065
066  @java.lang.SuppressWarnings("all")
067  public String getUid() {
068    return this.uid;
069  }
070
071  @java.lang.SuppressWarnings("all")
072  public void setUid(final String uid) {
073    this.uid = uid;
074  }
075
076  @java.lang.SuppressWarnings("all")
077  public String getId() {
078    return this.id;
079  }
080
081  @java.lang.SuppressWarnings("all")
082  public void setId(final String id) {
083    this.id = id;
084  }
085
086  @java.lang.SuppressWarnings("all")
087  public Date getTime() {
088    return this.time;
089  }
090
091  @java.lang.SuppressWarnings("all")
092  public void setTime(final Date time) {
093    this.time = time;
094  }
095
096  @java.lang.SuppressWarnings("all")
097  public List<String> getChangedFields() {
098    return this.changedFields;
099  }
100
101  @java.lang.SuppressWarnings("all")
102  public void setChangedFields(final List<String> changedFields) {
103    this.changedFields = changedFields;
104  }
105
106  @java.lang.SuppressWarnings("all")
107  public List<Change> getChanges() {
108    return this.changes;
109  }
110
111  @java.lang.SuppressWarnings("all")
112  public void setChanges(final List<Change> changes) {
113    this.changes = changes;
114  }
115
116  @java.lang.SuppressWarnings("all")
117  public List<MessagingItem> getMessaging() {
118    return this.messaging;
119  }
120
121  @java.lang.SuppressWarnings("all")
122  public void setMessaging(final List<MessagingItem> messaging) {
123    this.messaging = messaging;
124  }
125
126  @java.lang.SuppressWarnings("all")
127  public List<MessagingItem> getStandby() {
128    return this.standby;
129  }
130
131  @java.lang.SuppressWarnings("all")
132  public void setStandby(final List<MessagingItem> standby) {
133    this.standby = standby;
134  }
135}