T
- the value type@Immutable public class Enumeration<T> extends Object implements TypeConstraint
Constructor and Description |
---|
Enumeration()
Creates a default constraint where no restriction on the allowed values
is present.
|
Enumeration(Collection<? extends T> values,
boolean allowOthers)
Create a constraint that holds allowed values for a type
|
Modifier and Type | Method and Description |
---|---|
Collection<? extends T> |
getValues() |
boolean |
isAllowOthers() |
boolean |
isInheritable()
Determines if the constraint is inheritable, meaning it may be used for a
sub-type.
|
public Enumeration()
public Enumeration(Collection<? extends T> values, boolean allowOthers)
values
- the collection of allowed values, ownership of the
collection is transferred to the constraintallowOthers
- if other values are allowedpublic Collection<? extends T> getValues()
null
there is no
such restrictionpublic boolean isAllowOthers()
getValues()
are
allowed for the type, should be ignored if getValues()
returns null
public boolean isInheritable()
TypeConstraint
isInheritable
in interface TypeConstraint
TypeConstraint.isInheritable()
Build 2013-10-07_11-27-38
Revision 99b27713a799a59a21b0b166eaaea8aaefbf125a