Record Class TypeModel.Provided

java.lang.Object
java.lang.Record
com.vaadin.hilla.generator.model.TypeModel.Provided
Record Components:
name - the name the type goes by in TypeScript
module - the module exporting it under that name, or empty for one the browser has
All Implemented Interfaces:
TypeModel
Enclosing interface:
TypeModel

public static record TypeModel.Provided(String name, String module, List<TypeModel> typeArguments, boolean optional, List<ConstraintModel> constraints, List<AnnotationModel> annotations) extends Record implements TypeModel
A type the generated TypeScript refers to by name rather than by declaring it: one the browser has, such as a file, or one a module of the framework exports, such as a signal.
  • Constructor Details

    • Provided

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

      public Provided(String name, String module, List<TypeModel> typeArguments, boolean optional)
  • Method Details

    • withOptional

      public TypeModel.Provided 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
    • module

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