Enum Class ReferenceCardinality

java.lang.Object
java.lang.Enum<ReferenceCardinality>
org.osgi.service.component.annotations.ReferenceCardinality
All Implemented Interfaces:
Serializable, Comparable<ReferenceCardinality>, Constable

public enum ReferenceCardinality extends Enum<ReferenceCardinality>
Cardinality for the Reference annotation.

Specifies if the reference is optional and if the component implementation support a single bound service or multiple bound services.

  • Enum Constant Details

    • OPTIONAL

      public static final ReferenceCardinality OPTIONAL
      The reference is optional and unary. That is, the reference has a cardinality of 0..1.
    • MANDATORY

      public static final ReferenceCardinality MANDATORY
      The reference is mandatory and unary. That is, the reference has a cardinality of 1..1.
    • MULTIPLE

      public static final ReferenceCardinality MULTIPLE
      The reference is optional and multiple. That is, the reference has a cardinality of 0..n.
    • AT_LEAST_ONE

      public static final ReferenceCardinality AT_LEAST_ONE
      The reference is mandatory and multiple. That is, the reference has a cardinality of 1..n.
  • Method Details

    • values

      public static ReferenceCardinality[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static ReferenceCardinality valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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 class has no constant with the specified name
      NullPointerException - if the argument is null
    • toString

      public String toString()
      Overrides:
      toString in class Enum<ReferenceCardinality>