Record Class HandlerMappingDescriptor

java.lang.Object
java.lang.Record
eu.rarogsoftware.rarog.platform.api.plugins.web.HandlerMappingDescriptor
Record Components:
baseUrl - base url part used for matching requests that should be handled by specified mappings. Will map urls: [/rest/{baseUrl}/, /plugin/{baseUrl}/]
handlerMappings - collection of HandlerMapping
exactMatchOnly - if true mapping in provided handlerMappings must match full url, if false mapping can skip base url
All Implemented Interfaces:
FeatureDescriptor

public record HandlerMappingDescriptor(String baseUrl, Collection<org.springframework.web.servlet.HandlerMapping> handlerMappings, boolean exactMatchOnly) extends Record implements FeatureDescriptor
Registers spring based HandlerMappings under specified base url.

Used to register custom spring based endpoints. It allows to develop endpoints with Spring MVC as in any other Spring application. The base usage example with spring-plugin-activator that automatically exports feature descriptors:

  • Constructor Details

    • HandlerMappingDescriptor

      public HandlerMappingDescriptor(String baseUrl, Collection<org.springframework.web.servlet.HandlerMapping> handlerMappings, boolean exactMatchOnly)
      Creates an instance of a HandlerMappingDescriptor record class.
      Parameters:
      baseUrl - the value for the baseUrl record component
      handlerMappings - the value for the handlerMappings record component
      exactMatchOnly - the value for the exactMatchOnly record component
    • HandlerMappingDescriptor

      public HandlerMappingDescriptor(String baseUrl, Collection<org.springframework.web.servlet.HandlerMapping> handlerMappings)
  • Method Details

    • getName

      public String getName()
      Description copied from interface: FeatureDescriptor
      Unique name for descriptor in scope of plugin. If descriptor can repeat, then different names need to be returned for each one.
      Specified by:
      getName in interface FeatureDescriptor
      Returns:
      unique name of feature descriptor
    • 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.
    • baseUrl

      public String baseUrl()
      Returns the value of the baseUrl record component.
      Returns:
      the value of the baseUrl record component
    • handlerMappings

      public Collection<org.springframework.web.servlet.HandlerMapping> handlerMappings()
      Returns the value of the handlerMappings record component.
      Returns:
      the value of the handlerMappings record component
    • exactMatchOnly

      public boolean exactMatchOnly()
      Returns the value of the exactMatchOnly record component.
      Returns:
      the value of the exactMatchOnly record component