
commons.box.app.DataRange 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;
/**
* 表示数据范围 可用于 查询表达式 并与 bewteen 配合使用
*/
public class DataRange implements Serializable {
private static final long serialVersionUID = 8849891155466905987L;
private T begin;
private T end;
public static DataRange from(T begin, T end) {
return new DataRange<>(begin, end);
}
public DataRange() {
}
public DataRange(T begin, T end) {
this.begin = begin;
this.end = end;
}
public T getBegin() {
return begin;
}
public void setBegin(T begin) {
this.begin = begin;
}
public T getEnd() {
return end;
}
public void setEnd(T end) {
this.end = end;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
DataRange> dataRange = (DataRange>) o;
return Objects.equals(begin, dataRange.begin) &&
Objects.equals(end, dataRange.end);
}
@Override
public int hashCode() {
return Objects.hash(begin, end);
}
@Override
public String toString() {
return "{" + begin + "->" + end + '}';
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy