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>
- Enclosing class:
StringFormatPart
The conversions for the string format.
-
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
ConstructorsModifierConstructorDescriptionprivateConversion(char conversion, boolean ignoreCase) Private enum conversion. -
Method Summary
Modifier and TypeMethodDescriptioncharasChar()Returns the conversion character.asString()Returns the conversion character as aStringstatic StringFormatPart.ConversionfromChar(char c) Converts the character into a conversion descriptor.booleanIf the conversion is a charactertrueis returned, otherwisefalse.booleanIf the conversion is a date or timetrueis returned, otherwisefalse.booleanIf the conversion is a floating pointtrueis returned, otherwisefalse.booleanIf the conversion is a general conversiontrueis returned, otherwisefalse.booleanIf the conversion is an integraltrueis returned, otherwisefalse.booleanIf the conversion is a line separatortrueis returned, otherwisefalse.booleanIf the conversion is a percenttrueis returned, otherwisefalse.toString()static StringFormatPart.ConversionReturns 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-truefor 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 conversiontrueis returned, otherwisefalse.- Returns:
trueif a general conversion, otherwisefalse.
-
isCharacter
public boolean isCharacter()If the conversion is a charactertrueis returned, otherwisefalse.- Returns:
trueif c character, otherwisefalse.
-
isIntegral
public boolean isIntegral()If the conversion is an integraltrueis returned, otherwisefalse.- Returns:
trueif an integral, otherwisefalse.
-
isFloatingPoint
public boolean isFloatingPoint()If the conversion is a floating pointtrueis returned, otherwisefalse.- Returns:
trueif a line separator, otherwisefalse.
-
isDateTime
public boolean isDateTime()If the conversion is a date or timetrueis returned, otherwisefalse.- Returns:
trueif a date or time, otherwisefalse.
-
isPercent
public boolean isPercent()If the conversion is a percenttrueis returned, otherwisefalse.- Returns:
trueif a percent, otherwisefalse.
-
isLineSeparator
public boolean isLineSeparator()If the conversion is a line separatortrueis returned, otherwisefalse.- Returns:
trueif 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:
toStringin 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.
-