Share via


ContextVariableType<T> Class

  • java.lang.Object
    • com.microsoft.semantickernel.contextvariables.ContextVariableType<T>

Type Parameters

T

The type of the context variable.

public class ContextVariableType<T>

A type of context variable, with a converter to convert objects to the type.

Constructor Summary

Constructor Description
ContextVariableType(ContextVariableTypeConverter<T> contextVariableTypeConverter, Class<T> clazz)

Create a new context variable type.

Method Summary

Modifier and Type Method and Description
java.lang.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.

Methods inherited from java.lang.Object

java.lang.Object.clone java.lang.Object.equals java.lang.Object.finalize java.lang.Object.getClass java.lang.Object.hashCode java.lang.Object.notify java.lang.Object.notifyAll java.lang.Object.toString java.lang.Object.wait java.lang.Object.wait java.lang.Object.wait

Constructor Details

ContextVariableType

public ContextVariableType(ContextVariableTypeConverter contextVariableTypeConverter, Class clazz)

Create a new context variable type.

Parameters:

contextVariableTypeConverter - The converter to convert objects to the type.
clazz - The class of the type

Method Details

getClazz

public Class getClazz()

Get the class of the type.

Returns:

The class of the type.

getConverter

public ContextVariableTypeConverter getConverter()

Get the converter for this type.

Returns:

The converter for this type.

of

public ContextVariable of(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.

Applies to