Package de.uplanet.lucy.server.ixvalue
Class IxBooleanValue
- java.lang.Object
-
- de.uplanet.lucy.server.ixvalue.AbstractIxValue
-
- de.uplanet.lucy.server.ixvalue.IxBooleanValue
-
- All Implemented Interfaces:
IIxValue
public final class IxBooleanValue extends AbstractIxValue
-
-
Field Summary
Fields Modifier and Type Field Description static IxBooleanValue
EMPTY_BOOL
static IxBooleanValue
FALSE
static IxBooleanValue
TRUE
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description BigDecimal
asBigDecimal()
Returns a big decimal value.boolean
asBoolean()
Returns the a boolean value.double
asDouble()
Returns a double value.int
asInt()
Returns a integer value.long
asLong()
Returns a long value.IValueHolder<?>
asValueHolder()
Returns the value as an value holder.Boolean
getValue()
Returns the physical value.boolean
isPrimitive()
Returnstrue
on a primitive value type like integer or boolean.static IxBooleanValue
valueOf(boolean p_bValue)
static IxBooleanValue
valueOf(Boolean p_bValue)
-
Methods inherited from class de.uplanet.lucy.server.ixvalue.AbstractIxValue
asBigDecimal, asBoolean, asDate, asDate, asDouble, asInt, asLong, asString, asString, asTime, asTime, asTimestamp, asTimestamp, getType, hasValue
-
-
-
-
Field Detail
-
FALSE
public static final IxBooleanValue FALSE
-
TRUE
public static final IxBooleanValue TRUE
-
EMPTY_BOOL
public static final IxBooleanValue EMPTY_BOOL
-
-
Method Detail
-
valueOf
public static IxBooleanValue valueOf(boolean p_bValue)
-
valueOf
public static IxBooleanValue valueOf(Boolean p_bValue)
-
getValue
public Boolean getValue()
Description copied from interface:IIxValue
Returns the physical value. Mostly an string value. For normal use cases, please use theIIxValue.asBigDecimal()
IIxValue.asBigDecimal(BigDecimal)
IIxValue.asBoolean()
IIxValue.asBoolean(boolean)
IIxValue.asDate()
IIxValue.asDate(Date)
IIxValue.asDouble()
IIxValue.asDouble(double)
IIxValue.asInt()
IIxValue.asInt(int)
IIxValue.asLong()
IIxValue.asLong(long)
IIxValue.asString()
IIxValue.asString(String)
IIxValue.asTime()
IIxValue.asTime(Date)
IIxValue.asTimestamp()
IIxValue.asTimestamp(Timestamp)
- Returns:
- Returns the value (could be
null
).
-
asValueHolder
public IValueHolder<?> asValueHolder()
Description copied from interface:IIxValue
Returns the value as an value holder.- Returns:
- Converts a IIxValue to an value holder.
-
asBoolean
public boolean asBoolean()
Description copied from interface:IIxValue
Returns the a boolean value.Cast Rules: String "0" = false "1" = true "true" = true "false" = false all other values
false
Numeric (int, long, double): 0 = false 1 = true other valuestrue
(value != 0)- Returns:
- Returns the value as an boolean.
-
asDouble
public double asDouble()
Description copied from interface:IIxValue
Returns a double value.Cast Rules: String Double.parseDouble(value) Numeric Types (double)value
- Returns:
- Returns the value as an double.
-
asInt
public int asInt()
Description copied from interface:IIxValue
Returns a integer value.Cast Rules: String Integer.parseInteger(value) Numeric Types (int)value
- Returns:
- Returns the value as an integer.
-
asBigDecimal
public BigDecimal asBigDecimal()
Description copied from interface:IIxValue
Returns a big decimal value.Cast Rules: String new BigDecimal(value) Numeric Types new BigDecimalvalue)
- Returns:
- Returns the value as an big decimal or null if
IIxValue.hasValue()
==false
.
-
asLong
public long asLong()
Description copied from interface:IIxValue
Returns a long value.Cast Rules: String Long.parseLong(value) Numeric Types (long)value
- Returns:
- Returns the value as an long.
Throws an exception if
IIxValue.hasValue()
==false
or the value type cannot be casted to an long.
-
isPrimitive
public boolean isPrimitive()
Description copied from interface:IIxValue
Returnstrue
on a primitive value type like integer or boolean.- Returns:
- Returns
true
if the value represent an primitive type like a boolean, integer...
-
-