Record Class MD5
java.lang.Object
java.lang.Record
dev.latvian.mods.klib.util.MD5
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbyte[]bytes()Returns the value of thebytesrecord component.booleanIndicates whether some other object is "equal to" this one.static MD5fromBytes(byte[] bytes) static MD5fromString(String string) inthash()Returns the value of thehashrecord component.inthashCode()Returns a hash code value for this object.booleanisEmpty()static MD5of(FileInfo fileInfo, @Nullable LongConsumer callback) static MD5of(Path file, @Nullable LongConsumer callback) static MD5string()Returns the value of thestringrecord component.@NotNull StringtoString()Returns a string representation of this record class.voidwrite(DataOutput data)
-
Field Details
-
NIL
-
CODEC
-
STREAM_CODEC
public static final net.minecraft.network.codec.StreamCodec<io.netty.buffer.ByteBuf, MD5> STREAM_CODEC -
DATA_TYPE
-
-
Constructor Details
-
MD5
Creates an instance of aMD5record class.- Parameters:
bytes- the value for thebytesrecord componentstring- the value for thestringrecord componenthash- the value for thehashrecord component
-
-
Method Details
-
fromBytes
-
fromString
-
read
- Throws:
IOException
-
of
- Throws:
IOException
-
of
public static MD5 of(FileInfo fileInfo, @Nullable @Nullable LongConsumer callback) throws IOException - Throws:
IOException
-
toString
-
hashCode
-
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 thecomparemethod from their corresponding wrapper classes. -
isEmpty
public boolean isEmpty() -
write
- Throws:
IOException
-
bytes
public byte[] bytes()Returns the value of thebytesrecord component.- Returns:
- the value of the
bytesrecord component
-
string
Returns the value of thestringrecord component.- Returns:
- the value of the
stringrecord component
-
hash
public int hash()Returns the value of thehashrecord component.- Returns:
- the value of the
hashrecord component
-