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 Details

    • ComponentPreset

      public ComponentPreset(ClassicPlotManagerComponent component, String pattern, double cost, String permission, String displayName, List<String> description, ItemType icon)
      Creates an instance of a ComponentPreset record class.
      Parameters:
      component - the value for the component record component
      pattern - the value for the pattern record component
      cost - the value for the cost record component
      permission - the value for the permission record component
      displayName - the value for the displayName record component
      description - the value for the description record component
      icon - the value for the icon record component
  • Method Details

    • deserialize

    • serialize

      Description copied from interface: ConfigurationSerializable
      Creates a Map representation of this class.

      This class must provide a method to restore this class, as defined in the ConfigurationSerializable interface javadoc.

      Specified by:
      serialize in interface ConfigurationSerializable
      Returns:
      Map containing the current state of this class
    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • component

      Returns the value of the component record component.
      Returns:
      the value of the component record component
    • pattern

      public String pattern()
      Returns the value of the pattern record component.
      Returns:
      the value of the pattern record component
    • cost

      public double cost()
      Returns the value of the cost record component.
      Returns:
      the value of the cost record component
    • permission

      public String permission()
      Returns the value of the permission record component.
      Returns:
      the value of the permission record component
    • displayName

      public String displayName()
      Returns the value of the displayName record component.
      Returns:
      the value of the displayName record component
    • description

      public List<String> description()
      Returns the value of the description record component.
      Returns:
      the value of the description record component
    • icon

      public ItemType icon()
      Returns the value of the icon record component.
      Returns:
      the value of the icon record component