Class NumberVariableContextVariableTypeConverter<T extends Number>
- java.lang.Object
-
- com.microsoft.semantickernel.contextvariables.ContextVariableTypeConverter<T>
-
- com.microsoft.semantickernel.contextvariables.converters.PrimitiveVariableContextVariableTypeConverter<T>
-
- com.microsoft.semantickernel.contextvariables.converters.NumberVariableContextVariableTypeConverter<T>
-
- Type Parameters:
T- the type of the number
public class NumberVariableContextVariableTypeConverter<T extends Number> extends PrimitiveVariableContextVariableTypeConverter<T>
AContextVariableTypeConverterforjava.lang.Numbertype variables. Use, for example,ContextVariableTypes.getGlobalVariableTypeForClass(Integer.class)to get an instance of this class that works with theIntegertype.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.microsoft.semantickernel.contextvariables.ContextVariableTypeConverter
ContextVariableTypeConverter.Builder<T>, ContextVariableTypeConverter.Converter<T,U>, ContextVariableTypeConverter.DefaultConverter<T,U>, ContextVariableTypeConverter.NoopConverter<T>, ContextVariableTypeConverter.ToPromptStringFunction<T>
-
-
Constructor Summary
Constructors Constructor Description NumberVariableContextVariableTypeConverter(Class<T> clazz, Function<String,T> fromPromptString, Function<Number,T> fromNumber)Creates a new instance of theNumberVariableContextVariableTypeConverterclass.
-
Method Summary
-
Methods inherited from class com.microsoft.semantickernel.contextvariables.converters.PrimitiveVariableContextVariableTypeConverter
fromObject, fromPromptString, toObject
-
Methods inherited from class com.microsoft.semantickernel.contextvariables.ContextVariableTypeConverter
builder, escapeXmlString, getType, toPromptString
-
-
-
-
Constructor Detail
-
NumberVariableContextVariableTypeConverter
public NumberVariableContextVariableTypeConverter(Class<T> clazz, Function<String,T> fromPromptString, Function<Number,T> fromNumber)
Creates a new instance of theNumberVariableContextVariableTypeConverterclass.- Parameters:
clazz- the classfromPromptString- the function to convert from a prompt stringfromNumber- the function to convert from a number
-
-