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 BOOLEAN
A boolean conversion 'c' or 'C'.DATE_TIME
A date or time conversion 't' or 'T'.DECIMAL
A decimal conversion 'f'.DECIMAL_INTEGER
A decimal integer conversion 'd'.HEX
A hexadecimal conversion 'h' or 'H'.HEX_FLOATING_POINT
A hexadecimal floating point number 'a' or 'A'.HEX_INTEGER
A hexadecimal integer conversion 'x' or 'X'.LINE_SEPARATOR
A line separator conversion 'n'.OCTAL_INTEGER
An octal integer conversion 'o'.PERCENT
A percentage conversion '%'.SCIENTIFIC_NOTATION
A scientific notation conversion 'e' or 'E'.SCIENTIFIC_NOTATION_OR_DECIMAL
A scientific notation or decimal 'g' or 'G'STRING
A string conversion 's' or 'S'.UNICODE_CHAR
A unicode conversion 'c' or 'C'.
-
Field Summary
Fields Modifier and Type Field Description private char
conversion
(package private) boolean
ignoreCase
-
Constructor Summary
Constructors Modifier Constructor Description private
Conversion(char conversion, boolean ignoreCase)
Private enum conversion.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description char
asChar()
Returns the conversion character.java.lang.String
asString()
Returns the conversion character as aString
static StringFormatPart.Conversion
fromChar(char c)
Converts the character into a conversion descriptor.boolean
isCharacter()
If the conversion is a charactertrue
is returned, otherwisefalse
.boolean
isDateTime()
If the conversion is a date or timetrue
is returned, otherwisefalse
.boolean
isFloatingPoint()
If the conversion is a floating pointtrue
is returned, otherwisefalse
.boolean
isGeneral()
If the conversion is a general conversiontrue
is returned, otherwisefalse
.boolean
isIntegral()
If the conversion is an integraltrue
is returned, otherwisefalse
.boolean
isLineSeparator()
If the conversion is a line separatortrue
is returned, otherwisefalse
.boolean
isPercent()
If the conversion is a percenttrue
is returned, otherwisefalse
.java.lang.String
toString()
static StringFormatPart.Conversion
valueOf(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 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
public java.lang.String asString()
Returns the conversion character as aString
- Returns:
- the conversion character.
-
toString
public java.lang.String toString()
- Overrides:
toString
in 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.
-
-