org.springframework.osgi.service.importer.support
Class Cardinality

java.lang.Object
  extended by org.springframework.core.enums.AbstractLabeledEnum
      extended by org.springframework.core.enums.StaticLabeledEnum
          extended by org.springframework.osgi.service.importer.support.Cardinality
All Implemented Interfaces:
Serializable, Comparable, LabeledEnum

public class Cardinality
extends StaticLabeledEnum

Enum-like class containing the OSGi importer services cardinality. Indicates the number of expected matching services and whether the presence is mandatory or not.

Author:
Costin Leau
See Also:
Serialized Form

Field Summary
static Cardinality C_0__1
          Optional, single cardinality.
static Cardinality C_0__N
          Optional, multiple cardinality.
static Cardinality C_1__1
          Mandatory, single cardinality.
static Cardinality C_1__N
          Mandatory, multiple cardinality.
 
Fields inherited from interface org.springframework.core.enums.LabeledEnum
CODE_ORDER, DEFAULT_ORDER, LABEL_ORDER
 
Method Summary
 boolean isMandatory()
          Indicates if this cardinality implies that at least one service is expected (mandatory cardinality).
 boolean isMultiple()
          Indicates if this cardinality implies that multiple services are expected.
 boolean isOptional()
          Indicates if this cardinality implies that is acceptable for no matching services to be found.
 boolean isSingle()
          Indicates if this cardinality implies that at most one service is expected.
 
Methods inherited from class org.springframework.core.enums.StaticLabeledEnum
getCode, getLabel, readResolve, shortValue
 
Methods inherited from class org.springframework.core.enums.AbstractLabeledEnum
compareTo, equals, getType, hashCode, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

C_0__1

public static final Cardinality C_0__1
Optional, single cardinality. At most one OSGi service is expected. This cardinality indicates an OSGi service reference proxy.


C_0__N

public static final Cardinality C_0__N
Optional, multiple cardinality. Zero, one or multiple OSGi services are expected. This cardinality indicates an OSGi service managed collection.


C_1__1

public static final Cardinality C_1__1
Mandatory, single cardinality. Exactly one OSGi service is expected. This cardinality indicates an OSGi service reference proxy.


C_1__N

public static final Cardinality C_1__N
Mandatory, multiple cardinality. At least one OSGi service is expected. This cardinality indicates an OSGi service managed collection.

Method Detail

isSingle

public boolean isSingle()
Indicates if this cardinality implies that at most one service is expected.

Returns:
true if the given cardinality is single, false otherwise

isMultiple

public boolean isMultiple()
Indicates if this cardinality implies that multiple services are expected.

Returns:
true if this cardinality is multiple, false otherwise

isMandatory

public boolean isMandatory()
Indicates if this cardinality implies that at least one service is expected (mandatory cardinality).

Returns:
true if this cardinality is mandatory, false otherwise

isOptional

public boolean isOptional()
Indicates if this cardinality implies that is acceptable for no matching services to be found.

Returns:
true if this cardinality is optional, false otherwise


Copyright © 2006-2009 Spring Framework. All Rights Reserved.