Class ContextVariableType<T>

  • Type Parameters:
    T - The type of the context variable.

    public class ContextVariableType<T>
    extends Object
    A type of context variable, with a converter to convert objects to the type.
    • Constructor Detail

      • ContextVariableType

        public ContextVariableType​(ContextVariableTypeConverter<T> contextVariableTypeConverter,
                                   Class<T> clazz)
        Create a new context variable type.
        Parameters:
        contextVariableTypeConverter - The converter to convert objects to the type.
        clazz - The class of the type
    • Method Detail

      • getClazz

        public Class<T> getClazz()
        Get the class of the type.
        Returns:
        The class of the type.
      • of

        public ContextVariable<T> of​(@Nullable
                                     Object it)
        Create a context variable of this type from the given object, converting it to type T if necessary.
        Parameters:
        it - The object to convert.
        Returns:
        A context variable of this type.