Record Class MagicUtilsConsumerInfo
java.lang.Object
java.lang.Record
dev.ua.theroer.magicutils.platform.MagicUtilsConsumerInfo
- Record Components:
pluginName- consumer display nameversion- consumer versionmainClass- consumer main class / entrypointdescription- consumer descriptionwebsite- consumer website / contact- consumer authorsplatformType- resolved MagicUtils platform adapter type (e.g. Bukkit, Fabric)commandsEnabled- whether MagicUtils commands are enabledpermissionPrefix- command permission prefix when commands are enabledrootCommandCount- number of registered root commandsdiagnosticsEnabled- whether the diagnostics service is presentclosed- whether the runtime is closedtypedComponentCount- typed component countnamedComponentCount- named component countnamedComponentNames- named component keysconnectedAt- timestamp of the last registration
public record MagicUtilsConsumerInfo(String pluginName, String version, String mainClass, @Nullable String description, @Nullable String website, List<String> authors, String platformType, boolean commandsEnabled, @Nullable String permissionPrefix, int rootCommandCount, boolean diagnosticsEnabled, boolean closed, int typedComponentCount, int namedComponentCount, List<String> namedComponentNames, Instant connectedAt)
extends Record
Immutable, platform-independent snapshot of a plugin/mod that is using the
shared MagicUtils runtime. Both the Bukkit and Fabric bundle registries build
and expose these, so the record and the payload-decoding helpers live here in
platform-api rather than being duplicated per platform.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final String -
Constructor Summary
ConstructorsConstructorDescriptionMagicUtilsConsumerInfo(String pluginName, String version, String mainClass, @Nullable String description, @Nullable String website, List<String> authors, String platformType, boolean commandsEnabled, @Nullable String permissionPrefix, int rootCommandCount, boolean diagnosticsEnabled, boolean closed, int typedComponentCount, int namedComponentCount, List<String> namedComponentNames, Instant connectedAt) Creates an instance of aMagicUtilsConsumerInforecord class. -
Method Summary
Modifier and TypeMethodDescriptionauthors()Returns the value of theauthorsrecord component.Compact capabilities string for list output.booleanclosed()Returns the value of theclosedrecord component.booleanReturns the value of thecommandsEnabledrecord component.Returns the value of theconnectedAtrecord component.@Nullable StringReturns the value of thedescriptionrecord component.booleanReturns the value of thediagnosticsEnabledrecord component.final booleanIndicates whether some other object is "equal to" this one.static MagicUtilsConsumerInfofromPayload(Map<String, Object> payload, String fallbackName, String fallbackVersion, String fallbackMainClass, @Nullable String fallbackDescription, @Nullable String fallbackWebsite, List<String> fallbackAuthors) Rebuilds an immutable consumer snapshot from a bridge [payload].static MagicUtilsConsumerInfofromStatic(String pluginName, String version, String mainClass, @Nullable String description, @Nullable String website, List<String> authors, String platformType, boolean commandsEnabled, @Nullable String permissionPrefix, Instant connectedAt, @Nullable MagicUtilsConsumerRuntimeView view) Builds a point-in-time snapshot from static metadata plus a liveview.final inthashCode()Returns a hash code value for this object.Returns the value of themainClassrecord component.booleanmatchesPlugin(@Nullable String pluginName) Returns true when this consumer matches [pluginName] ignoring case.intReturns the value of thenamedComponentCountrecord component.Returns the value of thenamedComponentNamesrecord component.@Nullable StringReturns the value of thepermissionPrefixrecord component.Returns the value of theplatformTyperecord component.Returns the value of thepluginNamerecord component.intReturns the value of therootCommandCountrecord component.final StringtoString()Returns a string representation of this record class.intReturns the value of thetypedComponentCountrecord component.version()Returns the value of theversionrecord component.@Nullable Stringwebsite()Returns the value of thewebsiterecord component.
-
Field Details
-
KEY_PLUGIN_NAME
- See Also:
-
KEY_VERSION
- See Also:
-
KEY_MAIN_CLASS
- See Also:
-
KEY_DESCRIPTION
- See Also:
-
KEY_WEBSITE
- See Also:
-
KEY_AUTHORS
- See Also:
-
KEY_PLATFORM_TYPE
- See Also:
-
KEY_COMMANDS_ENABLED
- See Also:
-
KEY_PERMISSION_PREFIX
- See Also:
-
KEY_ROOT_COMMAND_COUNT
- See Also:
-
KEY_DIAGNOSTICS_ENABLED
- See Also:
-
KEY_CLOSED
- See Also:
-
KEY_TYPED_COMPONENT_COUNT
- See Also:
-
KEY_NAMED_COMPONENT_COUNT
- See Also:
-
KEY_NAMED_COMPONENT_NAMES
- See Also:
-
KEY_CONNECTED_AT_EPOCH_MILLIS
- See Also:
-
-
Constructor Details
-
MagicUtilsConsumerInfo
public MagicUtilsConsumerInfo(String pluginName, String version, String mainClass, @Nullable @Nullable String description, @Nullable @Nullable String website, List<String> authors, String platformType, boolean commandsEnabled, @Nullable @Nullable String permissionPrefix, int rootCommandCount, boolean diagnosticsEnabled, boolean closed, int typedComponentCount, int namedComponentCount, List<String> namedComponentNames, Instant connectedAt) Creates an instance of aMagicUtilsConsumerInforecord class.- Parameters:
pluginName- the value for thepluginNamerecord componentversion- the value for theversionrecord componentmainClass- the value for themainClassrecord componentdescription- the value for thedescriptionrecord componentwebsite- the value for thewebsiterecord componentauthors- the value for theauthorsrecord componentplatformType- the value for theplatformTyperecord componentcommandsEnabled- the value for thecommandsEnabledrecord componentpermissionPrefix- the value for thepermissionPrefixrecord componentrootCommandCount- the value for therootCommandCountrecord componentdiagnosticsEnabled- the value for thediagnosticsEnabledrecord componentclosed- the value for theclosedrecord componenttypedComponentCount- the value for thetypedComponentCountrecord componentnamedComponentCount- the value for thenamedComponentCountrecord componentnamedComponentNames- the value for thenamedComponentNamesrecord componentconnectedAt- the value for theconnectedAtrecord component
-
-
Method Details
-
matchesPlugin
Returns true when this consumer matches [pluginName] ignoring case. -
capabilitiesSummary
Compact capabilities string for list output. -
fromStatic
public static MagicUtilsConsumerInfo fromStatic(String pluginName, String version, String mainClass, @Nullable @Nullable String description, @Nullable @Nullable String website, List<String> authors, String platformType, boolean commandsEnabled, @Nullable @Nullable String permissionPrefix, Instant connectedAt, @Nullable @Nullable MagicUtilsConsumerRuntimeView view) Builds a point-in-time snapshot from static metadata plus a liveview. The static fields never change after registration; the dynamic fields (command/component counts, diagnostics, closed) are read from the view at call time, so each snapshot reflects the consumer's current state. Anullview yields a consumer with zeroed dynamic fields. -
fromPayload
public static MagicUtilsConsumerInfo fromPayload(Map<String, Object> payload, String fallbackName, String fallbackVersion, String fallbackMainClass, @Nullable @Nullable String fallbackDescription, @Nullable @Nullable String fallbackWebsite, List<String> fallbackAuthors) Rebuilds an immutable consumer snapshot from a bridge [payload]. The fallbacks apply when a key is absent or of the wrong type, so a partial payload still yields a usable record. -
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. -
pluginName
Returns the value of thepluginNamerecord component.- Returns:
- the value of the
pluginNamerecord component
-
version
-
mainClass
-
description
Returns the value of thedescriptionrecord component.- Returns:
- the value of the
descriptionrecord component
-
website
-
authors
-
platformType
Returns the value of theplatformTyperecord component.- Returns:
- the value of the
platformTyperecord component
-
commandsEnabled
public boolean commandsEnabled()Returns the value of thecommandsEnabledrecord component.- Returns:
- the value of the
commandsEnabledrecord component
-
permissionPrefix
Returns the value of thepermissionPrefixrecord component.- Returns:
- the value of the
permissionPrefixrecord component
-
rootCommandCount
public int rootCommandCount()Returns the value of therootCommandCountrecord component.- Returns:
- the value of the
rootCommandCountrecord component
-
diagnosticsEnabled
public boolean diagnosticsEnabled()Returns the value of thediagnosticsEnabledrecord component.- Returns:
- the value of the
diagnosticsEnabledrecord component
-
closed
-
typedComponentCount
public int typedComponentCount()Returns the value of thetypedComponentCountrecord component.- Returns:
- the value of the
typedComponentCountrecord component
-
namedComponentCount
public int namedComponentCount()Returns the value of thenamedComponentCountrecord component.- Returns:
- the value of the
namedComponentCountrecord component
-
namedComponentNames
Returns the value of thenamedComponentNamesrecord component.- Returns:
- the value of the
namedComponentNamesrecord component
-
connectedAt
Returns the value of theconnectedAtrecord component.- Returns:
- the value of the
connectedAtrecord component
-