Class ContextVariableType<T>
- java.lang.Object
-
- com.microsoft.semantickernel.contextvariables.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 Summary
Constructors Constructor Description ContextVariableType(ContextVariableTypeConverter<T> contextVariableTypeConverter, Class<T> clazz)Create a new context variable type.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Class<T>getClazz()Get the class of the type.ContextVariableTypeConverter<T>getConverter()Get the converter for this type.ContextVariable<T>of(Object it)Create a context variable of this type from the given object, converting it to type T if necessary.
-
-
-
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
-
getConverter
public ContextVariableTypeConverter<T> getConverter()
Get the converter for this type.- Returns:
- The converter for this 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.
-
-