Class TypeHolder<T>

java.lang.Object
overit.geocall.cdi.holders.TypeHolder<T>
Type Parameters:
T - the type of the held value
All Implemented Interfaces:
Serializable, Holder<T>
Direct Known Subclasses:
ToolHolder

@Component @Scope(scopeName="prototype", proxyMode=NO) @Primary public class TypeHolder<T> extends Object implements Holder<T>

Holder implementation that retrieves the held value from the BeanService.

When injected, the type of the value depends on the type of the generics parameter specified in the injection point

See Also:
  • Constructor Details

    • TypeHolder

      public TypeHolder(@NotNull @NotNull Class<T> type, @NotNull @NotNull BeanService service)
      Create a new instance of holder that will hold a value of a given type
      Parameters:
      type - the type of the held value
      service - the service from which extract the value
  • Method Details

    • get

      public T get()
      Description copied from interface: Holder
      Lazily extract the held value; the following invocation of this method will return the value that has been fetched on the first time that has been called.
      Specified by:
      get in interface Holder<T>
      Returns:
      the value or null if there's no