public class ValueHelper
extends java.lang.Object
Objects.| Constructor and Description |
|---|
ValueHelper() |
| Modifier and Type | Method and Description |
|---|---|
static java.lang.Number |
add(java.lang.Object lhs,
java.lang.Object rhs)
Adds the two values together.
|
static java.lang.Number |
divide(java.lang.Object lhs,
java.lang.Object rhs)
Divides the left hand side by the right hand side, and returns the result.
|
static boolean |
isTrue(java.lang.Object value)
Does the given value represent "true".
|
static java.util.List<java.lang.Object> |
iterate(java.lang.Object iterable)
Convert the given value to a list of object, as if it were an iterable.
|
static java.lang.Number |
multiply(java.lang.Object lhs,
java.lang.Object rhs)
Multiplies the left hand side by the right hand side, and returns the result.
|
static java.lang.Number |
negate(java.lang.Object value)
Returns the "negative" of the given value.
|
static java.lang.Number |
toNumber(java.lang.Object value)
Converts the given value to a
Number. |
public static boolean isTrue(java.lang.Object value)
throws CarrotException
value - The value to test.CarrotException - When the value cannot be determined to be true or false.public static java.lang.Number negate(java.lang.Object value)
throws CarrotException
value - The value to negate.CarrotException - Thrown if the value can't be converted to a number.public static java.lang.Number toNumber(java.lang.Object value)
throws CarrotException
Number.value - The value to convert.Number that the value represents.CarrotException - Thrown if the value can't be converted to a number.public static java.lang.Number add(java.lang.Object lhs,
java.lang.Object rhs)
throws CarrotException
lhs - The left-hand side to add.rhs - The right-hand side to add.CarrotException - Thrown is either of the values can't be converted to a number.public static java.lang.Number divide(java.lang.Object lhs,
java.lang.Object rhs)
throws CarrotException
lhs - The left hand side of the division.rhs - The right hand side of the division.CarrotException - Thrown is either of the values cannot be converted to a number.public static java.lang.Number multiply(java.lang.Object lhs,
java.lang.Object rhs)
throws CarrotException
lhs - The left hand side of the multiplication.rhs - The right hand side of the multiplication.CarrotException - Thrown is either of the values cannot be converted to a number.public static java.util.List<java.lang.Object> iterate(java.lang.Object iterable)
throws CarrotException
ArrayList.iterable - The value to "iterate".List that can actually be iterated.CarrotException - If the value is not iterable.