woody před 1 rokem
rodič
revize
44f2ab28b5

+ 5 - 5
framework-common/src/main/java/com/chelvc/framework/common/util/ObjectUtils.java

@@ -541,7 +541,7 @@ public final class ObjectUtils {
         boolean continuing = true;
         do {
             Field[] fields = CLASS_FIELD_MAPPING.computeIfAbsent(
-                    clazz, c -> ObjectUtils.ifNull(c.getDeclaredFields(), () -> new Field[0])
+                    clazz, c -> ifNull(c.getDeclaredFields(), () -> new Field[0])
             );
             for (Field field : fields) {
                 if (!Modifier.isStatic(field.getModifiers()) && !field.getName().startsWith("this$")) {
@@ -977,7 +977,7 @@ public final class ObjectUtils {
             buffer.append(analyse(parameterized.getRawType()));
             java.lang.reflect.Type[] args = parameterized.getActualTypeArguments();
             buffer.append(", new ").append(java.lang.reflect.Type.class.getName()).append("[]{");
-            if (ObjectUtils.notEmpty(args)) {
+            if (notEmpty(args)) {
                 for (int i = 0; i < args.length; i++) {
                     if (i > 0) {
                         buffer.append(", ");
@@ -999,11 +999,11 @@ public final class ObjectUtils {
     public static List<java.lang.reflect.Type> getGenericSuperclasses(@NonNull Class<?> clazz) {
         java.lang.reflect.Type superclass = clazz.getGenericSuperclass();
         java.lang.reflect.Type[] interfaces = clazz.getGenericInterfaces();
-        if (superclass == null && ObjectUtils.isEmpty(interfaces)) {
+        if (superclass == null && isEmpty(interfaces)) {
             return Collections.emptyList();
         } else if (superclass == null) {
             return Arrays.asList(interfaces);
-        } else if (ObjectUtils.isEmpty(interfaces)) {
+        } else if (isEmpty(interfaces)) {
             return Collections.singletonList(superclass);
         }
         List<java.lang.reflect.Type> superclasses = Lists.newArrayList(interfaces);
@@ -1050,7 +1050,7 @@ public final class ObjectUtils {
         java.lang.reflect.Type supered = lookupGenericSuperclass(clazz, superclass);
         if (supered instanceof ParameterizedType) {
             java.lang.reflect.Type[] arguments = ((ParameterizedType) supered).getActualTypeArguments();
-            return ObjectUtils.isEmpty(arguments) ? Object.class : arguments[0];
+            return isEmpty(arguments) ? Object.class : arguments[0];
         }
         return Object.class;
     }

+ 2 - 2
framework-common/src/main/java/com/chelvc/framework/common/util/StringUtils.java

@@ -1019,7 +1019,7 @@ public final class StringUtils {
                                                                    @NonNull CharSequence delimiter,
                                                                    @NonNull BiFunction<K, V, String> adapter) {
         if (ObjectUtils.isEmpty(mapping)) {
-            return StringUtils.EMPTY;
+            return EMPTY;
         }
         return mapping.entrySet().stream().filter(entry -> Objects.nonNull(entry.getKey()))
                 .map(entry -> adapter.apply(entry.getKey(), entry.getValue())).collect(Collectors.joining(delimiter));
@@ -1057,7 +1057,7 @@ public final class StringUtils {
                                                                    @NonNull BiFunction<K, V, String> adapter,
                                                                    @NonNull Comparator<? super K> comparator) {
         if (ObjectUtils.isEmpty(mapping)) {
-            return StringUtils.EMPTY;
+            return EMPTY;
         }
         return mapping.keySet().stream().filter(Objects::nonNull).sorted(comparator)
                 .map(key -> adapter.apply(key, mapping.get(key))).collect(Collectors.joining(delimiter));