Advertisement
alexandrecoussy

Untitled

Apr 1st, 2022
572
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.36 KB | None | 0 0
  1.   private String toString(Object obj) {
  2.     if (obj instanceof String) {
  3.       return (String) obj;
  4.     } else {
  5.       // no need to log for a null object
  6.       if (obj != null) {
  7.         logger.error("object type seems to be incorrect. expected type String but provided {} (value {})", obj.toString(), obj.getClass());
  8.       }
  9.       return null;
  10.     }
  11.   }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement