001// Generated by delombok at Tue May 28 20:17:00 UTC 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.whatsapp.platform.send;
024
025import com.restfb.Facebook;
026import com.restfb.types.AbstractFacebookType;
027import com.restfb.types.whatsapp.platform.send.contact.*;
028import com.restfb.util.DateUtils;
029import java.util.ArrayList;
030import java.util.Date;
031import java.util.List;
032
033public class Contact extends AbstractFacebookType {
034  @Facebook
035  private List<Address> addresses;
036  @Facebook
037  private String birthday;
038  @Facebook
039  private List<Email> emails;
040  @Facebook
041  private Name name;
042  @Facebook
043  private Organisation org;
044  @Facebook
045  private List<Phone> phones;
046  @Facebook
047  private List<Url> urls;
048
049  public void setBirthday(Date birthday) {
050    this.birthday = DateUtils.toShortFormatFromDate(birthday);
051  }
052
053  public void addAddress(Address address) {
054    if (addresses == null) {
055      this.addresses = new ArrayList<>();
056    }
057    this.addresses.add(address);
058  }
059
060  public void addEmail(Email email) {
061    if (emails == null) {
062      this.emails = new ArrayList<>();
063    }
064    this.emails.add(email);
065  }
066
067  public void addPhone(Phone phone) {
068    if (phones == null) {
069      this.phones = new ArrayList<>();
070    }
071    this.phones.add(phone);
072  }
073
074  public void addUrl(Url url) {
075    if (urls == null) {
076      this.urls = new ArrayList<>();
077    }
078    this.urls.add(url);
079  }
080
081  @java.lang.SuppressWarnings("all")
082  public void setName(final Name name) {
083    this.name = name;
084  }
085
086  @java.lang.SuppressWarnings("all")
087  public void setOrg(final Organisation org) {
088    this.org = org;
089  }
090}