Package org.apache.commons.vfs2.util
Enum RandomAccessMode
- All Implemented Interfaces:
Serializable,Comparable<RandomAccessMode>
An enumerated type representing the modes of a random access content.
TODO Replace with AccessMode.
-
Enum Constant Summary
Enum Constants -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final AccessMode[]private static final AccessMode[]private final booleanprivate final boolean -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic RandomAccessModefrom(AccessMode... accessModes) Converts an array ofAccessModeinto a RandomAccessMode.booleanTests the read flag.booleanTests the write flag.Converts this instance to an array ofAccessMode.static RandomAccessModeReturns the enum constant of this type with the specified name.static RandomAccessMode[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
READ
Read access mode. -
READWRITE
Read-write access mode.
-
-
Field Details
-
ACCESS_MODE_READ
-
ACCESS_MODE_READ_WRITE
-
read
private final boolean read -
write
private final boolean write
-
-
Constructor Details
-
RandomAccessMode
private RandomAccessMode(boolean read, boolean write)
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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 type has no constant with the specified nameNullPointerException- if the argument is null
-
from
Converts an array ofAccessModeinto a RandomAccessMode.- Parameters:
accessModes- AccessMode array, onlyAccessMode.READandAccessMode.WRITEare supported.- Returns:
- A RandomAccessMode.
- Since:
- 2.10.0
-
getModeString
-
requestRead
public boolean requestRead()Tests the read flag.- Returns:
- true for read.
-
requestWrite
public boolean requestWrite()Tests the write flag.- Returns:
- true for write.
-
toAccessModes
Converts this instance to an array ofAccessMode.- Returns:
- an array of
AccessMode. - Since:
- 2.10.0
-