Record Class PackResource.Packed

java.lang.Object
java.lang.Record
kr.toxicity.model.api.pack.PackResource.Packed
Record Components:
overlay - the overlay
path - the path
estimatedSize - the estimated size
supplier - the content supplier
All Implemented Interfaces:
Supplier<byte[]>, PackResource
Enclosing interface:
PackResource

public static record PackResource.Packed(@Nullable PackOverlay overlay, @NotNull PackPath path, long estimatedSize, @NotNull Supplier<byte[]> supplier) extends Record implements PackResource
A simple implementation of PackResource.
Since:
1.15.2
  • Constructor Details

    • Packed

      public Packed(@Nullable @Nullable PackOverlay overlay, @NotNull @NotNull PackPath path, long estimatedSize, @NotNull @NotNull Supplier<byte[]> supplier)
      Creates an instance of a Packed record class.
      Parameters:
      overlay - the value for the overlay record component
      path - the value for the path record component
      estimatedSize - the value for the estimatedSize record component
      supplier - the value for the supplier record component
  • Method Details

    • get

      public byte[] get()
      Specified by:
      get in interface Supplier<byte[]>
    • 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 the compare method from their corresponding wrapper classes.
      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.
    • overlay

      @Nullable public @Nullable PackOverlay overlay()
      Returns the value of the overlay record component.
      Specified by:
      overlay in interface PackResource
      Returns:
      the value of the overlay record component
    • path

      @NotNull public @NotNull PackPath path()
      Returns the value of the path record component.
      Specified by:
      path in interface PackResource
      Returns:
      the value of the path record component
    • estimatedSize

      public long estimatedSize()
      Returns the value of the estimatedSize record component.
      Specified by:
      estimatedSize in interface PackResource
      Returns:
      the value of the estimatedSize record component
    • supplier

      @NotNull public @NotNull Supplier<byte[]> supplier()
      Returns the value of the supplier record component.
      Returns:
      the value of the supplier record component