Enum Class UnixFSChecksumAlgorithm
java.lang.Object
java.lang.Enum<UnixFSChecksumAlgorithm>
dev.getelements.elements.rt.transact.unix.UnixFSChecksumAlgorithm
- All Implemented Interfaces:
Serializable
,Comparable<UnixFSChecksumAlgorithm>
,Constable
Which checksum algorithm to use when committing the transaction.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static interface
static interface
Defines a Checksum-able type which is backed by aSeekableByteChannel
or subclass.static interface
Defines a Checksum-ableStruct
type.Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionlong
compute
(UnixFSChecksumAlgorithm.ChannelCheckable checkable) Computes the checksum and then returns the value.void
compute
(UnixFSChecksumAlgorithm.Checkable checkable) Computes the checksum and then sets theUnixFSChecksumAlgorithm.Checkable.checksum()
value.boolean
isValid
(long value, UnixFSChecksumAlgorithm.ChannelCheckable checkable) Checks if this the suppliedUnixFSChecksumAlgorithm.ChannelCheckable
is valid.boolean
isValid
(UnixFSChecksumAlgorithm.Checkable checkable) Checks if this the suppliedUnixFSChecksumAlgorithm.Checkable
is valid.protected abstract UnixFSChecksumAlgorithm.Algorithm
static UnixFSChecksumAlgorithm
Returns the enum constant of this class with the specified name.static UnixFSChecksumAlgorithm[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is null
-
isValid
Checks if this the suppliedUnixFSChecksumAlgorithm.Checkable
is valid.- Parameters:
checkable
-- Returns:
- true if valid, false otherwise
-
isValid
public boolean isValid(long value, UnixFSChecksumAlgorithm.ChannelCheckable checkable) throws IOException Checks if this the suppliedUnixFSChecksumAlgorithm.ChannelCheckable
is valid.- Parameters:
checkable
-- Returns:
- true if valid, false otherwise
- Throws:
IOException
-
newAlgorithm
-
compute
Computes the checksum and then sets theUnixFSChecksumAlgorithm.Checkable.checksum()
value. This will compute the checksum for theUnixFSChecksumAlgorithm.Checkable
from the current bytebuffer position the buffer's current limit. It will then write the value to the struct member and to the bytebuffer.- Parameters:
checkable
- the structure to compute
-
compute
Computes the checksum and then returns the value. This checks the entire contents of the channel from the current position to the ending position.- Parameters:
checkable
- the structure to compute- Throws:
IOException
-