- All Superinterfaces:
Prototype.Api
- All Known Implementing Classes:
Dependency.BuilderBase.DependencyImpl
Dependency metadata.
The basic dependency supports other services to be passed to a constructor parameter.
The dependency may be a contract,
List
of contracts, or an Optional
of contract, or Supplier
of any of these.- See Also:
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic class
Fluent API builder forDependency
.static class
Dependency.BuilderBase<BUILDER extends Dependency.BuilderBase<BUILDER,
PROTOTYPE>, PROTOTYPE extends Dependency> Fluent API builder base forDependency
. -
Method Summary
Modifier and TypeMethodDescriptionstatic Dependency.Builder
builder()
Create a new fluent API builder to customize configuration.static Dependency.Builder
builder
(Dependency instance) Create a new fluent API builder from an existing instance.contract()
Each dependency ia a specific contract.GenericType
<?> Generic type equivalent toDependencyBlueprint.contract()
.static Dependency
create()
Create a new instance with default values.Descriptor declaring this dependency.Field name that declares this dependency in theDependencyBlueprint.descriptor()
.name()
Name of the constructor parameter.service()
Type name of the service that uses this dependency.typeName()
Type of the dependency (exact parameter type with all generics).
-
Method Details
-
builder
Create a new fluent API builder to customize configuration.- Returns:
- a new builder
-
builder
Create a new fluent API builder from an existing instance.- Parameters:
instance
- an existing instance used as a base for the builder- Returns:
- a builder based on an instance
-
create
Create a new instance with default values.- Returns:
- a new instance
-
service
TypeName service()Type name of the service that uses this dependency.- Returns:
- the service declaring this dependency
-
name
String name()Name of the constructor parameter.- Returns:
- unique name of the parameter
-
contract
TypeName contract()Each dependency ia a specific contract. Each service provides one or more contracts for dependencies. For example forList<MyService>
, the contract isMyService
.- Returns:
- contract of the service we depend on
-
contractType
GenericType<?> contractType()Generic type equivalent toDependencyBlueprint.contract()
. We need both, to prevent reflection at runtime.- Returns:
- generic type of the dependency
-
descriptor
TypeName descriptor()Descriptor declaring this dependency. Descriptor is always public.- Returns:
- descriptor
-
descriptorConstant
String descriptorConstant()Field name that declares this dependency in theDependencyBlueprint.descriptor()
. Can be used for code generation. This field is always a public constant.- Returns:
- field that has the dependency on the descriptor type
-
typeName
TypeName typeName()Type of the dependency (exact parameter type with all generics).- Returns:
- type of the dependency as
TypeName
-