Record Class GeyserChargeableImpl

java.lang.Object
java.lang.Record
org.geysermc.geyser.item.custom.impl.GeyserChargeableImpl
All Implemented Interfaces:
org.geysermc.geyser.api.item.custom.v2.component.geyser.GeyserChargeable

public record GeyserChargeableImpl(@org.checkerframework.checker.index.qual.NonNegative float maxDrawDuration, boolean chargeOnDraw, @NonNull List<@NonNull org.geysermc.geyser.api.util.Identifier> ammunition) extends Record implements org.geysermc.geyser.api.item.custom.v2.component.geyser.GeyserChargeable
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    GeyserChargeableImpl(@org.checkerframework.checker.index.qual.NonNegative float maxDrawDuration, boolean chargeOnDraw, @NonNull List<@NonNull org.geysermc.geyser.api.util.Identifier> ammunition)
    Creates an instance of a GeyserChargeableImpl record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    @NonNull List<@NonNull org.geysermc.geyser.api.util.Identifier>
    Returns the value of the ammunition record component.
    boolean
    Returns the value of the chargeOnDraw record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    @org.checkerframework.checker.index.qual.NonNegative float
    Returns the value of the maxDrawDuration record component.
    final String
    Returns a string representation of this record class.

    Methods inherited from class java.lang.Object

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

    • GeyserChargeableImpl

      public GeyserChargeableImpl(@org.checkerframework.checker.index.qual.NonNegative float maxDrawDuration, boolean chargeOnDraw, @NonNull List<@NonNull org.geysermc.geyser.api.util.Identifier> ammunition)
      Creates an instance of a GeyserChargeableImpl record class.
      Parameters:
      maxDrawDuration - the value for the maxDrawDuration record component
      chargeOnDraw - the value for the chargeOnDraw record component
      ammunition - the value for the ammunition 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. 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.
    • maxDrawDuration

      public @org.checkerframework.checker.index.qual.NonNegative float maxDrawDuration()
      Returns the value of the maxDrawDuration record component.
      Specified by:
      maxDrawDuration in interface org.geysermc.geyser.api.item.custom.v2.component.geyser.GeyserChargeable
      Returns:
      the value of the maxDrawDuration record component
    • chargeOnDraw

      public boolean chargeOnDraw()
      Returns the value of the chargeOnDraw record component.
      Specified by:
      chargeOnDraw in interface org.geysermc.geyser.api.item.custom.v2.component.geyser.GeyserChargeable
      Returns:
      the value of the chargeOnDraw record component
    • ammunition

      public @NonNull List<@NonNull org.geysermc.geyser.api.util.Identifier> ammunition()
      Returns the value of the ammunition record component.
      Specified by:
      ammunition in interface org.geysermc.geyser.api.item.custom.v2.component.geyser.GeyserChargeable
      Returns:
      the value of the ammunition record component