public static final class ContractProvider.Builder extends Object
Modifier and Type | Method and Description |
---|---|
ContractProvider.Builder |
addContract(Class<?> contract)
Add a new provided contract.
|
ContractProvider.Builder |
addContract(Class<?> contract,
int priority)
Add a new provided contract with priority.
|
ContractProvider.Builder |
addContracts(Collection<Class<?>> contracts)
Add a new provided contracts.
|
ContractProvider.Builder |
addContracts(Map<Class<?>,Integer> contracts)
Add a new provided contracts.
|
ContractProvider.Builder |
addNameBinding(Class<? extends Annotation> binding)
Add a new contract provider name binding.
|
ContractProvider |
build()
Build a new contract provider model.
|
ContractProvider.Builder |
defaultPriority(int defaultPriority)
Set the contract default provider priority.
|
Map<Class<?>,Integer> |
getContracts()
Get the map of contracts for the built contract provider model.
|
int |
getDefaultPriority()
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.Builder |
scope(Class<? extends Annotation> scope)
Change contract provider scope.
|
public ContractProvider.Builder scope(Class<? extends Annotation> scope)
Singleton
.)scope
- contract provider scope.public ContractProvider.Builder addContract(Class<?> contract)
contract
- additional provided contract.public ContractProvider.Builder addContract(Class<?> contract, int priority)
contract
- additional provided contract.priority
- priority for the contract.public ContractProvider.Builder addContracts(Map<Class<?>,Integer> contracts)
contracts
- additional provided contracts.public ContractProvider.Builder addContracts(Collection<Class<?>> contracts)
contracts
- additional provided contracts.public ContractProvider.Builder defaultPriority(int defaultPriority)
ContractProvider.NO_PRIORITY
)defaultPriority
- default contract provider priority.public ContractProvider.Builder addNameBinding(Class<? extends Annotation> binding)
binding
- name binding.public Class<? extends Annotation> getScope()
null
if no scope
has been set explicitly.public Map<Class<?>,Integer> getContracts()
public int getDefaultPriority()
public Set<Class<? extends Annotation>> getNameBindings()
public ContractProvider build()
Copyright © 2007-2015, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.