Package com.exedio.cope.pattern
Class Range<E extends Comparable<E>>
- java.lang.Object
-
- com.exedio.cope.pattern.Range<E>
-
- All Implemented Interfaces:
Serializable
public final class Range<E extends Comparable<E>> extends Object implements Serializable
If the value forfrom
is null this means, that the range contains all values less or equal toto
. If the value for() to
is null this means, that the range contains all values greater or equal tofrom
. If both the value forfrom
andto
is null this means, that the range contains all values.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description Range(E from, E to)
Deprecated.UsevalueOf(Comparable, Comparable)
instead.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description boolean
contains(E value)
boolean
equals(Object other)
E
getFrom()
E
getTo()
int
hashCode()
static <E extends Comparable<E>>
Range<E>newRange(E from, E to)
Deprecated.UsevalueOf(Comparable,Comparable)
insteadString
toString()
static <E extends Comparable<E>>
Range<E>valueOf(E from, E to)
-
-
-
Constructor Detail
-
Range
@Deprecated public Range(E from, E to)
Deprecated.UsevalueOf(Comparable, Comparable)
instead.
-
-
Method Detail
-
valueOf
public static <E extends Comparable<E>> Range<E> valueOf(E from, E to)
-
getFrom
public E getFrom()
-
getTo
public E getTo()
-
contains
public boolean contains(E value)
-
newRange
@Deprecated public static <E extends Comparable<E>> Range<E> newRange(E from, E to)
Deprecated.UsevalueOf(Comparable,Comparable)
instead
-
-