예제 #1
0
 public static void isInstanceOf(Class<?> type, Object obj, String message) {
   notNull(type, "Type to check against must not be null");
   if (!type.isInstance(obj)) {
     throw new IllegalArgumentException(
         (Str.Utils.notBlank(message) ? message + " " : "")
             + "Object of class ["
             + (obj != null ? obj.getClass().getName() : "null")
             + "] must be an instance of "
             + type);
   }
 }
예제 #2
0
 public static void notBlank(String text, String message) {
   if (!Str.Utils.notBlank(text)) {
     throw new IllegalArgumentException(message);
   }
 }