Record Class ApiResponse<T>
java.lang.Object
java.lang.Record
org.teleight.teleightbots.api.objects.ApiResponse<T>
- All Implemented Interfaces:
Serializable,ApiResult
public record ApiResponse<T>(boolean ok, int errorCode, String errorDescription, ResponseParameters parameters, T result)
extends Record
implements ApiResult
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionApiResponse(boolean ok, int errorCode, String errorDescription, ResponseParameters parameters, T result) Creates an instance of aApiResponserecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.intReturns the value of theerrorCoderecord component.Returns the value of theerrorDescriptionrecord component.final inthashCode()Returns a hash code value for this object.booleanok()Returns the value of theokrecord component.Returns the value of theparametersrecord component.result()Returns the value of theresultrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
ApiResponse
public ApiResponse(boolean ok, int errorCode, String errorDescription, ResponseParameters parameters, T result) Creates an instance of aApiResponserecord class.- Parameters:
ok- the value for theokrecord componenterrorCode- the value for theerrorCoderecord componenterrorDescription- the value for theerrorDescriptionrecord componentparameters- the value for theparametersrecord componentresult- the value for theresultrecord 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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
ok
public boolean ok()Returns the value of theokrecord component.- Returns:
- the value of the
okrecord component
-
errorCode
public int errorCode()Returns the value of theerrorCoderecord component.- Returns:
- the value of the
errorCoderecord component
-
errorDescription
Returns the value of theerrorDescriptionrecord component.- Returns:
- the value of the
errorDescriptionrecord component
-
parameters
Returns the value of theparametersrecord component.- Returns:
- the value of the
parametersrecord component
-
result
Returns the value of theresultrecord component.- Returns:
- the value of the
resultrecord component
-