Module ch.rasc.jcentserverclient
Package ch.rasc.jcentserverclient.models
Record Class ConnectionsResponse
java.lang.Object
java.lang.Record
ch.rasc.jcentserverclient.models.ConnectionsResponse
Response from a connections operation.
-
Constructor Summary
ConstructorsConstructorDescriptionConnectionsResponse(Error error, ConnectionsResult result) Creates an instance of aConnectionsResponserecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.error()Get the error if present.booleanhasError()Check if the response has an error.final inthashCode()Returns a hash code value for this object.result()Get the result if successful.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
ConnectionsResponse
Creates an instance of aConnectionsResponserecord class.- Parameters:
error- the value for theerrorrecord componentresult- the value for theresultrecord component
-
-
Method Details
-
hasError
public boolean hasError()Check if the response has an error.- Returns:
- true if there is an error, false otherwise
-
error
Get the error if present.- Returns:
- the error or null if no error
-
result
Get the result if successful.- Returns:
- the result or null if there was an error
-
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).
-