Class OptionalActiveDescriptor<T>

java.lang.Object
org.glassfish.hk2.utilities.DescriptorImpl
org.glassfish.hk2.utilities.AbstractActiveDescriptor<Optional<T>>
org.jvnet.hk2.internal.OptionalActiveDescriptor<T>
All Implemented Interfaces:
Externalizable, Serializable, org.glassfish.hk2.api.ActiveDescriptor<Optional<T>>, org.glassfish.hk2.api.Descriptor, org.glassfish.hk2.api.SingleCache<Optional<T>>

public class OptionalActiveDescriptor<T> extends org.glassfish.hk2.utilities.AbstractActiveDescriptor<Optional<T>>
Descriptor for Optional to allow for injection of a service if it exists or else Optional.EMPTY. It will also allow for injection of an Optional directly as well.
Author:
jonathan coustick
See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
    For serialization
  • Method Summary

    Modifier and Type
    Method
    Description
    create(org.glassfish.hk2.api.ServiceHandle<?> root)
     
     
     

    Methods inherited from class org.glassfish.hk2.utilities.AbstractActiveDescriptor

    addContractType, addQualifierAnnotation, dispose, equals, getCache, getContractTypes, getFactoryLocatorId, getFactoryServiceId, getInjectees, getQualifierAnnotations, getScopeAnnotation, getScopeAsAnnotation, hashCode, isCacheSet, isReified, releaseCache, removeContractType, removeQualifierAnnotation, setCache, setFactoryId, setImplementationType, setName, setReified, setScopeAnnotation, setScopeAsAnnotation

    Methods inherited from class org.glassfish.hk2.utilities.DescriptorImpl

    addAdvertisedContract, addMetadata, addMetadata, addQualifier, clearMetadata, descriptorEquals, getAdvertisedContracts, getClassAnalysisName, getDescriptorType, getDescriptorVisibility, getImplementation, getLoader, getLocatorId, getMetadata, getName, getQualifiers, getRanking, getScope, getServiceId, isProxiable, isProxyForSameScope, pretty, readExternal, readObject, removeAdvertisedContract, removeAllMetadata, removeMetadata, removeQualifier, setClassAnalysisName, setDescriptorType, setDescriptorVisibility, setImplementation, setLoader, setLocatorId, setMetadata, setProxiable, setProxyForSameScope, setRanking, setScope, setServiceId, toString, writeExternal, writeObject

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait

    Methods inherited from interface org.glassfish.hk2.api.Descriptor

    getAdvertisedContracts, getClassAnalysisName, getDescriptorType, getDescriptorVisibility, getImplementation, getLoader, getLocatorId, getMetadata, getName, getQualifiers, getRanking, getScope, getServiceId, isProxiable, isProxyForSameScope, setRanking
  • Constructor Details

    • OptionalActiveDescriptor

      public OptionalActiveDescriptor()
      For serialization
  • Method Details

    • getImplementationClass

      public Class<?> getImplementationClass()
    • getImplementationType

      public Type getImplementationType()
    • create

      public Optional<T> create(org.glassfish.hk2.api.ServiceHandle<?> root)