Record Class SettingUserIdResult
java.lang.Object
java.lang.Record
com.iohao.net.framework.protocol.SettingUserIdResult
- Record Components:
errorCode- error code; 0 indicates successerrorMessage- human-readable error description;nullon success
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final SettingUserIdResultGeneric internal communication error result.static final SettingUserIdResultSuccessful result singleton. -
Constructor Summary
ConstructorsConstructorDescriptionSettingUserIdResult(int errorCode, String errorMessage) Creates an instance of aSettingUserIdResultrecord 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 theerrorMessagerecord component.final inthashCode()Returns a hash code value for this object.static SettingUserIdResultofError(ErrorInformation errorInformation) Create an error result from the givenErrorInformation.static SettingUserIdResultCreate an error result with a validation error code and the given message.booleansuccess()Check whether the operation completed successfully.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
SUCCESS
Successful result singleton. -
ERROR
Generic internal communication error result.
-
-
Constructor Details
-
SettingUserIdResult
Creates an instance of aSettingUserIdResultrecord class.- Parameters:
errorCode- the value for theerrorCoderecord componenterrorMessage- the value for theerrorMessagerecord component
-
-
Method Details
-
success
public boolean success()Check whether the operation completed successfully.- Returns:
trueif the error code is 0
-
ofError
Create an error result with a validation error code and the given message.- Parameters:
errorMessage- the error description- Returns:
- a new error result
-
ofError
Create an error result from the givenErrorInformation.- Parameters:
errorInformation- the error information source- Returns:
- a new error result
-
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. -
errorCode
-
errorMessage
Returns the value of theerrorMessagerecord component.- Returns:
- the value of the
errorMessagerecord component
-