Class ContractProvider

  • All Implemented Interfaces:
    NameBound, Scoped

    public final class ContractProvider
    extends Object
    implements Scoped, NameBound
    Jersey contract provider model.
    Author:
    Marek Potociar
    • Field Detail

      • NO_PRIORITY

        public static final int NO_PRIORITY
        "No priority" constant.
        See Also:
        Constant Field Values
    • Method Detail

      • builder

        public static ContractProvider.Builder builder​(Class<?> implementationClass)
        Create new contract provider model builder.
        Parameters:
        implementationClass - class which the contracts belong to.
        Returns:
        new contract provider builder.
      • builder

        public static ContractProvider.Builder builder​(ContractProvider original)
        Create new contract provider model builder from an existing one.
        Parameters:
        original - existing contract provider model.
        Returns:
        new contract provider builder.
      • getScope

        public Class<? extends Annotation> getScope()
        Description copied from interface: Scoped
        Get model component scope.
        Specified by:
        getScope in interface Scoped
        Returns:
        model component scope.
      • getImplementationClass

        public Class<?> getImplementationClass()
        Get the implementation class which the contracts belong to.
        Returns:
        implementation class.
      • getContracts

        public Set<Class<?>> getContracts()
        Get provided contracts recognized by Jersey.
        Returns:
        provided contracts.
        See Also:
        Contract
      • getContractMap

        public Map<Class<?>,​Integer> getContractMap()
        Get the map of contracts and their priorities.
        Returns:
        contracts and their priorities.
      • isNameBound

        public boolean isNameBound()
        Description copied from interface: NameBound
        Check if the component is bound or not.
        Specified by:
        isNameBound in interface NameBound
        Returns:
        true if the component is bound, false otherwise.
      • getPriority

        public int getPriority​(Class<?> contract)
        Get the provider contract priority, if set, default component provider, if not set.
        Parameters:
        contract - provider contract.
        Returns:
        provider priority.
        See Also:
        Priority
      • getNameBindings

        public Set<Class<? extends Annotation>> getNameBindings()
        Description copied from interface: NameBound
        Get the collection of name bindings attached to this component.
        Specified by:
        getNameBindings in interface NameBound
        Returns:
        collection of name binding annotation types.