Record Class StructuralModificationResponse.InvalidRequest
java.lang.Object
java.lang.Record
com.inductiveautomation.ignition.gateway.config.actions.StructuralModificationResponse.InvalidRequest
- All Implemented Interfaces:
StructuralModificationResponse
- Enclosing interface:
StructuralModificationResponse
public static record StructuralModificationResponse.InvalidRequest(Exception problem)
extends Record
implements StructuralModificationResponse
The request could not be carried out because of something the caller did.
problem's
message is handed straight to the caller, so it must not carry internal detail.
Prefer this over StructuralModificationResponse.Failure, which is reported as a server error, stacktrace and all.
The exception's type is the classification, and a domain one rather than an HTTP one: the
route layer decides what each type is worth as a status code. Carrying the exception rather
than a rendered message also keeps what it knows in reach, such as a SignatureMismatchException's path.
-
Nested Class Summary
Nested classes/interfaces inherited from interface StructuralModificationResponse
StructuralModificationResponse.Conflict, StructuralModificationResponse.Failure, StructuralModificationResponse.InvalidRequest, StructuralModificationResponse.NotFound, StructuralModificationResponse.NotPrimary, StructuralModificationResponse.RequiresConfirmation, StructuralModificationResponse.Success, StructuralModificationResponse.ValidationFailed -
Field Summary
Fields inherited from interface StructuralModificationResponse
FALLBACK_MESSAGE -
Constructor Summary
ConstructorsConstructorDescriptionInvalidRequest(Exception problem) Creates an instance of aInvalidRequestrecord class.InvalidRequest(String message) A refusal with nothing to say beyondmessage; classified as a bad argument. -
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.message()The text meant for whoever made the request.problem()Returns the value of theproblemrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
InvalidRequest
A refusal with nothing to say beyondmessage; classified as a bad argument. -
InvalidRequest
Creates an instance of aInvalidRequestrecord class.- Parameters:
problem- the value for theproblemrecord component
-
-
Method Details
-
message
The text meant for whoever made the request. Never null — nothing stops a caller supplying an exception with no message, and a null reaches the UI as the raw envelope. -
toString
-
hashCode
-
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). -
problem
Returns the value of theproblemrecord component.- Specified by:
problemin interfaceStructuralModificationResponse- Returns:
- the value of the
problemrecord component
-