Record Class MegaEvolution
java.lang.Object
java.lang.Record
com.pixelmonmod.pixelmon.items.component.MegaEvolution
- Record Components:
validPokemon- List of Pokémon specifications that can undergo this Mega Evolution.formName- The name of the Mega Evolution form.duration- The duration of the Mega Evolution in milliseconds
public record MegaEvolution(List<PokemonSpecification> validPokemon, String formName, long duration)
extends Record
Represents a Mega Evolution that can be applied to a Pokémon.
Contains the valid Pokémon specifications, the form name, and the duration of the Mega Evolution.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionMegaEvolution(List<PokemonSpecification> validPokemon, String formName, long duration) Creates an instance of aMegaEvolutionrecord class. -
Method Summary
Modifier and TypeMethodDescriptionlongduration()Returns the value of thedurationrecord component.long[]final booleanIndicates whether some other object is "equal to" this one.formName()Returns the value of theformNamerecord component.final inthashCode()Returns a hash code value for this object.booleanfinal StringtoString()Returns a string representation of this record class.Returns the value of thevalidPokemonrecord component.
-
Field Details
-
CODEC
-
-
Constructor Details
-
MegaEvolution
Creates an instance of aMegaEvolutionrecord class.- Parameters:
validPokemon- the value for thevalidPokemonrecord componentformName- the value for theformNamerecord componentduration- the value for thedurationrecord component
-
-
Method Details
-
isValid
-
durationAsHoursAndMinutes
public long[] durationAsHoursAndMinutes() -
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 '=='. -
validPokemon
Returns the value of thevalidPokemonrecord component.- Returns:
- the value of the
validPokemonrecord component
-
formName
Returns the value of theformNamerecord component.- Returns:
- the value of the
formNamerecord component
-
duration
public long duration()Returns the value of thedurationrecord component.- Returns:
- the value of the
durationrecord component
-