Package com.plotsquared.core.components
Record Class ComponentPreset
java.lang.Object
java.lang.Record
com.plotsquared.core.components.ComponentPreset
- All Implemented Interfaces:
ConfigurationSerializable
public record ComponentPreset(ClassicPlotManagerComponent component, String pattern, double cost, String permission, String displayName, List<String> description, ItemType icon)
extends Record
implements ConfigurationSerializable
A preset that can be used to set a component from
the component GUI
-
Constructor Summary
ConstructorsConstructorDescriptionComponentPreset(ClassicPlotManagerComponent component, String pattern, double cost, String permission, String displayName, List<String> description, ItemType icon) Creates an instance of aComponentPresetrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thecomponentrecord component.doublecost()Returns the value of thecostrecord component.Returns the value of thedescriptionrecord component.static ComponentPresetdeserialize(@NonNull Map<String, Object> map) 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.icon()Returns the value of theiconrecord component.pattern()Returns the value of thepatternrecord component.Returns the value of thepermissionrecord component.Creates a Map representation of this class.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
ComponentPreset
public ComponentPreset(ClassicPlotManagerComponent component, String pattern, double cost, String permission, String displayName, List<String> description, ItemType icon) Creates an instance of aComponentPresetrecord class.- Parameters:
component- the value for thecomponentrecord componentpattern- the value for thepatternrecord componentcost- the value for thecostrecord componentpermission- the value for thepermissionrecord componentdisplayName- the value for thedisplayNamerecord componentdescription- the value for thedescriptionrecord componenticon- the value for theiconrecord component
-
-
Method Details
-
deserialize
-
serialize
Description copied from interface:ConfigurationSerializableCreates a Map representation of this class.This class must provide a method to restore this class, as defined in the
ConfigurationSerializableinterface javadoc.- Specified by:
serializein interfaceConfigurationSerializable- Returns:
- Map containing the current state of this class
-
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
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
component
Returns the value of thecomponentrecord component.- Returns:
- the value of the
componentrecord component
-
pattern
Returns the value of thepatternrecord component.- Returns:
- the value of the
patternrecord component
-
cost
Returns the value of thecostrecord component.- Returns:
- the value of the
costrecord component
-
permission
Returns the value of thepermissionrecord component.- Returns:
- the value of the
permissionrecord component
-
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
-
icon
Returns the value of theiconrecord component.- Returns:
- the value of the
iconrecord component
-