Record Class SimpleResearch
java.lang.Object
java.lang.Record
com.portingdeadmods.researchd.impl.research.SimpleResearch
- All Implemented Interfaces:
Research
public record SimpleResearch(ItemResearchIcon researchIcon, ResearchMethod researchMethod, ResearchEffect researchEffect, List<net.minecraft.resources.ResourceKey<Research>> parents, boolean requiresParent, Optional<String> literalName, Optional<String> literalDescription)
extends Record
implements Research
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic class -
Field Summary
Fields inherited from interface com.portingdeadmods.researchd.api.research.Research
CODEC, RESOURCE_KEY_CODEC, RESOURCE_KEY_STREAM_CODEC, STREAM_CODEC -
Constructor Summary
ConstructorsConstructorDescriptionSimpleResearch(ItemResearchIcon researchIcon, ResearchMethod researchMethod, ResearchEffect researchEffect, List<net.minecraft.resources.ResourceKey<Research>> parents, boolean requiresParent, Optional<String> literalName, Optional<String> literalDescription) Creates an instance of aSimpleResearchrecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic SimpleResearch.Builderbuilder()booleanIndicates whether some other object is "equal to" this one.inthashCode()Returns a hash code value for this object.Returns the value of theliteralDescriptionrecord component.Returns the value of theliteralNamerecord component.parents()Returns the value of theparentsrecord component.booleanReturns the value of therequiresParentrecord component.Returns the value of theresearchEffectrecord component.Returns the value of theresearchIconrecord component.Returns the value of theresearchMethodrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
SimpleResearch
public SimpleResearch(ItemResearchIcon researchIcon, ResearchMethod researchMethod, ResearchEffect researchEffect, List<net.minecraft.resources.ResourceKey<Research>> parents, boolean requiresParent, Optional<String> literalName, Optional<String> literalDescription) Creates an instance of aSimpleResearchrecord class.- Parameters:
researchIcon- the value for theresearchIconrecord componentresearchMethod- the value for theresearchMethodrecord componentresearchEffect- the value for theresearchEffectrecord componentparents- the value for theparentsrecord componentrequiresParent- the value for therequiresParentrecord componentliteralName- the value for theliteralNamerecord componentliteralDescription- the value for theliteralDescriptionrecord component
-
-
Method Details
-
getSerializer
- Specified by:
getSerializerin interfaceResearch- Returns:
- serializer providing typed codecs for the Research
-
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 '=='. -
hashCode
public int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
builder
-
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. -
researchIcon
Returns the value of theresearchIconrecord component.- Specified by:
researchIconin interfaceResearch- Returns:
- the value of the
researchIconrecord component
-
researchMethod
Returns the value of theresearchMethodrecord component.- Specified by:
researchMethodin interfaceResearch- Returns:
- the value of the
researchMethodrecord component
-
researchEffect
Returns the value of theresearchEffectrecord component.- Specified by:
researchEffectin interfaceResearch- Returns:
- the value of the
researchEffectrecord component
-
parents
Returns the value of theparentsrecord component. -
requiresParent
public boolean requiresParent()Returns the value of therequiresParentrecord component.- Specified by:
requiresParentin interfaceResearch- Returns:
- the value of the
requiresParentrecord component
-
literalName
Returns the value of theliteralNamerecord component.- Returns:
- the value of the
literalNamerecord component
-
literalDescription
Returns the value of theliteralDescriptionrecord component.- Returns:
- the value of the
literalDescriptionrecord component
-