Advertisement
Guest User

Untitled

a guest
Sep 14th, 2017
81
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 String fono;
  17.     private String direccion;
  18.     private Integer cod_especialidad;
  19.     private Set<MedicamentoAlumno> DocToMedAlum;
  20.    
  21.     public Set<MedicamentoAlumno> getDocToMedAlum() {
  22.         return DocToMedAlum;
  23.     }
  24.  
  25.     public void setDocToMedAlum(Set<MedicamentoAlumno> docToMedAlum) {
  26.         DocToMedAlum = docToMedAlum;
  27.     }
  28.  
  29.     public Integer getIdDoctor() {
  30.         return idDoctor;
  31.     }
  32.  
  33.     public void setIdDoctor(Integer idDoctor) {
  34.         this.idDoctor = idDoctor;
  35.     }
  36.  
  37.     public String getUsername() {
  38.         return username;
  39.     }
  40.  
  41.     public void setUsername(String username) {
  42.         this.username = username;
  43.     }
  44.  
  45.     public String getPassword() {
  46.         return password;
  47.     }
  48.  
  49.     public void setPassword(String password) {
  50.         this.password = password;
  51.     }
  52.  
  53.     public String getNombres() {
  54.         return nombres;
  55.     }
  56.  
  57.     public void setNombres(String nombres) {
  58.         this.nombres = nombres;
  59.     }
  60.  
  61.     public String getApellidos() {
  62.         return apellidos;
  63.     }
  64.  
  65.     public void setApellidos(String apellidos) {
  66.         this.apellidos = apellidos;
  67.     }
  68.  
  69.     public String getFono() {
  70.         return fono;
  71.     }
  72.  
  73.     public void setFono(String fono) {
  74.         this.fono = fono;
  75.     }
  76.  
  77.     public String getDireccion() {
  78.         return direccion;
  79.     }
  80.  
  81.     public void setDireccion(String direccion) {
  82.         this.direccion = direccion;
  83.     }
  84.  
  85.     public Integer getCod_especialidad() {
  86.         return cod_especialidad;
  87.     }
  88.  
  89.     public void setCod_especialidad(Integer cod_especialidad) {
  90.         this.cod_especialidad = cod_especialidad;
  91.     }
  92.    
  93.    
  94.  
  95.    
  96.    
  97.     /** NO MODIFICAR DE AQUI PARA ABAJO: ATTE, LOS AYUDANTES **/
  98.     @Override
  99.     public boolean equals(Object obj) {
  100.         if (this == obj)
  101.             return true;
  102.         if (obj == null)
  103.             return false;
  104.         if (getClass() != obj.getClass())
  105.             return false;
  106.         final Doctor other = (Doctor) obj;
  107.         if (username == null) {
  108.             if (other.username != null)
  109.                 return false;
  110.         } else if (!username.equals(other.username))
  111.             return false;
  112.         return true;
  113.     }
  114.    
  115.     @Override
  116.     public int hashCode() {
  117.         final int prime = 31;
  118.         int result = 1;
  119.         result = prime * result + ((username == null) ? 0 : username.hashCode());
  120.         return result;
  121.     }
  122.    
  123.     @Override
  124.     public GrantedAuthority[] getAuthorities() {
  125.         GrantedAuthority[] authorities = new GrantedAuthority[1];
  126.         authorities[0] = new GrantedAuthorityImpl("ROLE_DOC");
  127.         return authorities;
  128.     }
  129.  
  130.     @Override
  131.     public boolean isAccountNonExpired() {
  132.         return false;
  133.     }
  134.     @Override
  135.     public boolean isAccountNonLocked() {
  136.         return false;
  137.     }
  138.     @Override
  139.     public boolean isCredentialsNonExpired() {
  140.         return false;
  141.     }
  142.     @Override
  143.     public boolean isEnabled() {
  144.         return false;
  145.     }
  146. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement