Advertisement
Guest User

Untitled

a guest
Jun 30th, 2016
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.21 KB | None | 0 0
  1. switch(attributeName)
  2. {
  3. case {attributeName} :
  4. log.info("Currently switching on value... ${attributeName}")
  5.  
  6. case user.getFirstNameMapping():
  7. model.user.userInfo.firstName = attributeValue
  8. break
  9. case user.getLastNameMapping():
  10. model.user.userInfo.lastName = attributeValue
  11. break
  12. case user.getAuthenticationKeyMapping():
  13. model.authenticationValue = attributeValue
  14. break
  15. case user.getEmailMapping():
  16. model.email = attributeValue.toLowerCase()
  17. break
  18. }
  19.  
  20. if(attributeName.equals(user.getFirstNameMapping())
  21. {
  22. ...
  23. }
  24.  
  25. switch(true)
  26. {
  27. case {attributeName} :
  28. log.info("Currently switching on value... ${attributeName}")
  29. case {user.getFirstNameMapping().equals(attributeName)}:
  30. model.user.userInfo.firstName = attributeValue
  31. break
  32. case {user.getLastNameMapping().equals(attributeName)}:
  33. model.user.userInfo.lastName = attributeValue
  34. break
  35. case {user.getAuthenticationKeyMapping().equals(attributeName)}:
  36. model.authenticationValue = attributeValue
  37. break
  38. case {user.getEmailMapping().equals(attributeName)}:
  39. model.email = attributeValue.toLowerCase()
  40. break
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement