Package com.jbstrap.ui.converters
Enum Class BooleanConverters
- All Implemented Interfaces:
Converter
,Serializable
,Comparable<BooleanConverters>
,Constable
Boolean converter implementation.
- Since:
- 4.0
- Author:
- JBStrap
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescriptionIf you choose this implementation, boolean values are not converted.If you choose this implementation, boolean values are converted to “true” and “false”.If you choose this implementation, boolean values are converted to 1 and 0.If you choose this implementation, boolean values are converted to “Y” and “N”. -
Method Summary
Modifier and TypeMethodDescriptiontoDatabase
(Object value) Converts a boolean value.Reconverts any value to a boolean value.static BooleanConverters
Returns the enum constant of this class with the specified name.static BooleanConverters[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
YES_NO
If you choose this implementation, boolean values are converted to “Y” and “N”. A “Y” corresponds totrue
and an “N” tofalse
. In case of a reverse conversion, a “Y” value is the equivalent oftrue
and all other values are equal tofalse
. -
NUMBER
If you choose this implementation, boolean values are converted to 1 and 0. A 1 corresponds totrue
and 0 tofalse
. In case of a reverse conversion, a 1 value is the equivalent oftrue
and all other values are equal tofalse
. -
BOOLEAN
If you choose this implementation, boolean values are not converted. -
BOOLEAN_STRING
If you choose this implementation, boolean values are converted to “true” and “false”. Atrue
corresponds to “true” and afalse
to “false”. In case of a reverse conversion, a “true” value is the equivalent oftrue
and all other values are equal tofalse
.
-
-
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
-
toJava
Reconverts any value to a boolean value. -
toDatabase
Converts a boolean value.- Specified by:
toDatabase
in interfaceConverter
- Parameters:
value
- Boolean value to be converted- Returns:
- Converted value (saved to database)
-