Package fr.ghostrider584.axiom.util
Record Class CompressedBlockEntity
java.lang.Object
java.lang.Record
fr.ghostrider584.axiom.util.CompressedBlockEntity
public record CompressedBlockEntity(int originalSize, byte compressionDict, byte[] compressedBytes)
extends Record
-
Constructor Summary
ConstructorsConstructorDescriptionCompressedBlockEntity(int originalSize, byte compressionDict, byte[] compressedBytes) Creates an instance of aCompressedBlockEntityrecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic CompressedBlockEntitycompress(net.kyori.adventure.nbt.CompoundBinaryTag tag) byte[]Returns the value of thecompressedBytesrecord component.byteReturns the value of thecompressionDictrecord component.static net.kyori.adventure.nbt.CompoundBinaryTagdecompress(CompressedBlockEntity compressed) final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.intReturns the value of theoriginalSizerecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
CompressedBlockEntity
public CompressedBlockEntity(int originalSize, byte compressionDict, byte[] compressedBytes) Creates an instance of aCompressedBlockEntityrecord class.- Parameters:
originalSize- the value for theoriginalSizerecord componentcompressionDict- the value for thecompressionDictrecord componentcompressedBytes- the value for thecompressedBytesrecord component
-
-
Method Details
-
decompress
public static net.kyori.adventure.nbt.CompoundBinaryTag decompress(CompressedBlockEntity compressed) throws IOException - Throws:
IOException
-
compress
public static CompressedBlockEntity compress(net.kyori.adventure.nbt.CompoundBinaryTag tag) throws IOException - Throws:
IOException
-
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. -
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. -
equals
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 withObjects::equals(Object,Object); primitive components are compared with '=='. -
originalSize
public int originalSize()Returns the value of theoriginalSizerecord component.- Returns:
- the value of the
originalSizerecord component
-
compressionDict
public byte compressionDict()Returns the value of thecompressionDictrecord component.- Returns:
- the value of the
compressionDictrecord component
-
compressedBytes
public byte[] compressedBytes()Returns the value of thecompressedBytesrecord component.- Returns:
- the value of the
compressedBytesrecord component
-