com.sap.tc.cmi.metadata

Enum CMICardinality

java.lang.Object
  extended by java.lang.Enum<CMICardinality>
      extended by com.sap.tc.cmi.metadata.CMICardinality
All Implemented Interfaces:
Serializable, Comparable<CMICardinality>

public enum CMICardinality
extends Enum<CMICardinality>

Describes the cardinality of a relation role. This type can be called by applications or frameworks using CMI, but DO NOT EXTEND IT!

Starting with NW05, the Web Dynpro context uses this class to describe its cardinalities, too.

Type Classification Type Classification:

This class is part of the Common Model Interface, so applications may reference it or call any method of this type, but they must not subclass it.


Enum Constant Summary
MANY
          Constant for the role cardinality * (== 0..* == 0..n)
ONE
          Constant for the role cardinality 1 (== 1..1)
ONE_TO_MANY
          Constant for the role cardinality 1..* (== 1..n)
ZERO_TO_ONE
          Constant for the role cardinality 0..1
 
Field Summary
static CMICardinality CARDINALITY_MANY
          Deprecated. since NW05, use MANY
static CMICardinality CARDINALITY_ONE
          Deprecated. since NW05, use ONE
static CMICardinality CARDINALITY_ONE_TO_MANY
          Deprecated. since NW05, use ONE_TO_MANY
static CMICardinality CARDINALITY_ZERO_TO_ONE
          Deprecated. since NW05, use ZERO_TO_ONE
 
Method Summary
 boolean isMandatory()
          Returns true, if the cardinality is 1 or 1
 boolean isMultiple()
          Returns true, if the cardinality is * or 1
static CMICardinality valueOf(boolean mandatory, boolean multiple)
          Returns the cardinality with the given attributes.
static CMICardinality valueOf(String name)
          Returns the enum constant of this type with the specified name.
static CMICardinality[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

ZERO_TO_ONE

public static final CMICardinality ZERO_TO_ONE
Constant for the role cardinality 0..1

Since:
NW05

MANY

public static final CMICardinality MANY
Constant for the role cardinality * (== 0..* == 0..n)

Since:
NW05

ONE

public static final CMICardinality ONE
Constant for the role cardinality 1 (== 1..1)

Since:
NW05

ONE_TO_MANY

public static final CMICardinality ONE_TO_MANY
Constant for the role cardinality 1..* (== 1..n)

Since:
NW05
Field Detail

CARDINALITY_ZERO_TO_ONE

public static final CMICardinality CARDINALITY_ZERO_TO_ONE
Deprecated. since NW05, use ZERO_TO_ONE
Constant for the role cardinality 0..1


CARDINALITY_MANY

public static final CMICardinality CARDINALITY_MANY
Deprecated. since NW05, use MANY
Constant for the role cardinality * (== 0..* == 0..n)


CARDINALITY_ONE

public static final CMICardinality CARDINALITY_ONE
Deprecated. since NW05, use ONE
Constant for the role cardinality 1 (== 1..1)


CARDINALITY_ONE_TO_MANY

public static final CMICardinality CARDINALITY_ONE_TO_MANY
Deprecated. since NW05, use ONE_TO_MANY
Constant for the role cardinality 1..* (== 1..n)

Method Detail

values

public static CMICardinality[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (CMICardinality c : CMICardinality.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static CMICardinality valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null

isMandatory

public boolean isMandatory()
Returns true, if the cardinality is 1 or 1..*


isMultiple

public boolean isMultiple()
Returns true, if the cardinality is * or 1..*


valueOf

public static CMICardinality valueOf(boolean mandatory,
                                     boolean multiple)
Returns the cardinality with the given attributes.

Parameters:
mandatory - true, if at least one element is required
multiple - true, if more than one element is allowed
Returns:
the cardinality with the given attributes
Access Rights

This class can be accessed from:


SC DC
[sap.com] FRAMEWORK [sap.com] tc/cmi
[sap.com] FRAMEWORK [sap.com] tc/cm/ejb/api


Copyright 2010 SAP AG Complete Copyright Notice