Enum Class NumberFormatStyle
- All Implemented Interfaces:
Serializable,Comparable<NumberFormatStyle>,Constable
Enum que define os estilos de formatação numérica para campos.
Estes estilos determinam como os valores numéricos devem ser apresentados na interface do usuário.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionFormato de moeda.Formato decimal padrão.Sem formatação especial.Formato de percentual.Formato científico (notação exponencial). -
Method Summary
Modifier and TypeMethodDescriptionstatic NumberFormatStyleConverte um valor string para o Enum NumberFormatStyle correspondente.getValue()Obtém o valor string do estilo de formato numérico.static NumberFormatStyleReturns the enum constant of this class with the specified name.static NumberFormatStyle[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
CURRENCY
Formato de moeda. Exemplo: Exibe o valor como "$1,234.56". -
DECIMAL
Formato decimal padrão. Exemplo: Exibe o valor como "1234.56". -
PERCENT
Formato de percentual. Exemplo: Exibe o valor como "12.34%". (Multiplica por 100 e adiciona o símbolo '%') -
SCIENTIFIC
Formato científico (notação exponencial). Exemplo: Exibe o valor como "1.23456E3". -
NONE
Sem formatação especial. Exemplo: Exibe o valor como está, sem separadores, símbolos ou formatação especial.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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 class has no constant with the specified nameNullPointerException- if the argument is null
-
getValue
Obtém o valor string do estilo de formato numérico. Este valor é usado para identificar o estilo de formato em configurações ou APIs.- Returns:
- O valor string do estilo de formato.
-
fromValue
Converte um valor string para o Enum NumberFormatStyle correspondente. A comparação é feita de forma case-insensitive.- Parameters:
value- O valor string a ser convertido (ex: "currency", "decimal").- Returns:
- O Enum NumberFormatStyle correspondente.
- Throws:
IllegalArgumentException- se o valor string não corresponder a nenhum estilo de formato conhecido.
-