Woody 1 settimana fa
parent
commit
a985146f3d

+ 2 - 2
framework-common/src/main/java/com/chelvc/framework/common/model/Range.java

@@ -92,11 +92,11 @@ public final class Range implements Serializable {
     @Override
     public String toString() {
         StringBuilder buffer = new StringBuilder();
-        if (StringUtils.notEmpty(this.min)) {
+        if (this.min != null) {
             buffer.append(this.min);
         }
         buffer.append('_');
-        if (StringUtils.notEmpty(this.max)) {
+        if (this.max != null) {
             buffer.append(this.max);
         }
         return buffer.toString();

+ 0 - 72
framework-common/src/main/java/com/chelvc/framework/common/model/Reference.java

@@ -1,72 +0,0 @@
-package com.chelvc.framework.common.model;
-
-import java.io.Serializable;
-import java.util.function.Supplier;
-
-import lombok.NonNull;
-
-/**
- * 对象引用
- *
- * @param <T> 引用对象类型
- * @author Woody
- * @date 2024/1/30
- */
-public final class Reference<T> implements Serializable {
-    /**
-     * 目标对象实例
-     */
-    private T target;
-
-    public Reference() {
-        this(null);
-    }
-
-    public Reference(T target) {
-        this.target = target;
-    }
-
-    /**
-     * 获取引用目标
-     *
-     * @return 目标对象实例
-     */
-    public T get() {
-        return this.target;
-    }
-
-    /**
-     * 获取引用目标
-     *
-     * @param defaultValue 默认值
-     * @return 目标对象实例
-     */
-    public T get(T defaultValue) {
-        if (this.target == null) {
-            this.target = defaultValue;
-        }
-        return this.target;
-    }
-
-    /**
-     * 获取引用目标
-     *
-     * @param supplier 默认值函数
-     * @return 目标对象实例
-     */
-    public T get(@NonNull Supplier<T> supplier) {
-        if (this.target == null) {
-            this.target = supplier.get();
-        }
-        return this.target;
-    }
-
-    /**
-     * 设置引用目标
-     *
-     * @param target 目标对象实例
-     */
-    public void set(T target) {
-        this.target = target;
-    }
-}