SchemaDocumentValueExt extension Extensions

Extension on the SchemaDocumentValue class which provides a useful suite of methods to manage user generated data.

on

Methods

getList<T>() List<T>?
Checks if the SchemaDocumentValue is of the provided T type. If the value cannot be cast to the provided type, or the provided T doesnt match Kind, then false is returned.
getValue<T>() → T?
Returns the underlying value of the SchemaDocumentValue as the provided T type. If the value cannot be cast to the provided type, or the provided T doesnt match Kind, then null is returned.
isMatchingType<T>(T value) bool
Checks if the provided T type matches the Kind of the SchemaDocumentValue. If the provided T doesnt match Kind, then false is returned.
setList<T>(List<T> v) List<T>?
Sets list of values of the SchemaDocumentValue to the provided value. If the provided T doesnt match Kind, then false is returned.
setValue<T>(T v) → T?
Sets the value of the SchemaDocumentValue to the provided value. If the provided T doesnt match Kind, then false is returned.