Package forestry.api.core.genetics
Record Class ITaxon.TaxonAllele
java.lang.Object
java.lang.Record
forestry.api.core.genetics.ITaxon.TaxonAllele
- Record Components:
allele- The inline value allele for a data chromosome, ornullfor a reference chromosome.reference- The referenced value's ID for a reference chromosome, ornullfor a data chromosome.required- Whether members of the taxon are required to have this chromosome.
- Enclosing interface:
ITaxon
public static record ITaxon.TaxonAllele(@Nullable Allele<?> allele, @Nullable net.minecraft.resources.ResourceLocation reference, boolean required)
extends Record
A default allele associated with a taxon. Exactly one of
allele (a data-chromosome value) or
reference (a reference-chromosome ID, resolved lazily) is non-null.-
Constructor Summary
ConstructorsConstructorDescriptionTaxonAllele(Allele<?> allele, net.minecraft.resources.ResourceLocation reference, boolean required) Creates an instance of aTaxonAllelerecord class. -
Method Summary
Modifier and TypeMethodDescriptionAllele<?> allele()Returns the value of theallelerecord component.static ITaxon.TaxonAllelefinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.net.minecraft.resources.ResourceLocationReturns the value of thereferencerecord component.static ITaxon.TaxonAllelereference(net.minecraft.resources.ResourceLocation id, boolean required) booleanrequired()Returns the value of therequiredrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
TaxonAllele
public TaxonAllele(@Nullable Allele<?> allele, @Nullable net.minecraft.resources.ResourceLocation reference, boolean required) Creates an instance of aTaxonAllelerecord class.
-
-
Method Details
-
data
- Returns:
- A taxon default for a data chromosome.
-
reference
public static ITaxon.TaxonAllele reference(net.minecraft.resources.ResourceLocation id, boolean required) - Returns:
- A taxon default for a reference chromosome (species, flower type, effect, ...).
-
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 '=='. -
allele
Returns the value of theallelerecord component.- Returns:
- the value of the
allelerecord component
-
reference
@Nullable public net.minecraft.resources.ResourceLocation reference()Returns the value of thereferencerecord component.- Returns:
- the value of the
referencerecord component
-
required
public boolean required()Returns the value of therequiredrecord component.- Returns:
- the value of the
requiredrecord component
-