Humboldt Alignment Editor 2.5.0

eu.esdihumboldt.hale.common.schema.model.constraint.type
Class Enumeration<T>

java.lang.Object
  extended by eu.esdihumboldt.hale.common.schema.model.constraint.type.Enumeration<T>
Type Parameters:
T - the value type
All Implemented Interfaces:
TypeConstraint
Direct Known Subclasses:
UnionEnumeration

@Immutable
public class Enumeration<T>
extends Object
implements TypeConstraint

Constraint that holds allowed values for a type

Author:
Simon Templer

Constructor Summary
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
 
Method Summary
 Collection<? extends T> getValues()
           
 boolean isAllowOthers()
           
 boolean isInheritable()
          Determines if the constraint is inheritable, meaning it may be used for a sub-type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Enumeration

public Enumeration()
Creates a default constraint where no restriction on the allowed values is present.


Enumeration

public Enumeration(Collection<? extends T> values,
                   boolean allowOthers)
Create a constraint that holds allowed values for a type

Parameters:
values - the collection of allowed values, ownership of the collection is transferred to the constraint
allowOthers - if other values are allowed
Method Detail

getValues

public Collection<? extends T> getValues()
Returns:
the collection of allowed values, null there is no such restriction

isAllowOthers

public boolean isAllowOthers()
Returns:
if other values than those returned by getValues() are allowed for the type, should be ignored if getValues() returns null

isInheritable

public boolean isInheritable()
Description copied from interface: TypeConstraint
Determines if the constraint is inheritable, meaning it may be used for a sub-type. A constraint may only be inherited if it is not overriden in the sub-type.

Specified by:
isInheritable in interface TypeConstraint
Returns:
if the constraint is inheritable
See Also:
TypeConstraint.isInheritable()

Humboldt Alignment Editor 2.5.0

Build 2012-12-03_12-30-59
Revision 9d2dd4b0318cda9f1393b1ddd390f7f792d70a2d