Package org.glassfish.jersey.model
Class ContractProvider.Builder
- java.lang.Object
-
- org.glassfish.jersey.model.ContractProvider.Builder
-
- Enclosing class:
- ContractProvider
public static final class ContractProvider.Builder extends Object
Contract provider model builder.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ContractProvider.BuilderaddContract(Class<?> contract)Add a new provided contract.ContractProvider.BuilderaddContract(Class<?> contract, int priority)Add a new provided contract with priority.ContractProvider.BuilderaddContracts(Collection<Class<?>> contracts)Add a new provided contracts.ContractProvider.BuilderaddContracts(Map<Class<?>,Integer> contracts)Add a new provided contracts.ContractProvider.BuilderaddNameBinding(Class<? extends Annotation> binding)Add a new contract provider name binding.ContractProviderbuild()Build a new contract provider model.ContractProvider.BuilderdefaultPriority(int defaultPriority)Set the contract default provider priority.Map<Class<?>,Integer>getContracts()Get the map of contracts for the built contract provider model.intgetDefaultPriority()Get the default priority of the built contract provider model.Set<Class<? extends Annotation>>getNameBindings()Get name bindings of the built contract provider model.Class<? extends Annotation>getScope()Get the scope of the built contract provider model.ContractProvider.Builderscope(Class<? extends Annotation> scope)Change contract provider scope.
-
-
-
Method Detail
-
scope
public ContractProvider.Builder scope(Class<? extends Annotation> scope)
Change contract provider scope. (Default scope isSingleton.)- Parameters:
scope- contract provider scope.- Returns:
- updated builder.
-
addContract
public ContractProvider.Builder addContract(Class<?> contract)
Add a new provided contract.- Parameters:
contract- additional provided contract.- Returns:
- updated builder.
-
addContract
public ContractProvider.Builder addContract(Class<?> contract, int priority)
Add a new provided contract with priority.- Parameters:
contract- additional provided contract.priority- priority for the contract.- Returns:
- updated builder.
-
addContracts
public ContractProvider.Builder addContracts(Map<Class<?>,Integer> contracts)
Add a new provided contracts.- Parameters:
contracts- additional provided contracts.- Returns:
- updated builder.
-
addContracts
public ContractProvider.Builder addContracts(Collection<Class<?>> contracts)
Add a new provided contracts.- Parameters:
contracts- additional provided contracts.- Returns:
- updated builder.
-
defaultPriority
public ContractProvider.Builder defaultPriority(int defaultPriority)
Set the contract default provider priority. (Default value isContractProvider.NO_PRIORITY)- Parameters:
defaultPriority- default contract provider priority.- Returns:
- updated builder.
-
addNameBinding
public ContractProvider.Builder addNameBinding(Class<? extends Annotation> binding)
Add a new contract provider name binding.- Parameters:
binding- name binding.- Returns:
- updated builder.
-
getScope
public Class<? extends Annotation> getScope()
Get the scope of the built contract provider model.- Returns:
- scope associated with the model or
nullif no scope has been set explicitly.
-
getContracts
public Map<Class<?>,Integer> getContracts()
Get the map of contracts for the built contract provider model.- Returns:
- contracts associated with the model.
-
getDefaultPriority
public int getDefaultPriority()
Get the default priority of the built contract provider model.- Returns:
- default priority associated with the model.
-
getNameBindings
public Set<Class<? extends Annotation>> getNameBindings()
Get name bindings of the built contract provider model.- Returns:
- name bindings associated with the model.
-
build
public ContractProvider build()
Build a new contract provider model.- Returns:
- new contract provider model.
-
-