Adicion método cambiar rol Usuario.java

parent 2a35ce69
......@@ -2,6 +2,11 @@ package com.carpooling.carpoolingaoraha.entidades;
import java.util.Date;
import com.carpooling.carpoolingaoraha.entidades.*;
import com.carpooling.carpoolingaoraha.entidades.rol.*;
import static com.carpooling.carpoolingaoraha.entidades.rol.CONDUCTOR;
import static com.carpooling.carpoolingaoraha.entidades.rol.PASAJERO;
enum rol{
CONDUCTOR, PASAJERO
};
......@@ -100,4 +105,12 @@ public class Usuario {
public void setRol(rol rol) {
this.rol = rol;
}
public void cambiarRol(rol rol){
if(rol == CONDUCTOR){
rol = PASAJERO;
}else{
rol = CONDUCTOR;
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment