Enum StringFormatPart.Conversion
java.lang.Object
java.lang.Enum<StringFormatPart.Conversion>
org.jboss.logging.processor.validation.StringFormatPart.Conversion
- All Implemented Interfaces:
Serializable
,Comparable<StringFormatPart.Conversion>
,java.lang.constant.Constable
- Enclosing class:
- StringFormatPart
The conversions for the string format.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionA boolean conversion 'c' or 'C'.A date or time conversion 't' or 'T'.A decimal conversion 'f'.A decimal integer conversion 'd'.A hexadecimal conversion 'h' or 'H'.A hexadecimal floating point number 'a' or 'A'.A hexadecimal integer conversion 'x' or 'X'.A line separator conversion 'n'.An octal integer conversion 'o'.A percentage conversion '%'.A scientific notation conversion 'e' or 'E'.A scientific notation or decimal 'g' or 'G'A string conversion 's' or 'S'.A unicode conversion 'c' or 'C'. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final char
(package private) final boolean
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
Conversion
(char conversion, boolean ignoreCase) Private enum conversion. -
Method Summary
Modifier and TypeMethodDescriptionchar
asChar()
Returns the conversion character.asString()
Returns the conversion character as aString
static StringFormatPart.Conversion
fromChar
(char c) Converts the character into a conversion descriptor.boolean
If the conversion is a charactertrue
is returned, otherwisefalse
.boolean
If the conversion is a date or timetrue
is returned, otherwisefalse
.boolean
If the conversion is a floating pointtrue
is returned, otherwisefalse
.boolean
If the conversion is a general conversiontrue
is returned, otherwisefalse
.boolean
If the conversion is an integraltrue
is returned, otherwisefalse
.boolean
If the conversion is a line separatortrue
is returned, otherwisefalse
.boolean
If the conversion is a percenttrue
is returned, otherwisefalse
.toString()
static StringFormatPart.Conversion
Returns the enum constant of this type with the specified name.static StringFormatPart.Conversion[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
BOOLEAN
A boolean conversion 'c' or 'C'. -
HEX
A hexadecimal conversion 'h' or 'H'. -
STRING
A string conversion 's' or 'S'. -
UNICODE_CHAR
A unicode conversion 'c' or 'C'. -
DECIMAL_INTEGER
A decimal integer conversion 'd'. -
OCTAL_INTEGER
An octal integer conversion 'o'. -
HEX_INTEGER
A hexadecimal integer conversion 'x' or 'X'. -
SCIENTIFIC_NOTATION
A scientific notation conversion 'e' or 'E'. -
DECIMAL
A decimal conversion 'f'. -
SCIENTIFIC_NOTATION_OR_DECIMAL
A scientific notation or decimal 'g' or 'G' -
HEX_FLOATING_POINT
A hexadecimal floating point number 'a' or 'A'. -
DATE_TIME
A date or time conversion 't' or 'T'. -
PERCENT
A percentage conversion '%'. -
LINE_SEPARATOR
A line separator conversion 'n'.
-
-
Field Details
-
conversion
private final char conversion -
ignoreCase
final boolean ignoreCase
-
-
Constructor Details
-
Conversion
private Conversion(char conversion, boolean ignoreCase) Private enum conversion.- Parameters:
conversion
- the conversion character.ignoreCase
-true
for the case should be ignored, otherwisefalse
.
-
-
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
-
isGeneral
public boolean isGeneral()If the conversion is a general conversiontrue
is returned, otherwisefalse
.- Returns:
true
if a general conversion, otherwisefalse
.
-
isCharacter
public boolean isCharacter()If the conversion is a charactertrue
is returned, otherwisefalse
.- Returns:
true
if c character, otherwisefalse
.
-
isIntegral
public boolean isIntegral()If the conversion is an integraltrue
is returned, otherwisefalse
.- Returns:
true
if an integral, otherwisefalse
.
-
isFloatingPoint
public boolean isFloatingPoint()If the conversion is a floating pointtrue
is returned, otherwisefalse
.- Returns:
true
if a line separator, otherwisefalse
.
-
isDateTime
public boolean isDateTime()If the conversion is a date or timetrue
is returned, otherwisefalse
.- Returns:
true
if a date or time, otherwisefalse
.
-
isPercent
public boolean isPercent()If the conversion is a percenttrue
is returned, otherwisefalse
.- Returns:
true
if a percent, otherwisefalse
.
-
isLineSeparator
public boolean isLineSeparator()If the conversion is a line separatortrue
is returned, otherwisefalse
.- Returns:
true
if a line separator, otherwisefalse
.
-
asChar
public char asChar()Returns the conversion character.- Returns:
- the conversion character.
-
asString
Returns the conversion character as aString
- Returns:
- the conversion character.
-
toString
- Overrides:
toString
in classEnum<StringFormatPart.Conversion>
-
fromChar
Converts the character into a conversion descriptor.- Parameters:
c
- the character to convert.- Returns:
- the conversion descriptor.
- Throws:
UnknownFormatConversionException
- if the character is not a valid conversion format.
-