Guest User

Untitled

a guest
Jun 22nd, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. public class TestFormatter implements Formatter<Test> {
  2.  
  3. @Override
  4. public Test parse(String text, Locale locale) throws ParseException {
  5. if (Objects.isNull(text)) {
  6. return null;
  7. }
  8. return Test.valueOf(text.toUpperCase());
  9. }
  10.  
  11. @Override
  12. public String print(Test object, Locale locale) {
  13. if (Objects.isNull(object)) {
  14. return null;
  15. }
  16. return object.toString().toLowerCase();
  17. }
  18. }
Add Comment
Please, Sign In to add comment