Record Class OavDescriptor

java.lang.Object
java.lang.Record
com.smeup.kokos.sdk.entity.model.descriptors.OavDescriptor
Record Components:
id - the OAV identifier (e.g. "I/01")
type - the Smeup object type (e.g. "J1")
parameter - the Smeup object parameter (e.g. "STR")
description - the human-readable description (e.g. "Full name")
isId - whether this OAV represents the entity identifier
isDescription - whether this OAV is also annotated with Description

public record OavDescriptor(String id, String type, String parameter, String description, boolean isId, boolean isDescription) extends Record
Describes a single OAV (Object Attribute Value) from the SmeupOav annotation metadata of an entity class.

This is a pure metadata descriptor — it carries no instance data, only the structural definition of the OAV as declared on the entity field.

  • Constructor Details

    • OavDescriptor

      public OavDescriptor(String id, String type, String parameter, String description, boolean isId, boolean isDescription)
      Creates an instance of a OavDescriptor record class.
      Parameters:
      id - the value for the id record component
      type - the value for the type record component
      parameter - the value for the parameter record component
      description - the value for the description record component
      isId - the value for the isId record component
      isDescription - the value for the isDescription record component
  • Method Details

    • get

      public String get(String attr)
      Returns the value of the given attribute by name. Supports SmeupOav.ATTRS plus the derived flag isDescription.
    • fromAnnotation

      public static OavDescriptor fromAnnotation(SmeupOav ann)
    • isTooltipEnabled

      public boolean isTooltipEnabled()
      Determines whether a tooltip is necessary for this entity, based on the types of its OAVs.
      Returns:
      true if at least one OAV has a non-primitive type that would benefit from a tooltip; false if all OAVs are of primitive types
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • id

      public String id()
      Returns the value of the id record component.
      Returns:
      the value of the id record component
    • type

      public String type()
      Returns the value of the type record component.
      Returns:
      the value of the type record component
    • parameter

      public String parameter()
      Returns the value of the parameter record component.
      Returns:
      the value of the parameter record component
    • description

      public String description()
      Returns the value of the description record component.
      Returns:
      the value of the description record component
    • isId

      public boolean isId()
      Returns the value of the isId record component.
      Returns:
      the value of the isId record component
    • isDescription

      public boolean isDescription()
      Returns the value of the isDescription record component.
      Returns:
      the value of the isDescription record component