Package dev.kitteh.factions.upgrade
Record Class Upgrade.Simple
java.lang.Object
java.lang.Record
dev.kitteh.factions.upgrade.Upgrade.Simple
- Record Components:
name- simple namenameComponent- decorated namedescription- decorated descriptiondetailsFunction- function converting upgrade settings to a decorated detail on a given levelmaxLevel- max level configurablevariables- variables used
- All Implemented Interfaces:
Upgrade
- Enclosing interface:
Upgrade
public static record Upgrade.Simple(String name, net.kyori.adventure.text.Component nameComponent, net.kyori.adventure.text.Component description, BiFunction<UpgradeSettings,Integer,net.kyori.adventure.text.Component> detailsFunction, int maxLevel, Set<UpgradeVariable> variables)
extends Record
implements Upgrade
Optional helper record for creating a non-reactive upgrade.
-
Nested Class Summary
Nested classes/interfaces inherited from interface dev.kitteh.factions.upgrade.Upgrade
Upgrade.Impl, Upgrade.Reactive, Upgrade.ReactiveImpl, Upgrade.Reactor, Upgrade.Simple, Upgrade.SimpleImpl -
Constructor Summary
ConstructorsConstructorDescriptionSimple(String name, net.kyori.adventure.text.Component nameComponent, net.kyori.adventure.text.Component description, BiFunction<UpgradeSettings, Integer, net.kyori.adventure.text.Component> detailsFunction, int maxLevel, Set<UpgradeVariable> variables) Creates an instance of aSimplerecord class. -
Method Summary
Modifier and TypeMethodDescriptionnet.kyori.adventure.text.ComponentReturns the value of thedescriptionrecord component.net.kyori.adventure.text.Componentdetails(UpgradeSettings settings, int level) Gets details about a specific level of the upgrade, using available upgrade settings.BiFunction<UpgradeSettings, Integer, net.kyori.adventure.text.Component> Returns the value of thedetailsFunctionrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.intmaxLevel()Returns the value of themaxLevelrecord component.name()Returns the value of thenamerecord component.net.kyori.adventure.text.ComponentReturns the value of thenameComponentrecord component.final StringtoString()Returns a string representation of this record class.Returns the value of thevariablesrecord component.
-
Constructor Details
-
Simple
public Simple(String name, net.kyori.adventure.text.Component nameComponent, net.kyori.adventure.text.Component description, BiFunction<UpgradeSettings, Integer, net.kyori.adventure.text.Component> detailsFunction, int maxLevel, Set<UpgradeVariable> variables) Creates an instance of aSimplerecord class.- Parameters:
name- the value for thenamerecord componentnameComponent- the value for thenameComponentrecord componentdescription- the value for thedescriptionrecord componentdetailsFunction- the value for thedetailsFunctionrecord componentmaxLevel- the value for themaxLevelrecord componentvariables- the value for thevariablesrecord component
-
-
Method Details
-
details
Description copied from interface:UpgradeGets details about a specific level of the upgrade, using available upgrade settings. -
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 '=='. -
name
Returns the value of thenamerecord component. -
nameComponent
public net.kyori.adventure.text.Component nameComponent()Returns the value of thenameComponentrecord component.- Specified by:
nameComponentin interfaceUpgrade- Returns:
- the value of the
nameComponentrecord component
-
description
public net.kyori.adventure.text.Component description()Returns the value of thedescriptionrecord component.- Specified by:
descriptionin interfaceUpgrade- Returns:
- the value of the
descriptionrecord component
-
detailsFunction
Returns the value of thedetailsFunctionrecord component.- Returns:
- the value of the
detailsFunctionrecord component
-
maxLevel
public int maxLevel()Returns the value of themaxLevelrecord component. -
variables
Returns the value of thevariablesrecord component.
-