[text] Usuario

Viewer

  1.  
  2. package com.model.entities;
  3.  
  4. import java.util.Objects;
  5.  
  6. public class Usuario {
  7.     
  8.     private Integer id;
  9.     private String nome;
  10.     private String email;
  11.     
  12.     
  13.     public Usuario(){
  14.     
  15.     }
  16.  
  17.     public Usuario(Integer id, String nome, String email) {
  18.         this.id = id;
  19.         this.nome = nome;
  20.         this.email = email;
  21.     }
  22.  
  23.     public Integer getId() {
  24.         return id;
  25.     }
  26.  
  27.     public void setId(Integer id) {
  28.         this.id = id;
  29.     }
  30.  
  31.     public String getNome() {
  32.         return nome;
  33.     }
  34.  
  35.     public void setNome(String nome) {
  36.         this.nome = nome;
  37.     }
  38.  
  39.     public String getEmail() {
  40.         return email;
  41.     }
  42.  
  43.     public void setEmail(String email) {
  44.         this.email = email;
  45.     }
  46.  
  47.     @Override
  48.     public int hashCode() {
  49.         int hash = 5;
  50.         hash = 97 * hash + Objects.hashCode(this.id);
  51.         return hash;
  52.     }
  53.  
  54.     @Override
  55.     public boolean equals(Object obj) {
  56.         if (this == obj) {
  57.             return true;
  58.         }
  59.         if (obj == null) {
  60.             return false;
  61.         }
  62.         if (getClass() != obj.getClass()) {
  63.             return false;
  64.         }
  65.         final Usuario other = (Usuario) obj;
  66.         if (!Objects.equals(this.id, other.id)) {
  67.             return false;
  68.         }
  69.         return true;
  70.     }
  71.  
  72.     @Override
  73.     public String toString() {
  74.         return "Usuario{" + "id=" + id + ", nome=" + nome + ", email=" + email + '}';
  75.     }
  76.     
  77. }
  78.  

Editor

You can edit this paste and save as new:


File Description
  • Usuario
  • Paste Code
  • 14 Apr-2021
  • 1.48 Kb
You can Share it: