Record Class PluginMetadata
java.lang.Object
java.lang.Record
me.pauleff.converter.api.PluginMetadata
- Record Components:
id- a non-blank unique plugin identifierdisplayName- a human-readable name shown in logs or UIdescription- a short description of what the plugin doespriority- the execution priority; lower values run earlier after clamping
public record PluginMetadata(String id, String displayName, String description, int priority)
extends Record
Holds identifying and scheduling information for a
MOOCPlugin.
Priority is clamped to the inclusive range MIN_PRIORITY–MAX_PRIORITY
when the record is constructed. Factory methods supply a default priority when omitted.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final int -
Constructor Summary
ConstructorsConstructorDescriptionPluginMetadata(String id, String displayName, String description, int priority) Validates non-null record components, rejects a blankid, and clampspriorityinto the allowed range. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thedescriptionrecord component.Returns the value of thedisplayNamerecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.id()Returns the value of theidrecord component.static PluginMetadataCreates metadata withDEFAULT_PRIORITY.static PluginMetadataCreates metadata with an explicit priority (clamped on construction).intpriority()Returns the value of thepriorityrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
MIN_PRIORITY
public static final int MIN_PRIORITY- See Also:
-
MAX_PRIORITY
public static final int MAX_PRIORITY- See Also:
-
DEFAULT_PRIORITY
public static final int DEFAULT_PRIORITY- See Also:
-
-
Constructor Details
-
PluginMetadata
Validates non-null record components, rejects a blankid, and clampspriorityinto the allowed range.- Throws:
NullPointerException- ifid,displayName, ordescriptionisnullIllegalArgumentException- ifidis blank
-
-
Method Details
-
of
Creates metadata withDEFAULT_PRIORITY.- Parameters:
id- a non-blank unique plugin identifierdisplayName- a human-readable name shown in logs or UIdescription- a short description of what the plugin does- Returns:
- a new
PluginMetadatainstance
-
of
Creates metadata with an explicit priority (clamped on construction).- Parameters:
id- a non-blank unique plugin identifierdisplayName- a human-readable name shown in logs or UIdescription- a short description of what the plugin doespriority- the desired execution priority before clamping- Returns:
- a new
PluginMetadatainstance
-
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. -
id
-
displayName
Returns the value of thedisplayNamerecord component.- Returns:
- the value of the
displayNamerecord component
-
description
Returns the value of thedescriptionrecord component.- Returns:
- the value of the
descriptionrecord component
-
priority
-