public class FactoryDescriptorsImpl extends java.lang.Object implements FactoryDescriptors
Factory
Modifier and Type | Field and Description |
---|---|
private Descriptor |
asProvideMethod |
private Descriptor |
asService |
Constructor and Description |
---|
FactoryDescriptorsImpl(Descriptor asService,
Descriptor asProvideMethod)
This creates a descriptor pair describing a
Factory
and the associated Factory.provide() method |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object o) |
Descriptor |
getFactoryAsAFactory()
This returns the factory as a factory for some other type.
|
Descriptor |
getFactoryAsAService()
This returns the factory as a service itself.
|
int |
hashCode() |
java.lang.String |
toString() |
private final Descriptor asService
private final Descriptor asProvideMethod
public FactoryDescriptorsImpl(Descriptor asService, Descriptor asProvideMethod)
Factory
and the associated Factory.provide()
methodasService
- A description of the factory itself as an hk2 service.
May not be null. Must have DescriptorType of DescriptorType.CLASS
. One
of the contracts must be FactoryasProvideMethod
- A description of the provide method of the factory. Must have
DescriptorType of DescriptorType.PROVIDE_METHOD
.
May not be nulljava.lang.IllegalArgumentException
- if the descriptors are not of the proper typepublic Descriptor getFactoryAsAService()
FactoryDescriptors
Factory
. The descriptor type must be DescriptorType.CLASS
since this descriptor is describing the factory itself.getFactoryAsAService
in interface FactoryDescriptors
public Descriptor getFactoryAsAFactory()
FactoryDescriptors
DescriptorType.PROVIDE_METHOD
since this descriptor is
describing the factory as a factory, not as a service.getFactoryAsAFactory
in interface FactoryDescriptors
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object