Advertisement
Guest User

Pojo

a guest
Mar 31st, 2018
229
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.22 KB | None | 0 0
  1. public class Pojo implements Serializable {
  2.  
  3.     private static final long serialVersionUID = 1684857201;
  4.  
  5.     private Integer id;
  6.     private String  name;
  7.     private String  phone;
  8.  
  9.     public Pojo() {}
  10.  
  11.     public Pojo(Consumer value) {
  12.         this.id = value.id;
  13.         this.name = value.name;
  14.         this.phone = value.phone;
  15.     }
  16.  
  17.     public Pojo(
  18.             Integer id,
  19.             String  name,
  20.             String  phone
  21.     ) {
  22.         this.id = id;
  23.         this.name = name;
  24.         this.phone = phone;
  25.     }
  26.  
  27.     public Integer getId() {
  28.         return this.id;
  29.     }
  30.  
  31.     public void setId(Integer id) {
  32.         this.id = id;
  33.     }
  34.  
  35.     public String getName() {
  36.         return this.name;
  37.     }
  38.  
  39.     public void setName(String name) {
  40.         this.name = name;
  41.     }
  42.  
  43.     public String getPhone() {
  44.         return this.phone;
  45.     }
  46.  
  47.     public void setPhone(String phone) {
  48.         this.phone = phone;
  49.     }
  50.  
  51.     @Override
  52.     public String toString() {
  53.         StringBuilder sb = new StringBuilder("Pojo (");
  54.  
  55.         sb.append(id);
  56.         sb.append(", ").append(name);
  57.         sb.append(", ").append(phone);
  58.  
  59.         sb.append(")");
  60.         return sb.toString();
  61.     }
  62. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement