Guest User

Untitled

a guest
Jul 16th, 2018
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. if(user.status){
  2. //do something
  3. }else{
  4. //do something else
  5. }
  6.  
  7. class SwaggerUser{
  8. //other attributes
  9. boolean status;
  10. }
  11.  
  12. class MyUser{
  13. Status status;
  14. }
  15.  
  16. enum Status{
  17. ACTIVE(1), DEACTIVE(0), DELETE(-1)
  18. }
  19.  
  20. class UserMapper{
  21. public static MyUser map(SwaggerUser swaggerUser){
  22. //code convert here
  23. return myUser;
  24. }
  25. }
  26.  
  27. swith(status){
  28. ACTIVE:
  29. //do smth with active
  30. break;
  31. DEACTIVE:
  32. //do smth with deactive
  33. break;
  34. DELETE:
  35. //do smth with delete
  36. break;
  37. }
Add Comment
Please, Sign In to add comment