Class VectorStoreRecordDefinition
- java.lang.Object
-
- com.microsoft.semantickernel.data.vectorstorage.definition.VectorStoreRecordDefinition
-
public class VectorStoreRecordDefinition extends Object
Represents a definition of a vector store record.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancontainsField(String fieldName)Checks if the record definition contains a field with the specified name.static VectorStoreRecordDefinitionfromFields(List<VectorStoreRecordField> fields)Create a VectorStoreRecordDefinition from a collection of fields.static VectorStoreRecordDefinitionfromRecordClass(Class<?> recordClass)Create a VectorStoreRecordDefinition from a model.List<VectorStoreRecordField>getAllFields()Gets all fields in the record definition.List<VectorStoreRecordDataField>getDataFields()Gets the data fields in the record definition.VectorStoreRecordFieldgetField(String fieldName)Gets the field with the specified name.VectorStoreRecordKeyFieldgetKeyField()Gets the key field in the record definition.List<VectorStoreRecordField>getNonVectorFields()Gets the non-vector fields in the record definition.List<VectorStoreRecordVectorField>getVectorFields()Gets the vector fields in the record definition.static voidvalidateSupportedTypes(List<VectorStoreRecordField> fields, Set<Class<?>> supportedTypes)Validate that the record class contains only supported field types.
-
-
-
Method Detail
-
getKeyField
public VectorStoreRecordKeyField getKeyField()
Gets the key field in the record definition.- Returns:
- VectorStoreRecordKeyField
-
getDataFields
public List<VectorStoreRecordDataField> getDataFields()
Gets the data fields in the record definition.- Returns:
- List of VectorStoreRecordDataField
-
getVectorFields
public List<VectorStoreRecordVectorField> getVectorFields()
Gets the vector fields in the record definition.- Returns:
- List of VectorStoreRecordVectorField
-
getAllFields
public List<VectorStoreRecordField> getAllFields()
Gets all fields in the record definition.- Returns:
- List of VectorStoreRecordField
-
getNonVectorFields
public List<VectorStoreRecordField> getNonVectorFields()
Gets the non-vector fields in the record definition.- Returns:
- List of VectorStoreRecordField
-
containsField
public boolean containsField(String fieldName)
Checks if the record definition contains a field with the specified name.- Parameters:
fieldName- The name of the field to check.- Returns:
- boolean
-
getField
public VectorStoreRecordField getField(String fieldName)
Gets the field with the specified name.- Parameters:
fieldName- The name of the field to get.- Returns:
- VectorStoreRecordField
-
fromFields
public static VectorStoreRecordDefinition fromFields(List<VectorStoreRecordField> fields)
Create a VectorStoreRecordDefinition from a collection of fields.- Parameters:
fields- The fields to create the definition from.- Returns:
- VectorStoreRecordDefinition
-
fromRecordClass
public static VectorStoreRecordDefinition fromRecordClass(Class<?> recordClass)
Create a VectorStoreRecordDefinition from a model.- Parameters:
recordClass- The model class to create the definition from.- Returns:
- VectorStoreRecordDefinition
-
validateSupportedTypes
public static void validateSupportedTypes(List<VectorStoreRecordField> fields, Set<Class<?>> supportedTypes)
Validate that the record class contains only supported field types.- Parameters:
fields- The declared fields in the record class.supportedTypes- The supported field types.- Throws:
IllegalArgumentException- if unsupported field types are found.
-
-