Record Class ItemVariant

java.lang.Object
java.lang.Record
dev.aurelium.slate.item.ItemVariant

public record ItemVariant(@NonNull Map<String,Object> propertyFilters, @Nullable org.bukkit.inventory.ItemStack baseItem, @Nullable List<SlotPos> positions, @Nullable String displayName, @NonNull List<LoreLine> lore) extends Record
  • Constructor Summary

    Constructors
    Constructor
    Description
    ItemVariant(@NonNull Map<String,Object> propertyFilters, @Nullable org.bukkit.inventory.ItemStack baseItem, @Nullable List<SlotPos> positions, @Nullable String displayName, @NonNull List<LoreLine> lore)
    Creates an instance of a ItemVariant record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    @Nullable org.bukkit.inventory.ItemStack
    Returns the value of the baseItem record component.
    @Nullable String
    Returns the value of the displayName record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    @NonNull List<LoreLine>
    Returns the value of the lore record component.
    @Nullable List<SlotPos>
    Returns the value of the positions record component.
    @NonNull Map<String,Object>
    Returns the value of the propertyFilters 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

    • ItemVariant

      public ItemVariant(@NonNull Map<String,Object> propertyFilters, @Nullable org.bukkit.inventory.ItemStack baseItem, @Nullable List<SlotPos> positions, @Nullable String displayName, @NonNull List<LoreLine> lore)
      Creates an instance of a ItemVariant record class.
      Parameters:
      propertyFilters - the value for the propertyFilters record component
      baseItem - the value for the baseItem record component
      positions - the value for the positions record component
      displayName - the value for the displayName record component
      lore - the value for the lore 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.
    • propertyFilters

      public @NonNull Map<String,Object> propertyFilters()
      Returns the value of the propertyFilters record component.
      Returns:
      the value of the propertyFilters record component
    • baseItem

      public @Nullable org.bukkit.inventory.ItemStack baseItem()
      Returns the value of the baseItem record component.
      Returns:
      the value of the baseItem record component
    • positions

      public @Nullable List<SlotPos> positions()
      Returns the value of the positions record component.
      Returns:
      the value of the positions record component
    • displayName

      public @Nullable String displayName()
      Returns the value of the displayName record component.
      Returns:
      the value of the displayName record component
    • lore

      public @NonNull List<LoreLine> lore()
      Returns the value of the lore record component.
      Returns:
      the value of the lore record component