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
  • 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 a SimpleResearch record class.
      Parameters:
      researchIcon - the value for the researchIcon record component
      researchMethod - the value for the researchMethod record component
      researchEffect - the value for the researchEffect record component
      parents - the value for the parents record component
      requiresParent - the value for the requiresParent record component
      literalName - the value for the literalName record component
      literalDescription - the value for the literalDescription record component
  • Method Details

    • getSerializer

      public ResearchSerializer<?> getSerializer()
      Specified by:
      getSerializer in interface Research
      Returns:
      serializer providing typed codecs for the Research
    • equals

      public boolean equals(Object o)
      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 with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • builder

      public static SimpleResearch.Builder builder()
    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • researchIcon

      public ItemResearchIcon researchIcon()
      Returns the value of the researchIcon record component.
      Specified by:
      researchIcon in interface Research
      Returns:
      the value of the researchIcon record component
    • researchMethod

      public ResearchMethod researchMethod()
      Returns the value of the researchMethod record component.
      Specified by:
      researchMethod in interface Research
      Returns:
      the value of the researchMethod record component
    • researchEffect

      public ResearchEffect researchEffect()
      Returns the value of the researchEffect record component.
      Specified by:
      researchEffect in interface Research
      Returns:
      the value of the researchEffect record component
    • parents

      public List<net.minecraft.resources.ResourceKey<Research>> parents()
      Returns the value of the parents record component.
      Specified by:
      parents in interface Research
      Returns:
      the value of the parents record component
    • requiresParent

      public boolean requiresParent()
      Returns the value of the requiresParent record component.
      Specified by:
      requiresParent in interface Research
      Returns:
      the value of the requiresParent record component
    • literalName

      public Optional<String> literalName()
      Returns the value of the literalName record component.
      Returns:
      the value of the literalName record component
    • literalDescription

      public Optional<String> literalDescription()
      Returns the value of the literalDescription record component.
      Returns:
      the value of the literalDescription record component