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 Link icon

    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 Link icon

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

    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 Link icon

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

    • cap Link icon

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

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

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

    • StoredCap Link icon

      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 Link icon

    • toString Link icon

      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 Link icon

      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 Link icon

      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 Link icon

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

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

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