Record Class RestControllerParams
java.lang.Object
java.lang.Record
com.bobocode.bring.web.servlet.mapping.RestControllerParams
- Record Components:
instance- The instance of the controller.method- The method associated with the parameters.requestMethod- The HTTP request method associated with the method.path- The path associated with the method.
public record RestControllerParams(Object instance, Method method, RequestMethod requestMethod, String path)
extends Record
The
RestControllerParams record represents parameters associated with a method
in a web controller.
This record is used to encapsulate information such as the controller instance, the method, the HTTP request method, and the path.
- Since:
- 1.0
- Author:
- Blyzhnytsia Team
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ObjectThe field for theinstancerecord component.private final MethodThe field for themethodrecord component.private final StringThe field for thepathrecord component.private final RequestMethodThe field for therequestMethodrecord component. -
Constructor Summary
ConstructorsConstructorDescriptionRestControllerParams(Object instance, Method method, RequestMethod requestMethod, String path) Creates an instance of aRestControllerParamsrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.instance()Returns the value of theinstancerecord component.method()Returns the value of themethodrecord component.path()Returns the value of thepathrecord component.Returns the value of therequestMethodrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
instance
The field for theinstancerecord component. -
method
The field for themethodrecord component. -
requestMethod
The field for therequestMethodrecord component. -
path
The field for thepathrecord component.
-
-
Constructor Details
-
RestControllerParams
public RestControllerParams(Object instance, Method method, RequestMethod requestMethod, String path) Creates an instance of aRestControllerParamsrecord class.- Parameters:
instance- the value for theinstancerecord componentmethod- the value for themethodrecord componentrequestMethod- the value for therequestMethodrecord componentpath- the value for thepathrecord component
-
-
Method Details
-
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. All components in this record class are compared withObjects::equals(Object,Object). -
instance
Returns the value of theinstancerecord component.- Returns:
- the value of the
instancerecord component
-
method
Returns the value of themethodrecord component.- Returns:
- the value of the
methodrecord component
-
requestMethod
Returns the value of therequestMethodrecord component.- Returns:
- the value of the
requestMethodrecord component
-
path
Returns the value of thepathrecord component.- Returns:
- the value of the
pathrecord component
-