
commons.box.app.SafeObject Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of commons-box-app Show documentation
Show all versions of commons-box-app Show documentation
Common utils for BOX projects.
The newest version!
package commons.box.app;
import java.io.Serializable;
import java.util.Objects;
/**
* 安全对象 用于包含目标值 其中目标值不为空
*/
public class SafeObject implements Serializable {
private final T object;
public SafeObject() {
this.object = null;
}
public SafeObject(T object) {
this.object = object;
}
public T getObject() {
return object;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
SafeObject> that = (SafeObject>) o;
return Objects.equals(object, that.object);
}
@Override
public int hashCode() {
return Objects.hash(object);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy