PrimitiveVariableContextVariableTypeConverter<T> Class
- java.
lang. Object - com.
microsoft. semantickernel. contextvariables. ContextVariableTypeConverter<T> - com.
microsoft. semantickernel. contextvariables. converters. PrimitiveVariableContextVariableTypeConverter<T>
- com.
- com.
Type Parameters
- T
the type of the variable
public class PrimitiveVariableContextVariableTypeConverter<T>
extends ContextVariableTypeConverter<T>
A ContextVariableTypeConverter<T> for primitive variables.
Constructor Summary
| Constructor | Description |
|---|---|
| PrimitiveVariableContextVariableTypeConverter(Class<T> clazz, Function<String,T> fromPromptString, Function<Object,T> fromObject, Function<T,String> toPromptString) |
Creates a new instance of the PrimitiveVariableContextVariableTypeConverter<T> class. |
Method Summary
| Modifier and Type | Method and Description |
|---|---|
| U |
toObject(ContextVariableTypes types, Object t, Class<U> clazz)
Use this converter to convert the object to the type of the context variable. |
| T |
fromObject(Object s)
Convert the object to the type of the context variable using the |
| T |
fromPromptString(String s)
Convert the prompt string to the type using the |
Methods inherited from ContextVariableTypeConverter
Methods inherited from java.lang.Object
Constructor Details
PrimitiveVariableContextVariableTypeConverter
public PrimitiveVariableContextVariableTypeConverter(Class
Creates a new instance of the PrimitiveVariableContextVariableTypeConverter<T> class.
Parameters:
Method Details
toObject
public U toObject(ContextVariableTypes types, Object t, Class clazz)
Use this converter to convert the object to the type of the context variable.
Overrides:
PrimitiveVariableContextVariableTypeConverter<T>.toObject(ContextVariableTypes types, Object t, Class<U> clazz)Parameters:
fromObject
public T fromObject(Object s)
Convert the object to the type of the context variable using the fromObject function provided to the constructor.
Overrides:
PrimitiveVariableContextVariableTypeConverter<T>.fromObject(Object s)Parameters:
fromPromptString
public T fromPromptString(String s)
Convert the prompt string to the type using the fromPromptString function provided to the constructor.
Overrides:
PrimitiveVariableContextVariableTypeConverter<T>.fromPromptString(String s)Parameters: