@Immutable public class Cardinality extends Object implements GroupPropertyConstraint, PropertyConstraint
Modifier and Type | Field and Description |
---|---|
static Cardinality |
CC_ANY_NUMBER
Cardinality constraint for properties that occur in any number (zero to
infinity)
|
static Cardinality |
CC_AT_LEAST_ONCE
Cardinality constraint for properties that occur at least once (one to
infinity)
|
static Cardinality |
CC_EXACTLY_ONCE
Cardinality constraint for properties that occur exactly once (one)
|
static Cardinality |
CC_OPTIONAL
Cardinality constraint for properties that occur once or not at all (zero
to one)
|
static long |
UNBOUNDED
Value for unrestricted
maxOccurs |
Constructor and Description |
---|
Cardinality()
Creates a default cardinality constraint with
minOccurs and
maxOccurs one.NOTE: Instead of using the constructor to create new instances please use get(long, long) if possible. |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj) |
static Cardinality |
get(long minOccurs,
long maxOccurs)
Get the cardinality constraint with the given occurrences
|
long |
getMaxOccurs()
Get the number of maximum occurrences of a property
|
long |
getMinOccurs()
Get the number of minimum occurrences of a property
|
int |
hashCode() |
String |
toString() |
public static final long UNBOUNDED
maxOccurs
public static final Cardinality CC_EXACTLY_ONCE
public static final Cardinality CC_OPTIONAL
public static final Cardinality CC_AT_LEAST_ONCE
public static final Cardinality CC_ANY_NUMBER
public Cardinality()
minOccurs
and
maxOccurs
one.get(long, long)
if possible.public static Cardinality get(long minOccurs, long maxOccurs)
minOccurs
- the number of minimum occurrences of a property, may not
be negativemaxOccurs
- the number of maximum occurrences of a property,
-1L for an infinite maximum occurrencepublic long getMinOccurs()
public long getMaxOccurs()
Build 2013-10-07_11-27-38
Revision 99b27713a799a59a21b0b166eaaea8aaefbf125a