Enum StringFormatPart.Conversion
- java.lang.Object
-
- java.lang.Enum<StringFormatPart.Conversion>
-
- org.jboss.logging.processor.validation.StringFormatPart.Conversion
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Comparable<StringFormatPart.Conversion>
- Enclosing class:
- StringFormatPart
public static enum StringFormatPart.Conversion extends java.lang.Enum<StringFormatPart.Conversion>
The conversions for the string format.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description BOOLEANA boolean conversion 'c' or 'C'.DATE_TIMEA date or time conversion 't' or 'T'.DECIMALA decimal conversion 'f'.DECIMAL_INTEGERA decimal integer conversion 'd'.HEXA hexadecimal conversion 'h' or 'H'.HEX_FLOATING_POINTA hexadecimal floating point number 'a' or 'A'.HEX_INTEGERA hexadecimal integer conversion 'x' or 'X'.LINE_SEPARATORA line separator conversion 'n'.OCTAL_INTEGERAn octal integer conversion 'o'.PERCENTA percentage conversion '%'.SCIENTIFIC_NOTATIONA scientific notation conversion 'e' or 'E'.SCIENTIFIC_NOTATION_OR_DECIMALA scientific notation or decimal 'g' or 'G'STRINGA string conversion 's' or 'S'.UNICODE_CHARA unicode conversion 'c' or 'C'.
-
Field Summary
Fields Modifier and Type Field Description private charconversion(package private) booleanignoreCase
-
Constructor Summary
Constructors Modifier Constructor Description privateConversion(char conversion, boolean ignoreCase)Private enum conversion.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description charasChar()Returns the conversion character.java.lang.StringasString()Returns the conversion character as aStringstatic StringFormatPart.ConversionfromChar(char c)Converts the character into a conversion descriptor.booleanisCharacter()If the conversion is a charactertrueis returned, otherwisefalse.booleanisDateTime()If the conversion is a date or timetrueis returned, otherwisefalse.booleanisFloatingPoint()If the conversion is a floating pointtrueis returned, otherwisefalse.booleanisGeneral()If the conversion is a general conversiontrueis returned, otherwisefalse.booleanisIntegral()If the conversion is an integraltrueis returned, otherwisefalse.booleanisLineSeparator()If the conversion is a line separatortrueis returned, otherwisefalse.booleanisPercent()If the conversion is a percenttrueis returned, otherwisefalse.java.lang.StringtoString()static StringFormatPart.ConversionvalueOf(java.lang.String name)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 Detail
-
BOOLEAN
public static final StringFormatPart.Conversion BOOLEAN
A boolean conversion 'c' or 'C'.
-
HEX
public static final StringFormatPart.Conversion HEX
A hexadecimal conversion 'h' or 'H'.
-
STRING
public static final StringFormatPart.Conversion STRING
A string conversion 's' or 'S'.
-
UNICODE_CHAR
public static final StringFormatPart.Conversion UNICODE_CHAR
A unicode conversion 'c' or 'C'.
-
DECIMAL_INTEGER
public static final StringFormatPart.Conversion DECIMAL_INTEGER
A decimal integer conversion 'd'.
-
OCTAL_INTEGER
public static final StringFormatPart.Conversion OCTAL_INTEGER
An octal integer conversion 'o'.
-
HEX_INTEGER
public static final StringFormatPart.Conversion HEX_INTEGER
A hexadecimal integer conversion 'x' or 'X'.
-
SCIENTIFIC_NOTATION
public static final StringFormatPart.Conversion SCIENTIFIC_NOTATION
A scientific notation conversion 'e' or 'E'.
-
DECIMAL
public static final StringFormatPart.Conversion DECIMAL
A decimal conversion 'f'.
-
SCIENTIFIC_NOTATION_OR_DECIMAL
public static final StringFormatPart.Conversion SCIENTIFIC_NOTATION_OR_DECIMAL
A scientific notation or decimal 'g' or 'G'
-
HEX_FLOATING_POINT
public static final StringFormatPart.Conversion HEX_FLOATING_POINT
A hexadecimal floating point number 'a' or 'A'.
-
DATE_TIME
public static final StringFormatPart.Conversion DATE_TIME
A date or time conversion 't' or 'T'.
-
PERCENT
public static final StringFormatPart.Conversion PERCENT
A percentage conversion '%'.
-
LINE_SEPARATOR
public static final StringFormatPart.Conversion LINE_SEPARATOR
A line separator conversion 'n'.
-
-
Method Detail
-
values
public static StringFormatPart.Conversion[] 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 (StringFormatPart.Conversion c : StringFormatPart.Conversion.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static StringFormatPart.Conversion valueOf(java.lang.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:
java.lang.IllegalArgumentException- if this enum type has no constant with the specified namejava.lang.NullPointerException- 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
public java.lang.String asString()
Returns the conversion character as aString- Returns:
- the conversion character.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Enum<StringFormatPart.Conversion>
-
fromChar
public static StringFormatPart.Conversion fromChar(char c) throws java.util.UnknownFormatConversionException
Converts the character into a conversion descriptor.- Parameters:
c- the character to convert.- Returns:
- the conversion descriptor.
- Throws:
java.util.UnknownFormatConversionException- if the character is not a valid conversion format.
-
-