Record Class ApiError
java.lang.Object
java.lang.Record
com.bluebell.greenhouse.platform.models.api.error.ApiError
- Record Components:
httpStatus-HttpStatusapiErrorReason-ApiErrorReasonpublicErrorMessage- client-facing messageinternalErrorMessage- internal messagepath- request pathtimestamp-LocalDateTimedata- optional data
public record ApiError(int httpStatus, ApiErrorReason apiErrorReason, String publicErrorMessage, String internalErrorMessage, String path, LocalDateTime timestamp, Object data)
extends Record
Class representation of an erroneous api response.
- Version:
- 3.0.6
- Author:
- Stephen Prizio
-
Constructor Summary
ConstructorsConstructorDescriptionApiError(int httpStatus, ApiErrorReason apiErrorReason, String publicErrorMessage, String internalErrorMessage, String path, LocalDateTime timestamp, Object data) Creates an instance of aApiErrorrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theapiErrorReasonrecord component.data()Returns the value of thedatarecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.intReturns the value of thehttpStatusrecord component.Returns the value of theinternalErrorMessagerecord component.path()Returns the value of thepathrecord component.Returns the value of thepublicErrorMessagerecord component.Returns the value of thetimestamprecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
ApiError
public ApiError(int httpStatus, ApiErrorReason apiErrorReason, String publicErrorMessage, String internalErrorMessage, String path, LocalDateTime timestamp, Object data) Creates an instance of aApiErrorrecord class.- Parameters:
httpStatus- the value for thehttpStatusrecord componentapiErrorReason- the value for theapiErrorReasonrecord componentpublicErrorMessage- the value for thepublicErrorMessagerecord componentinternalErrorMessage- the value for theinternalErrorMessagerecord componentpath- the value for thepathrecord componenttimestamp- the value for thetimestamprecord componentdata- the value for thedatarecord component
-
-
Method Details
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
httpStatus
public int httpStatus()Returns the value of thehttpStatusrecord component.- Returns:
- the value of the
httpStatusrecord component
-
apiErrorReason
Returns the value of theapiErrorReasonrecord component.- Returns:
- the value of the
apiErrorReasonrecord component
-
publicErrorMessage
Returns the value of thepublicErrorMessagerecord component.- Returns:
- the value of the
publicErrorMessagerecord component
-
internalErrorMessage
Returns the value of theinternalErrorMessagerecord component.- Returns:
- the value of the
internalErrorMessagerecord component
-
path
-
timestamp
-
data
-