Package tech.ydb.yoj.databind.schema
Class Schema<T>
java.lang.Object
tech.ydb.yoj.databind.schema.Schema<T>
- Direct Known Subclasses:
ObjectSchema
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic @interfaceAnnotation for schemas with dynamic names (theNamingStrategycan return different names for different invocations.)static classstatic final classstatic classstatic class -
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedprotectedSchema(@NonNull Class<T> type, @NonNull NamingStrategy namingStrategy) protectedSchema(@NonNull Class<T> type, @NonNull NamingStrategy namingStrategy, @NonNull Reflector reflector) protectedprotectedSchema(@NonNull SchemaRegistry.SchemaKey<T> key, @NonNull Reflector reflector) protected -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanfinal Optional<Schema.JavaField>final List<Schema.JavaField>flattenOneField(String fieldPath, Object fieldValue) final List<Schema.JavaFieldValue>flattenToList(T t) final Schema.JavaFieldfinal StringgetName()Returns the name of the table for data binding.final NamingStrategygetType()final inthashCode()final booleanprotected booleanisFlattenable(ReflectField field) final TnewInstance(Map<String, Object> cells) Creates a new object having the specified field values.final StringtoString()
-
Field Details
-
PATH_DELIMITER
- See Also:
-
reflectType
-
-
Constructor Details
-
Schema
-
Schema
-
Schema
-
Schema
protected Schema(@NonNull @NonNull Class<T> type, @NonNull @NonNull NamingStrategy namingStrategy, @NonNull @NonNull Reflector reflector) -
Schema
protected Schema(@NonNull @NonNull SchemaRegistry.SchemaKey<T> key, @NonNull @NonNull Reflector reflector) -
Schema
-
-
Method Details
-
isFlattenable
- Parameters:
field-compositefield- Returns:
trueif the composite field can be flattened to a single field;false otherwise
-
getType
-
getNamingStrategy
-
getName
Returns the name of the table for data binding.If the
Tableannotation is present, the fieldnameshould be used to specify the table name.- Returns:
- the table name for data binding
-
isDynamic
public final boolean isDynamic() -
flattenFields
-
flattenFieldNames
-
flatten
-
flattenOneField
-
flattenToList
-
newInstance
Creates a new object having the specified field values.- Parameters:
cells- field value map:field name-> field value- Returns:
- object with the specified field values
- Throws:
ConstructionException- could not construct object fromcells
-
getField
- Parameters:
path- dot-separated field path, e.g.vm.statusfor thestatusfield inside thevmfield of the top-level entity- Returns:
- entity field
- Throws:
IllegalArgumentException- no such field exists
-
findField
- Parameters:
path- dot-separated field path, e.g.vm.statusfor thestatusfield inside thevmfield of the top-level entity- Returns:
Optionalrepresenting the field found, if it exists; anempty Optionalotherwise
-
hashCode
public final int hashCode() -
equals
-
toString
-