Record Class UberConfiguration.UberRecord

java.lang.Object
java.lang.Record
me.sciguymjm.uberenchant.api.utils.UberConfiguration.UberRecord
Enclosing class:
UberConfiguration

public static record UberConfiguration.UberRecord(org.bukkit.enchantments.Enchantment enchantment, String name, String display_name, int min_level, int max_level, double cost, double cost_multiplier, double removal_cost, double extraction_cost, boolean can_use_on_anything, List<String> aliases, Map<Integer,Double> cost_for_level) extends Record
Utility record class for ease of adding records
  • Constructor Summary

    Constructors
    Constructor
    Description
    UberRecord(org.bukkit.enchantments.Enchantment enchantment, String name, String display_name, int min_level, int max_level, double cost, double cost_multiplier, double removal_cost, double extraction_cost, boolean can_use_on_anything, List<String> aliases, Map<Integer,Double> cost_for_level)
    Creates an instance of a UberRecord record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the value of the aliases record component.
    boolean
    Returns the value of the can_use_on_anything record component.
    double
    Returns the value of the cost record component.
    Returns the value of the cost_for_level record component.
    double
    Returns the value of the cost_multiplier record component.
    Returns the value of the display_name record component.
    org.bukkit.enchantments.Enchantment
    Returns the value of the enchantment record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    double
    Returns the value of the extraction_cost record component.
    Gets a list of aliases for the enchantment, can be empty.
    boolean
    Gets wether or not the enchantment can be used on anything.
    double
    Gets the cost of the enhchantment.
    Gets a map of levels and their costs, can be empty.
    double
    Gets the cost multiplier.
    Gets the display name of the enchantment this record represents.
    org.bukkit.enchantments.Enchantment
    Gets the enchantment associated with this record.
    double
    Gets the extraction cost.
    int
    Gets the maximum level the enchantment can be.
    int
    Gets the minimum level the enchantment can be.
    Gets the name of this record.
    double
    Gets the removal cost.
    final int
    Returns a hash code value for this object.
    int
    Returns the value of the max_level record component.
    int
    Returns the value of the min_level record component.
    Returns the value of the name record component.
    double
    Returns the value of the removal_cost record component.
    final String
    Returns a string representation of this record class.
    Gets a list of all available UberRecords

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • UberRecord

      public UberRecord(org.bukkit.enchantments.Enchantment enchantment, String name, String display_name, int min_level, int max_level, double cost, double cost_multiplier, double removal_cost, double extraction_cost, boolean can_use_on_anything, List<String> aliases, Map<Integer,Double> cost_for_level)
      Creates an instance of a UberRecord record class.
      Parameters:
      enchantment - the value for the enchantment record component
      name - the value for the name record component
      display_name - the value for the display_name record component
      min_level - the value for the min_level record component
      max_level - the value for the max_level record component
      cost - the value for the cost record component
      cost_multiplier - the value for the cost_multiplier record component
      removal_cost - the value for the removal_cost record component
      extraction_cost - the value for the extraction_cost record component
      can_use_on_anything - the value for the can_use_on_anything record component
      aliases - the value for the aliases record component
      cost_for_level - the value for the cost_for_level record component
  • Method Details

    • getEnchant

      public org.bukkit.enchantments.Enchantment getEnchant()
      Gets the enchantment associated with this record.
      Returns:
      The enchantment
    • getName

      public String getName()
      Gets the name of this record.
      Returns:
      The name of the record (Same as enchantment.getKey().getKey())
    • getDisplayName

      public String getDisplayName()
      Gets the display name of the enchantment this record represents.
      Returns:
      The display name of the enchantment
    • getMinLevel

      public int getMinLevel()
      Gets the minimum level the enchantment can be.
      Returns:
      The minimum level of the enchantment
    • getMaxLevel

      public int getMaxLevel()
      Gets the maximum level the enchantment can be.
      Returns:
      The maximum level of the enchantment
    • getCost

      public double getCost()
      Gets the cost of the enhchantment.
      Returns:
      The cost of the enchantment
    • getCostMultiplier

      public double getCostMultiplier()
      Gets the cost multiplier.
      Returns:
      The cost multiplier
    • getRemovalCost

      public double getRemovalCost()
      Gets the removal cost.
      Returns:
      The removal cost
    • getExtractionCost

      public double getExtractionCost()
      Gets the extraction cost.
      Returns:
      the extraction cost
    • getCanUseOnAnything

      public boolean getCanUseOnAnything()
      Gets wether or not the enchantment can be used on anything.
      Returns:
      If the enchantment can be used on anything
    • getAliases

      public List<String> getAliases()
      Gets a list of aliases for the enchantment, can be empty.
      Returns:
      A list of aliases
    • getCostForLevel

      public Map<Integer,Double> getCostForLevel()
      Gets a map of levels and their costs, can be empty.
      Returns:
      A map of levels and their cost
    • values

      public static List<UberConfiguration.UberRecord> values()
      Gets a list of all available UberRecords
      Returns:
      A list of UberRecords
    • 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.
    • enchantment

      public org.bukkit.enchantments.Enchantment enchantment()
      Returns the value of the enchantment record component.
      Returns:
      the value of the enchantment record component
    • name

      public String name()
      Returns the value of the name record component.
      Returns:
      the value of the name record component
    • display_name

      public String display_name()
      Returns the value of the display_name record component.
      Returns:
      the value of the display_name record component
    • min_level

      public int min_level()
      Returns the value of the min_level record component.
      Returns:
      the value of the min_level record component
    • max_level

      public int max_level()
      Returns the value of the max_level record component.
      Returns:
      the value of the max_level record component
    • cost

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

      public double cost_multiplier()
      Returns the value of the cost_multiplier record component.
      Returns:
      the value of the cost_multiplier record component
    • removal_cost

      public double removal_cost()
      Returns the value of the removal_cost record component.
      Returns:
      the value of the removal_cost record component
    • extraction_cost

      public double extraction_cost()
      Returns the value of the extraction_cost record component.
      Returns:
      the value of the extraction_cost record component
    • can_use_on_anything

      public boolean can_use_on_anything()
      Returns the value of the can_use_on_anything record component.
      Returns:
      the value of the can_use_on_anything record component
    • aliases

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

      public Map<Integer,Double> cost_for_level()
      Returns the value of the cost_for_level record component.
      Returns:
      the value of the cost_for_level record component