Record Class BlueprintImage

java.lang.Object
java.lang.Record
kr.toxicity.model.api.data.blueprint.BlueprintImage
Record Components:
name - the name of the image file (including extension)
image - the binary content of the image
mcmeta - the JSON object for the .mcmeta file, if any

public record BlueprintImage(@NotNull String name, byte[] image, @Nullable com.google.gson.JsonObject mcmeta) extends Record
Represents an image file to be generated as part of the resource pack.

This record holds the image's name, its binary content, and an optional .mcmeta file for animations.

Since:
1.15.2
  • Constructor Summary

    Constructors
    Constructor
    Description
    BlueprintImage(@NotNull String name, byte[] image, @Nullable com.google.gson.JsonObject mcmeta)
    Creates an instance of a BlueprintImage record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    final boolean
    Indicates whether some other object is "equal to" this one.
    long
    Returns the estimated size of the image in bytes.
    final int
    Returns a hash code value for this object.
    byte[]
    Returns the value of the image record component.
    @Nullable com.google.gson.JsonObject
    Returns the value of the mcmeta record component.
    @NotNull String
    Returns the name of the metadata file associated with the png.
    @NotNull String
    Returns the value of the name record component.
    @NotNull String
    Returns the name of the image file with a .png extension.
    final String
    Returns a string representation of this record class.

    Methods inherited from class Object

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

    • BlueprintImage

      public BlueprintImage(@NotNull @NotNull String name, byte[] image, @Nullable @Nullable com.google.gson.JsonObject mcmeta)
      Creates an instance of a BlueprintImage record class.
      Parameters:
      name - the value for the name record component
      image - the value for the image record component
      mcmeta - the value for the mcmeta record component
  • Method Details

    • estimatedSize

      public long estimatedSize()
      Returns the estimated size of the image in bytes.
      Returns:
      the image size
      Since:
      1.15.2
    • pngName

      @NotNull public @NotNull String pngName()
      Returns the name of the image file with a .png extension.
      Returns:
      the png file name
      Since:
      2.0.1
    • mcmetaName

      @NotNull public @NotNull String mcmetaName()
      Returns the name of the metadata file associated with the png.
      Returns:
      the mcmeta file name
      Since:
      2.0.1
    • 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.
    • name

      @NotNull public @NotNull String name()
      Returns the value of the name record component.
      Returns:
      the value of the name record component
    • image

      public byte[] image()
      Returns the value of the image record component.
      Returns:
      the value of the image record component
    • mcmeta

      @Nullable public @Nullable com.google.gson.JsonObject mcmeta()
      Returns the value of the mcmeta record component.
      Returns:
      the value of the mcmeta record component