Record Class ModuleApiResult
java.lang.Object
java.lang.Record
de.rexlcloud.core.api.module.ModuleApiResult
- Record Components:
status- what happenedmessage- human-readable explanation, mainly for errorsdata- optional payload (for example the generated key of a new wrapper)
public record ModuleApiResult(@NonNull ModuleApiResult.Status status, @Nullable String message, @Nullable com.google.gson.JsonElement data)
extends Record
Outcome of a state-changing
ModuleApi call.-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionModuleApiResult(@NonNull ModuleApiResult.Status status, @Nullable String message, @Nullable com.google.gson.JsonElement data) Creates an instance of aModuleApiResultrecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic ModuleApiResultstatic ModuleApiResult@Nullable com.google.gson.JsonElementdata()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.static ModuleApiResultboolean@Nullable Stringmessage()Returns the value of themessagerecord component.static ModuleApiResultstatic ModuleApiResultok()static ModuleApiResultok(com.google.gson.JsonElement data) static ModuleApiResult@NonNull ModuleApiResult.Statusstatus()Returns the value of thestatusrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
ModuleApiResult
public ModuleApiResult(@NonNull @NonNull ModuleApiResult.Status status, @Nullable @Nullable String message, @Nullable @Nullable com.google.gson.JsonElement data) Creates an instance of aModuleApiResultrecord class.
-
-
Method Details
-
ok
-
ok
-
ok
-
accepted
-
notFound
-
conflict
-
invalid
-
isSuccess
public boolean isSuccess() -
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. All components in this record class are compared withObjects::equals(Object,Object). -
status
-
message
-
data
-