Package org.glassfish.jersey.model
Class ContractProvider.Builder
java.lang.Object
org.glassfish.jersey.model.ContractProvider.Builder
- Enclosing class:
- ContractProvider
Contract provider model builder.
-
Method Summary
Modifier and TypeMethodDescriptionaddContract(Class<?> contract) Add a new provided contract.addContract(Class<?> contract, int priority) Add a new provided contract with priority.addContracts(Collection<Class<?>> contracts) Add a new provided contracts.addContracts(Map<Class<?>, Integer> contracts) Add a new provided contracts.addNameBinding(Class<? extends Annotation> binding) Add a new contract provider name binding.build()Build a new contract provider model.defaultPriority(int defaultPriority) Set the contract default provider priority.Get the map of contracts for the built contract provider model.intGet the default priority of the built contract provider model.Set<Class<? extends Annotation>>Get name bindings of the built contract provider model.Class<? extends Annotation>getScope()Get the scope of the built contract provider model.scope(Class<? extends Annotation> scope) Change contract provider scope.
-
Method Details
-
scope
Change contract provider scope. (Default scope isSingleton.)- Parameters:
scope- contract provider scope.- Returns:
- updated builder.
-
addContract
Add a new provided contract.- Parameters:
contract- additional provided contract.- Returns:
- updated builder.
-
addContract
Add a new provided contract with priority.- Parameters:
contract- additional provided contract.priority- priority for the contract.- Returns:
- updated builder.
-
addContracts
Add a new provided contracts.- Parameters:
contracts- additional provided contracts.- Returns:
- updated builder.
-
addContracts
Add a new provided contracts.- Parameters:
contracts- additional provided contracts.- Returns:
- updated builder.
-
defaultPriority
Set the contract default provider priority. (Default value isContractProvider.NO_PRIORITY)- Parameters:
defaultPriority- default contract provider priority.- Returns:
- updated builder.
-
addNameBinding
Add a new contract provider name binding.- Parameters:
binding- name binding.- Returns:
- updated builder.
-
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
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
Get name bindings of the built contract provider model.- Returns:
- name bindings associated with the model.
-
build
Build a new contract provider model.- Returns:
- new contract provider model.
-