Package org.rypt.f8
Enum Validity
- java.lang.Object
-
- java.lang.Enum<Validity>
-
- org.rypt.f8.Validity
-
- All Implemented Interfaces:
Serializable,Comparable<Validity>
public enum Validity extends Enum<Validity>
This class encapsulates the possible UTF-8 validities of a sequence of bytes
-
-
Enum Constant Summary
Enum Constants Enum Constant Description ASCIIPure ASCIIMALFORMEDMalformed UTF-8UNDERFLOW_R0Valid UTF-8 that is not necessarily truncated and that is not pure ASCIIUNDERFLOW_R1Valid UTF-8 that is truncated after the first byte in a multi-byte sequenceUNDERFLOW_R2Valid UTF-8 that is truncated after the second byte in a multi-byte sequenceUNDERFLOW_R3Valid UTF-8 that is truncated after the third byte in a multi-byte sequence
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanisFullyValid()booleanisValidOrTruncated()static ValidityvalueOf(String name)Returns the enum constant of this type with the specified name.static Validity[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
ASCII
public static final Validity ASCII
Pure ASCII
-
UNDERFLOW_R0
public static final Validity UNDERFLOW_R0
Valid UTF-8 that is not necessarily truncated and that is not pure ASCII
-
UNDERFLOW_R1
public static final Validity UNDERFLOW_R1
Valid UTF-8 that is truncated after the first byte in a multi-byte sequence
-
UNDERFLOW_R2
public static final Validity UNDERFLOW_R2
Valid UTF-8 that is truncated after the second byte in a multi-byte sequence
-
UNDERFLOW_R3
public static final Validity UNDERFLOW_R3
Valid UTF-8 that is truncated after the third byte in a multi-byte sequence
-
MALFORMED
public static final Validity MALFORMED
Malformed UTF-8
-
-
Method Detail
-
values
public static Validity[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (Validity c : Validity.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static Validity valueOf(String name)
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
-
isFullyValid
public boolean isFullyValid()
-
isValidOrTruncated
public boolean isValidOrTruncated()
-
-