Advertisement
Guest User

PhoneDto

a guest
Jul 13th, 2018
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.44 KB | None | 0 0
  1. public class PhoneDto {
  2.  
  3.     private String objectId;
  4.     private String value;
  5.     private Date created;
  6.     private Date updated;
  7.  
  8.     public PhoneDto() {
  9.     }
  10.  
  11.     public PhoneDto(String objectId, String value, Date created, Date updated) {
  12.         this.objectId = objectId;
  13.         this.value = value;
  14.         this.created = created;
  15.         this.updated = updated;
  16.     }
  17.  
  18.     public PhoneDto(@NonNull Phone phone) {
  19.         this.objectId = phone.getId();
  20.         this.value = phone.getValue();
  21.         this.created = phone.getCreated();
  22.         this.updated = phone.getUpdated();
  23.     }
  24.  
  25.     @NonNull
  26.     public Phone map() {
  27.         final Phone phone = new Phone();
  28.         phone.setId(objectId);
  29.         phone.setValue(value);
  30.         phone.setCreated(created);
  31.         phone.setUpdated(updated);
  32.         return phone;
  33.     }
  34.  
  35.     public String getObjectId() {
  36.         return objectId;
  37.     }
  38.  
  39.     public void setObjectId(String objectId) {
  40.         this.objectId = objectId;
  41.     }
  42.  
  43.     public String getValue() {
  44.         return value;
  45.     }
  46.  
  47.     public void setValue(String value) {
  48.         this.value = value;
  49.     }
  50.  
  51.     public Date getCreated() {
  52.         return created;
  53.     }
  54.  
  55.     public void setCreated(Date created) {
  56.         this.created = created;
  57.     }
  58.  
  59.     public Date getUpdated() {
  60.         return updated;
  61.     }
  62.  
  63.     public void setUpdated(Date updated) {
  64.         this.updated = updated;
  65.     }
  66. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement