Record Class TypeModel.TypeVariable

java.lang.Object
java.lang.Record
com.vaadin.hilla.generator.model.TypeModel.TypeVariable
All Implemented Interfaces:
TypeModel
Enclosing interface:
TypeModel

public static record TypeModel.TypeVariable(String name, boolean optional, List<ConstraintModel> constraints, List<AnnotationModel> annotations) extends Record implements TypeModel
A reference to a type parameter of the declaration being written, which is written as it is.
  • Constructor Details

    • TypeVariable

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

      public TypeVariable(String name, boolean optional)
  • Method Details

    • of

      public static TypeModel.TypeVariable of(String name)
    • withOptional

      public TypeModel.TypeVariable 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.
    • name

      public String name()
      Returns the value of the name record component.
      Returns:
      the value of the name 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
    • 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