Package dev.tobee.telegram.model.message
Record Class ResponseWrapper<T>
java.lang.Object
java.lang.Record
dev.tobee.telegram.model.message.ResponseWrapper<T>
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thedescriptionrecord component.final booleanIndicates whether some other object is "equal to" this one.Returns the value of theerrorCoderecord component.final inthashCode()Returns a hash code value for this object.booleanok()Returns the value of theokrecord component.result()Returns the value of theresultrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
ResponseWrapper
public ResponseWrapper(boolean ok, Optional<T> result, Optional<String> errorCode, Optional<String> description) Creates an instance of aResponseWrapperrecord class.- Parameters:
ok- the value for theokrecord componentresult- the value for theresultrecord componenterrorCode- the value for theerrorCoderecord componentdescription- the value for thedescriptionrecord 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
-
result
Returns the value of theresultrecord component.- Returns:
- the value of the
resultrecord component
-
errorCode
Returns the value of theerrorCoderecord component.- Returns:
- the value of the
errorCoderecord component
-
description
Returns the value of thedescriptionrecord component.- Returns:
- the value of the
descriptionrecord component
-