Record Class CapabilityStatus
java.lang.Object
java.lang.Record
dev.itsharshxd.zentrix.api.platform.CapabilityStatus
- Record Components:
id- the capability id, such asZentrixCapabilities.GLIDER_DEPLOYMENTstate- whether it can be used, and if not, whyreason- a human-readable explanation when it is not available;nullotherwiseprovider- who reports it:"Zentrix"for built-in capabilities, otherwise the name of the plugin that registered it
public record CapabilityStatus(@NotNull String id, @NotNull CapabilityState state, @Nullable String reason, @NotNull String provider)
extends Record
One capability as it stands on this server.
- Since:
- 1.8.0
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCapabilityStatus(@NotNull String id, @NotNull CapabilityState state, @Nullable String reason, @NotNull String provider) Creates an instance of aCapabilityStatusrecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic @NotNull CapabilityStatusA usable capability.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.@NotNull Stringid()Returns the value of theidrecord component.booleanWhether the capability can be used now.@NotNull Stringprovider()Returns the value of theproviderrecord component.@Nullable Stringreason()Returns the value of thereasonrecord component.@NotNull CapabilityStatestate()Returns the value of thestaterecord component.final StringtoString()Returns a string representation of this record class.static @NotNull CapabilityStatusunavailable(@NotNull String id, @NotNull CapabilityState state, @Nullable String reason, @NotNull String provider) A capability that cannot be used, and why.static @NotNull CapabilityStatusAn id this server does not know.
-
Field Details
-
ZENTRIX
The provider name of every capability Zentrix reports itself.- See Also:
-
-
Constructor Details
-
CapabilityStatus
public CapabilityStatus(@NotNull @NotNull String id, @NotNull @NotNull CapabilityState state, @Nullable @Nullable String reason, @NotNull @NotNull String provider) Creates an instance of aCapabilityStatusrecord class.
-
-
Method Details
-
available
@NotNull public static @NotNull CapabilityStatus available(@NotNull @NotNull String id, @NotNull @NotNull String provider) A usable capability. -
unknown
An id this server does not know. -
isAvailable
public boolean isAvailable()Whether the capability can be used now. -
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). -
id
Returns the value of theidrecord component.- Returns:
- the value of the
idrecord component
-
state
Returns the value of thestaterecord component.- Returns:
- the value of the
staterecord component
-
reason
Returns the value of thereasonrecord component.- Returns:
- the value of the
reasonrecord component
-
provider
Returns the value of theproviderrecord component.- Returns:
- the value of the
providerrecord component
-