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
ConstructorsConstructorDescriptionUberRecord(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 aUberRecordrecord class. -
Method Summary
Modifier and TypeMethodDescriptionaliases()Returns the value of thealiasesrecord component.booleanReturns the value of thecan_use_on_anythingrecord component.doublecost()Returns the value of thecostrecord component.Returns the value of thecost_for_levelrecord component.doubleReturns the value of thecost_multiplierrecord component.Returns the value of thedisplay_namerecord component.org.bukkit.enchantments.EnchantmentReturns the value of theenchantmentrecord component.final booleanIndicates whether some other object is "equal to" this one.doubleReturns the value of theextraction_costrecord component.Gets a list of aliases for the enchantment, can be empty.booleanGets wether or not the enchantment can be used on anything.doublegetCost()Gets the cost of the enhchantment.Gets a map of levels and their costs, can be empty.doubleGets the cost multiplier.Gets the display name of the enchantment this record represents.org.bukkit.enchantments.EnchantmentGets the enchantment associated with this record.doubleGets the extraction cost.intGets the maximum level the enchantment can be.intGets the minimum level the enchantment can be.getName()Gets the name of this record.doubleGets the removal cost.final inthashCode()Returns a hash code value for this object.intReturns the value of themax_levelrecord component.intReturns the value of themin_levelrecord component.name()Returns the value of thenamerecord component.doubleReturns the value of theremoval_costrecord component.final StringtoString()Returns a string representation of this record class.static List<UberConfiguration.UberRecord>values()Gets a list of all available UberRecords
-
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 aUberRecordrecord class.- Parameters:
enchantment- the value for theenchantmentrecord componentname- the value for thenamerecord componentdisplay_name- the value for thedisplay_namerecord componentmin_level- the value for themin_levelrecord componentmax_level- the value for themax_levelrecord componentcost- the value for thecostrecord componentcost_multiplier- the value for thecost_multiplierrecord componentremoval_cost- the value for theremoval_costrecord componentextraction_cost- the value for theextraction_costrecord componentcan_use_on_anything- the value for thecan_use_on_anythingrecord componentaliases- the value for thealiasesrecord componentcost_for_level- the value for thecost_for_levelrecord component
-
-
Method Details
-
getEnchant
public org.bukkit.enchantments.Enchantment getEnchant()Gets the enchantment associated with this record.- Returns:
- The enchantment
-
getName
Gets the name of this record.- Returns:
- The name of the record (Same as enchantment.getKey().getKey())
-
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
Gets a list of aliases for the enchantment, can be empty.- Returns:
- A list of aliases
-
getCostForLevel
Gets a map of levels and their costs, can be empty.- Returns:
- A map of levels and their cost
-
values
Gets a list of all available UberRecords- Returns:
- A list of UberRecords
-
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
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. -
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 '=='. -
enchantment
public org.bukkit.enchantments.Enchantment enchantment()Returns the value of theenchantmentrecord component.- Returns:
- the value of the
enchantmentrecord component
-
name
Returns the value of thenamerecord component.- Returns:
- the value of the
namerecord component
-
display_name
Returns the value of thedisplay_namerecord component.- Returns:
- the value of the
display_namerecord component
-
min_level
public int min_level()Returns the value of themin_levelrecord component.- Returns:
- the value of the
min_levelrecord component
-
max_level
public int max_level()Returns the value of themax_levelrecord component.- Returns:
- the value of the
max_levelrecord component
-
cost
public double cost()Returns the value of thecostrecord component.- Returns:
- the value of the
costrecord component
-
cost_multiplier
public double cost_multiplier()Returns the value of thecost_multiplierrecord component.- Returns:
- the value of the
cost_multiplierrecord component
-
removal_cost
public double removal_cost()Returns the value of theremoval_costrecord component.- Returns:
- the value of the
removal_costrecord component
-
extraction_cost
public double extraction_cost()Returns the value of theextraction_costrecord component.- Returns:
- the value of the
extraction_costrecord component
-
can_use_on_anything
public boolean can_use_on_anything()Returns the value of thecan_use_on_anythingrecord component.- Returns:
- the value of the
can_use_on_anythingrecord component
-
aliases
Returns the value of thealiasesrecord component.- Returns:
- the value of the
aliasesrecord component
-
cost_for_level
Returns the value of thecost_for_levelrecord component.- Returns:
- the value of the
cost_for_levelrecord component
-