Enum FormatType
- java.lang.Object
-
- java.lang.Enum<FormatType>
-
- com.google.common.flogger.backend.FormatType
-
- All Implemented Interfaces:
Serializable,Comparable<FormatType>
public enum FormatType extends Enum<FormatType>
The general formatting type of any one of the predefinedFormatCharinstances.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description BOOLEANFormatting that can be applied to any boolean type.CHARACTERFormatting that can be applied to Character or any integral type that can be losslessly converted to an int and for whichCharacter.isValidCodePoint(int)returns true.FLOATFormatting that can be applied to any Number type.GENERALGeneral formatting that can be applied to any type.INTEGRALFormatting that can be applied to any integral Number type.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract booleancanFormat(Object arg)booleanisNumeric()True if this format type requires aNumberinstance (or one of the corresponding fundamental types) as an argument.static FormatTypevalueOf(String name)Returns the enum constant of this type with the specified name.static FormatType[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
GENERAL
public static final FormatType GENERAL
General formatting that can be applied to any type.
-
BOOLEAN
public static final FormatType BOOLEAN
Formatting that can be applied to any boolean type.
-
CHARACTER
public static final FormatType CHARACTER
Formatting that can be applied to Character or any integral type that can be losslessly converted to an int and for whichCharacter.isValidCodePoint(int)returns true.
-
INTEGRAL
public static final FormatType INTEGRAL
Formatting that can be applied to any integral Number type. Logging backends must support Byte, Short, Integer, Long and BigInteger but may also support additional numeric types directly. A logging backend that encounters an unknown numeric type should fall back to usingtoString().
-
FLOAT
public static final FormatType FLOAT
Formatting that can be applied to any Number type. Logging backends must support all the integral types as well as Float, Double and BigDecimal, but may also support additional numeric types directly. A logging backend that encounters an unknown numeric type should fall back to usingtoString().
-
-
Method Detail
-
values
public static FormatType[] 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 (FormatType c : FormatType.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static FormatType 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
-
isNumeric
public boolean isNumeric()
True if this format type requires aNumberinstance (or one of the corresponding fundamental types) as an argument.
-
canFormat
public abstract boolean canFormat(Object arg)
-
-