Record Class TypeModel.Scalar

java.lang.Object
java.lang.Record
com.vaadin.hilla.generator.model.TypeModel.Scalar
Record Components:
javaType - the fully qualified name of the Java type the value comes from, which TypeScript has no way of telling apart: a date and an instant are both written as a string
All Implemented Interfaces:
TypeModel
Enclosing interface:
TypeModel

public static record TypeModel.Scalar(TypeModel.ScalarKind kind, boolean optional, String javaType, List<ConstraintModel> constraints, List<AnnotationModel> annotations) extends Record implements TypeModel
  • Constructor Details

    • Scalar

      public Scalar(TypeModel.ScalarKind kind, boolean optional, String javaType, List<ConstraintModel> constraints, List<AnnotationModel> annotations)
      Creates an instance of a Scalar record class.
      Parameters:
      kind - the value for the kind record component
      optional - the value for the optional record component
      javaType - the value for the javaType record component
      constraints - the value for the constraints record component
      annotations - the value for the annotations record component
    • Scalar

      public Scalar(TypeModel.ScalarKind kind, boolean optional, String javaType)
  • Method Details

    • of

      public static TypeModel.Scalar of(TypeModel.ScalarKind kind, String javaType)
    • withOptional

      public TypeModel.Scalar withOptional(boolean optional)
      Description copied from interface: TypeModel
      The same type, said to be absent or not as given.
      Specified by:
      withOptional in interface TypeModel
    • 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.
    • kind

      public TypeModel.ScalarKind kind()
      Returns the value of the kind record component.
      Returns:
      the value of the kind record component
    • optional

      public boolean optional()
      Returns the value of the optional record component.
      Specified by:
      optional in interface TypeModel
      Returns:
      the value of the optional record component
    • javaType

      public String javaType()
      Returns the value of the javaType record component.
      Returns:
      the value of the javaType record component
    • constraints

      public List<ConstraintModel> constraints()
      Returns the value of the constraints record component.
      Specified by:
      constraints in interface TypeModel
      Returns:
      the value of the constraints record component
    • annotations

      public List<AnnotationModel> annotations()
      Returns the value of the annotations record component.
      Specified by:
      annotations in interface TypeModel
      Returns:
      the value of the annotations record component