Class KotlinDataClassComponent

java.lang.Object
tech.ydb.yoj.databind.schema.reflect.KotlinDataClassComponent
All Implemented Interfaces:
ReflectField

public final class KotlinDataClassComponent extends Object implements ReflectField
Represents a Kotlin data class component for the purposes of YOJ data-binding.
  • Constructor Details

    • KotlinDataClassComponent

      public KotlinDataClassComponent(Reflector reflector, String name, kotlin.reflect.KProperty1<?,?> property)
  • Method Details

    • getValue

      @Nullable public Object getValue(Object containingObject)
      Specified by:
      getValue in interface ReflectField
      Parameters:
      containingObject - object which contains this field
      Returns:
      value of this field for containingObject; might be null.
      This method will throw when invoked on a containingObject that is not instanceof getType().
    • getName

      public String getName()
      Specified by:
      getName in interface ReflectField
      Returns:
      field name as it appears in code (or the closest thing to it). Can only contain valid Java identifier characters, e.g. cannot have a "."
    • getGenericType

      public Type getGenericType()
      Specified by:
      getGenericType in interface ReflectField
      Returns:
      full generic field type
      See Also:
    • getType

      public Class<?> getType()
      Specified by:
      getType in interface ReflectField
      Returns:
      raw field type
      See Also:
    • getValueType

      public FieldValueType getValueType()
      Description copied from interface: ReflectField
      Returns this field's value type for the purposes of data-binding. The type returned is very vague, e.g., all POJOs and Java records will have type of COMPOSITE meaning they will be mapped into multiple columns by default; all fixed-size integral values will have type of INTEGER; and so on.

      @Column annotation can influence whether a multi-field type such as a POJO is mapped to one column or multiple columns, see its JavaDoc for more information.

      Specified by:
      getValueType in interface ReflectField
      Returns:
      field's value type for the purposes of data-binding
    • getColumn

      public Column getColumn()
      Specified by:
      getColumn in interface ReflectField
      Returns:
      @Column annotation, if this field is annotated; null otherwise. Precisely what means "field is annotated" is implementation-dependent: it might mean that the property getter method is annotated, for example.
    • getReflectType

      public ReflectType<?> getReflectType()
      Specified by:
      getReflectType in interface ReflectField
      Returns:
      basic reflection information for raw field type
    • toString

      public String toString()
      Overrides:
      toString in class Object