Record Class EndpointModel

java.lang.Object
java.lang.Record
com.vaadin.hilla.generator.model.EndpointModel
Record Components:
name - the name used both for the generated file and in the calls to the server, which is not necessarily the simple name of the Java class
javaClass - the fully qualified name of the Java class

public record EndpointModel(String name, String javaClass, List<MethodModel> methods) extends Record
A browser callable class as the TypeScript generator needs it: the name the client calls it by, and the methods it exposes.
  • Constructor Details

    • EndpointModel

      public EndpointModel(String name, String javaClass, List<MethodModel> methods)
      Creates an instance of a EndpointModel record class.
      Parameters:
      name - the value for the name record component
      javaClass - the value for the javaClass record component
      methods - the value for the methods record component
  • Method Details

    • 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. All components in this record class are compared with Objects::equals(Object,Object).
      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
    • javaClass

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

      public List<MethodModel> methods()
      Returns the value of the methods record component.
      Returns:
      the value of the methods record component