Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package cl.utfsm.base.domain;
- import java.util.Set;
- import org.springframework.security.GrantedAuthority;
- import org.springframework.security.GrantedAuthorityImpl;
- import org.springframework.security.userdetails.UserDetails;
- public class Doctor implements UserDetails{
- private static final long serialVersionUID = 378521820644053287L;
- private Integer idDoctor;
- private String username;
- private String password;
- private String nombres;
- private String apellidos;
- private String fono;
- private String direccion;
- private Integer cod_especialidad;
- private Set<MedicamentoAlumno> DocToMedAlum;
- public Set<MedicamentoAlumno> getDocToMedAlum() {
- return DocToMedAlum;
- }
- public void setDocToMedAlum(Set<MedicamentoAlumno> docToMedAlum) {
- DocToMedAlum = docToMedAlum;
- }
- public Integer getIdDoctor() {
- return idDoctor;
- }
- public void setIdDoctor(Integer idDoctor) {
- this.idDoctor = idDoctor;
- }
- public String getUsername() {
- return username;
- }
- public void setUsername(String username) {
- this.username = username;
- }
- public String getPassword() {
- return password;
- }
- public void setPassword(String password) {
- this.password = password;
- }
- public String getNombres() {
- return nombres;
- }
- public void setNombres(String nombres) {
- this.nombres = nombres;
- }
- public String getApellidos() {
- return apellidos;
- }
- public void setApellidos(String apellidos) {
- this.apellidos = apellidos;
- }
- public String getFono() {
- return fono;
- }
- public void setFono(String fono) {
- this.fono = fono;
- }
- public String getDireccion() {
- return direccion;
- }
- public void setDireccion(String direccion) {
- this.direccion = direccion;
- }
- public Integer getCod_especialidad() {
- return cod_especialidad;
- }
- public void setCod_especialidad(Integer cod_especialidad) {
- this.cod_especialidad = cod_especialidad;
- }
- /** NO MODIFICAR DE AQUI PARA ABAJO: ATTE, LOS AYUDANTES **/
- @Override
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (getClass() != obj.getClass())
- return false;
- final Doctor other = (Doctor) obj;
- if (username == null) {
- if (other.username != null)
- return false;
- } else if (!username.equals(other.username))
- return false;
- return true;
- }
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result + ((username == null) ? 0 : username.hashCode());
- return result;
- }
- @Override
- public GrantedAuthority[] getAuthorities() {
- GrantedAuthority[] authorities = new GrantedAuthority[1];
- authorities[0] = new GrantedAuthorityImpl("ROLE_DOC");
- return authorities;
- }
- @Override
- public boolean isAccountNonExpired() {
- return false;
- }
- @Override
- public boolean isAccountNonLocked() {
- return false;
- }
- @Override
- public boolean isCredentialsNonExpired() {
- return false;
- }
- @Override
- public boolean isEnabled() {
- return false;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement