Record Class TypeModel.EntityRef

java.lang.Object
java.lang.Record
com.vaadin.hilla.generator.model.TypeModel.EntityRef
Record Components:
javaClass - the fully qualified name of the Java class, which decides both the name and the location of the generated file
All Implemented Interfaces:
TypeModel
Enclosing interface:
TypeModel

public static record TypeModel.EntityRef(String javaClass, List<TypeModel> typeArguments, boolean optional, List<ConstraintModel> constraints, List<AnnotationModel> annotations) extends Record implements TypeModel
A reference to a type generated as a TypeScript declaration of its own.
  • Constructor Details

    • EntityRef

      public EntityRef(String javaClass, List<TypeModel> typeArguments, boolean optional, List<ConstraintModel> constraints, List<AnnotationModel> annotations)
      Creates an instance of a EntityRef record class.
      Parameters:
      javaClass - the value for the javaClass record component
      typeArguments - the value for the typeArguments 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
    • EntityRef

      public EntityRef(String javaClass, List<TypeModel> typeArguments, boolean optional)
  • Method Details

    • of

      public static TypeModel.EntityRef of(String javaClass)
    • withOptional

      public TypeModel.EntityRef 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.
    • javaClass

      public String javaClass()
      Returns the value of the javaClass record component.
      Returns:
      the value of the javaClass record component
    • typeArguments

      public List<TypeModel> typeArguments()
      Returns the value of the typeArguments record component.
      Returns:
      the value of the typeArguments 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