Record Class CapabilityRegistry.StoredCap<C>

java.lang.Object
java.lang.Record
net.neoforged.neoforge.capabilities.CapabilityRegistry.StoredCap<C>
Enclosing class:
CapabilityRegistry<C>

private static record CapabilityRegistry.StoredCap<C>(C cap, Class<?> typeClass, Class<?> contextClass) extends Record
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final C
    The field for the cap record component.
    private final Class<?>
    The field for the contextClass record component.
    private final Class<?>
    The field for the typeClass record component.
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    private
    StoredCap(C cap, Class<?> typeClass, Class<?> contextClass)
    Creates an instance of a StoredCap record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    cap()
    Returns the value of the cap record component.
    Returns the value of the contextClass record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    final String
    Returns a string representation of this record class.
    Returns the value of the typeClass record component.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • cap

      private final C cap
      The field for the cap record component.
    • typeClass

      private final Class<?> typeClass
      The field for the typeClass record component.
    • contextClass

      private final Class<?> contextClass
      The field for the contextClass record component.
  • Constructor Details

    • StoredCap

      private StoredCap(C cap, Class<?> typeClass, Class<?> contextClass)
      Creates an instance of a StoredCap record class.
      Parameters:
      cap - the value for the cap record component
      typeClass - the value for the typeClass record component
      contextClass - the value for the contextClass record component
  • Method Details

    • 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
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final 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. All components in this record class are compared with Objects::equals(Object,Object).
      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.
    • cap

      public C cap()
      Returns the value of the cap record component.
      Returns:
      the value of the cap record component
    • typeClass

      public Class<?> typeClass()
      Returns the value of the typeClass record component.
      Returns:
      the value of the typeClass record component
    • contextClass

      public Class<?> contextClass()
      Returns the value of the contextClass record component.
      Returns:
      the value of the contextClass record component