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 ofHandlerMapping
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
HandlerMapping
s 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 Summary
ConstructorsConstructorDescriptionHandlerMappingDescriptor
(String baseUrl, Collection<org.springframework.web.servlet.HandlerMapping> handlerMappings) HandlerMappingDescriptor
(String baseUrl, Collection<org.springframework.web.servlet.HandlerMapping> handlerMappings, boolean exactMatchOnly) Creates an instance of aHandlerMappingDescriptor
record class. -
Method Summary
Modifier and TypeMethodDescriptionbaseUrl()
Returns the value of thebaseUrl
record component.final boolean
Indicates whether some other object is "equal to" this one.boolean
Returns the value of theexactMatchOnly
record component.getName()
Unique name for descriptor in scope of plugin.Collection<org.springframework.web.servlet.HandlerMapping>
Returns the value of thehandlerMappings
record component.final int
hashCode()
Returns a hash code value for this object.final String
toString()
Returns a string representation of this record class.
-
Constructor Details
-
HandlerMappingDescriptor
public HandlerMappingDescriptor(String baseUrl, Collection<org.springframework.web.servlet.HandlerMapping> handlerMappings, boolean exactMatchOnly) Creates an instance of aHandlerMappingDescriptor
record class.- Parameters:
baseUrl
- the value for thebaseUrl
record componenthandlerMappings
- the value for thehandlerMappings
record componentexactMatchOnly
- the value for theexactMatchOnly
record component
-
HandlerMappingDescriptor
public HandlerMappingDescriptor(String baseUrl, Collection<org.springframework.web.servlet.HandlerMapping> handlerMappings)
-
-
Method Details
-
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 interfaceFeatureDescriptor
- Returns:
- unique name of feature descriptor
-
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. -
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. -
equals
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 withObjects::equals(Object,Object)
; primitive components are compared with '=='. -
baseUrl
Returns the value of thebaseUrl
record component.- Returns:
- the value of the
baseUrl
record component
-
handlerMappings
Returns the value of thehandlerMappings
record component.- Returns:
- the value of the
handlerMappings
record component
-
exactMatchOnly
public boolean exactMatchOnly()Returns the value of theexactMatchOnly
record component.- Returns:
- the value of the
exactMatchOnly
record component
-