Record Class Endpoint

java.lang.Object
java.lang.Record
com.arc_e_tect.gradle.shadow.model.Endpoint
Record Components:
verb - the HTTP verb the endpoint responds to; HttpVerb.ANY when the controller method does not restrict the verb
path - the endpoint's path template, e.g. "/api/users/{id}"; always starts with "/"
declaringClass - fully-qualified name of the @RestController class
methodSignature - simple signature of the handler method, e.g. "getUser(Long)"
sourceFile - simple file name of the source file, e.g. "UserController.java"
lineNumber - 1-based source line number of the handler method, or 0 when unknown

public record Endpoint(HttpVerb verb, String path, String declaringClass, String methodSignature, String sourceFile, int lineNumber) extends Record
A single HTTP endpoint exposed by a @RestController method, as found by scanning controller source code.
  • Constructor Details

    • Endpoint

      public Endpoint(HttpVerb verb, String path, String declaringClass, String methodSignature, String sourceFile, int lineNumber)
      Creates an instance of a Endpoint record class.
      Parameters:
      verb - the value for the verb record component
      path - the value for the path record component
      declaringClass - the value for the declaringClass record component
      methodSignature - the value for the methodSignature record component
      sourceFile - the value for the sourceFile record component
      lineNumber - the value for the lineNumber 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. 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.
    • verb

      public HttpVerb verb()
      Returns the value of the verb record component.
      Returns:
      the value of the verb record component
    • path

      public String path()
      Returns the value of the path record component.
      Returns:
      the value of the path record component
    • declaringClass

      public String declaringClass()
      Returns the value of the declaringClass record component.
      Returns:
      the value of the declaringClass record component
    • methodSignature

      public String methodSignature()
      Returns the value of the methodSignature record component.
      Returns:
      the value of the methodSignature record component
    • sourceFile

      public String sourceFile()
      Returns the value of the sourceFile record component.
      Returns:
      the value of the sourceFile record component
    • lineNumber

      public int lineNumber()
      Returns the value of the lineNumber record component.
      Returns:
      the value of the lineNumber record component