Advertisement
Guest User

Untitled

a guest
Sep 14th, 2017
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 3.02 KB | None | 0 0
  1. package cl.utfsm.base.domain;
  2.  
  3. import java.util.Set;
  4.  
  5. import org.springframework.security.GrantedAuthority;
  6. import org.springframework.security.GrantedAuthorityImpl;
  7. import org.springframework.security.userdetails.UserDetails;
  8.  
  9. public class Doctor implements UserDetails{
  10.     private static final long serialVersionUID = 378521820644053287L;
  11.     private Integer idDoctor;
  12.     private String username;
  13.     private String password;
  14.     private String nombres;
  15.     private String apellidos;
  16.     private Integer codEspecialidad;
  17.     private String fono;
  18.     private String direccion;
  19.     private Set<MedicamentoAlumno> medicamentosAlumno;
  20.    
  21.     public Integer getIdDoctor() {
  22.         return idDoctor;
  23.     }
  24.     public void setIdDoctor(Integer idDoctor) {
  25.         this.idDoctor = idDoctor;
  26.     }
  27.     public String getUsername() {
  28.         return username;
  29.     }
  30.     public void setUsername(String username) {
  31.         this.username = username;
  32.     }
  33.     public String getPassword() {
  34.         return password;
  35.     }
  36.     public void setPassword(String password) {
  37.         this.password = password;
  38.     }
  39.        
  40.     public String getNombres() {
  41.         return nombres;
  42.     }
  43.     public void setNombres(String nombres) {
  44.         this.nombres = nombres;
  45.     }
  46.     public String getApellidos() {
  47.         return apellidos;
  48.     }
  49.     public void setApellidos(String apellidos) {
  50.         this.apellidos = apellidos;
  51.     }
  52.     public Integer getCodEspecialidad() {
  53.         return codEspecialidad;
  54.     }
  55.     public void setCodEspecialidad(Integer codEspecialidad) {
  56.         this.codEspecialidad = codEspecialidad;
  57.     }
  58.     public String getFono() {
  59.         return fono;
  60.     }
  61.     public void setFono(String fono) {
  62.         this.fono = fono;
  63.     }
  64.     public String getDireccion() {
  65.         return direccion;
  66.     }
  67.     public void setDireccion(String direccion) {
  68.         this.direccion = direccion;
  69.     }
  70.     public Set<MedicamentoAlumno> getMedicamentosAlumno() {
  71.         return medicamentosAlumno;
  72.     }
  73.     public void setMedicamentosAlumno(Set<MedicamentoAlumno> medicamentosAlumno) {
  74.         this.medicamentosAlumno = medicamentosAlumno;
  75.     }
  76.    
  77.     /** NO MODIFICAR DE AQUI PARA ABAJO: ATTE, LOS AYUDANTES **/
  78.     @Override
  79.     public boolean equals(Object obj) {
  80.         if (this == obj)
  81.             return true;
  82.         if (obj == null)
  83.             return false;
  84.         if (getClass() != obj.getClass())
  85.             return false;
  86.         final Doctor other = (Doctor) obj;
  87.         if (username == null) {
  88.             if (other.username != null)
  89.                 return false;
  90.         } else if (!username.equals(other.username))
  91.             return false;
  92.         return true;
  93.     }
  94.    
  95.     @Override
  96.     public int hashCode() {
  97.         final int prime = 31;
  98.         int result = 1;
  99.         result = prime * result + ((username == null) ? 0 : username.hashCode());
  100.         return result;
  101.     }
  102.    
  103.     @Override
  104.     public GrantedAuthority[] getAuthorities() {
  105.         GrantedAuthority[] authorities = new GrantedAuthority[1];
  106.         authorities[0] = new GrantedAuthorityImpl("ROLE_DOC");
  107.         return authorities;
  108.     }
  109.  
  110.     @Override
  111.     public boolean isAccountNonExpired() {
  112.         return false;
  113.     }
  114.     @Override
  115.     public boolean isAccountNonLocked() {
  116.         return false;
  117.     }
  118.     @Override
  119.     public boolean isCredentialsNonExpired() {
  120.         return false;
  121.     }
  122.     @Override
  123.     public boolean isEnabled() {
  124.         return false;
  125.     }
  126.  
  127. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement