Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class TestFormatter implements Formatter<Test> {
- @Override
- public Test parse(String text, Locale locale) throws ParseException {
- if (Objects.isNull(text)) {
- return null;
- }
- return Test.valueOf(text.toUpperCase());
- }
- @Override
- public String print(Test object, Locale locale) {
- if (Objects.isNull(object)) {
- return null;
- }
- return object.toString().toLowerCase();
- }
- }
Add Comment
Please, Sign In to add comment