Enum Class SPI.Role

java.lang.Object
java.lang.Enum<SPI.Role>
org.hibernate.SPI.Role
All Implemented Interfaces:
Serializable, Comparable<SPI.Role>, Constable
Enclosing class:
SPI

public static enum SPI.Role extends Enum<SPI.Role>

Describes how external provider code participates in an SPI contract.

Compatibility is determined by the complete role set. For example, adding a method might be additive for code which only uses a type, while breaking code which implements that same type.

Since:
8.0
  • Nested Class Summary

    Nested classes/interfaces inherited from class Enum

    Enum.EnumDesc<E>
  • Enum Constant Summary

    Enum Constants
    Enum Constant
    Description
    Allows external provider code to implement an interface, subclass a class, or override a method represented by the contract.
    Allows external provider code to make an implementation, instance, or value represented by the contract available to Hibernate through a documented supply point.
    Allows external provider code to consume the contract while implementing an integration.
  • Method Summary

    Modifier and Type
    Method
    Description
    static SPI.Role
    Returns the enum constant of this class with the specified name.
    static SPI.Role[]
    Returns an array containing the constants of this enum class, in the order they are declared.

    Methods inherited from class Object

    getClass, notify, notifyAll, wait, wait, wait
  • Enum Constant Details

    • USE

      public static final SPI.Role USE

      Allows external provider code to consume the contract while implementing an integration. Provider code may name the contract in source and binary signatures and, where the corresponding member is exposed, reference, invoke, or instantiate it.

      USE does not authorize provider code to implement an interface, subclass a class, override a method, or supply a value to Hibernate. Those directions require IMPLEMENT or SUPPLY.

      Within one supported X.Y release family, existing usable types and members are expected to retain source- and binary-compatible signatures. New members may be added when they remain compatible for every applicable role. Removal, renaming, incompatible signature change, or reduced accessibility of an existing usable member is incompatible.

    • IMPLEMENT

      public static final SPI.Role IMPLEMENT

      Allows external provider code to implement an interface, subclass a class, or override a method represented by the contract.

      For an implementable class, the supported subclass surface includes its exposed public and protected overridable instance methods. Supported constructors are classified independently; IMPLEMENT on a class does not make every constructor a provider contract.

      Within one supported X.Y release family, existing provider implementations and subclasses are expected to remain source and binary compatible. Adding an abstract method or otherwise imposing a new implementation obligation is incompatible. Adding a default or concrete method requires source-, binary-, and method-collision analysis. Removing or finalizing an overridable member, reducing its accessibility, or changing its signature incompatibly is also incompatible.

    • SUPPLY

      public static final SPI.Role SUPPLY

      Allows external provider code to make an implementation, instance, or value represented by the contract available to Hibernate through a documented supply point.

      SUPPLY describes direction, not discovery, construction, or implementation permission. A provider needs IMPLEMENT to implement or subclass a supplied contract and USE to consume APIs involved in producing the supplied value.

      Within one supported X.Y release family, an existing supply point and the accepted value contract are expected to remain source and binary compatible. New optional supply points may be added. Requiring an existing provider to supply a new value, removing a supply point, or changing its accepted contract incompatibly is not compatible.

  • Method Details

    • values

      public static SPI.Role[] 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 SPI.Role 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