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
ConstructorDescriptionUberRecord
(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 aUberRecord
record class. -
Method Summary
Modifier and TypeMethodDescriptionaliases()
Returns the value of thealiases
record component.boolean
Returns the value of thecan_use_on_anything
record component.double
cost()
Returns the value of thecost
record component.Returns the value of thecost_for_level
record component.double
Returns the value of thecost_multiplier
record component.Returns the value of thedisplay_name
record component.org.bukkit.enchantments.Enchantment
Returns the value of theenchantment
record component.final boolean
Indicates whether some other object is "equal to" this one.double
Returns the value of theextraction_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
getCost()
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.getName()
Gets the name of this record.double
Gets the removal cost.final int
hashCode()
Returns a hash code value for this object.int
Returns the value of themax_level
record component.int
Returns the value of themin_level
record component.name()
Returns the value of thename
record component.double
Returns the value of theremoval_cost
record component.final String
toString()
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 aUberRecord
record class.- Parameters:
enchantment
- the value for theenchantment
record componentname
- the value for thename
record componentdisplay_name
- the value for thedisplay_name
record componentmin_level
- the value for themin_level
record componentmax_level
- the value for themax_level
record componentcost
- the value for thecost
record componentcost_multiplier
- the value for thecost_multiplier
record componentremoval_cost
- the value for theremoval_cost
record componentextraction_cost
- the value for theextraction_cost
record componentcan_use_on_anything
- the value for thecan_use_on_anything
record componentaliases
- the value for thealiases
record componentcost_for_level
- the value for thecost_for_level
record 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 theenchantment
record component.- Returns:
- the value of the
enchantment
record component
-
name
Returns the value of thename
record component.- Returns:
- the value of the
name
record component
-
display_name
Returns the value of thedisplay_name
record component.- Returns:
- the value of the
display_name
record component
-
min_level
public int min_level()Returns the value of themin_level
record component.- Returns:
- the value of the
min_level
record component
-
max_level
public int max_level()Returns the value of themax_level
record component.- Returns:
- the value of the
max_level
record component
-
cost
public double cost()Returns the value of thecost
record component.- Returns:
- the value of the
cost
record component
-
cost_multiplier
public double cost_multiplier()Returns the value of thecost_multiplier
record component.- Returns:
- the value of the
cost_multiplier
record component
-
removal_cost
public double removal_cost()Returns the value of theremoval_cost
record component.- Returns:
- the value of the
removal_cost
record component
-
extraction_cost
public double extraction_cost()Returns the value of theextraction_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 thecan_use_on_anything
record component.- Returns:
- the value of the
can_use_on_anything
record component
-
aliases
Returns the value of thealiases
record component.- Returns:
- the value of the
aliases
record component
-
cost_for_level
Returns the value of thecost_for_level
record component.- Returns:
- the value of the
cost_for_level
record component
-