Class Objects
java.lang.Object
com.bazaarvoice.jolt.modifier.function.Objects
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final class
static final class
Size is a special snowflake and needs specific carestatic final class
static final class
static final class
static final class
static final class
static final class
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
recursivelySquashNulls
(Object input) Recursively squash nulls in maps and lists.static void
squashNulls
(Object input) Squashes nulls in a list or map.Returns boolean value of argument, if possible, wrapped in Optional Interprets Strings "true" invalid input: '&' "false" as booleanReturns double value of argument, if possible, wrapped in Optional Interprets String as NumberReturns int value of argument, if possible, wrapped in Optional Interprets String as NumberReturns long value of argument, if possible, wrapped in Optional Interprets String as NumberGiven any object, returns, if possible.Returns String representation of argument, wrapped in Optional for array argument, returns Arrays.toString() for others, returns Objects.toString() Note: this method does not return Optional.empty()
-
Constructor Details
-
Objects
public Objects()
-
-
Method Details
-
toNumber
Given any object, returns, if possible. its Java number equivalent wrapped in Optional Interprets String as Number toNumber("123") == Optional.of(123) toNumber("-123") == Optional.of(-123) toNumber("12.3") == Optional.of(12.3) toNumber("abc") == Optional.empty() toNumber(null) == Optional.empty() also, see: MathTest#testNitPicks -
toInteger
Returns int value of argument, if possible, wrapped in Optional Interprets String as Number -
toLong
Returns long value of argument, if possible, wrapped in Optional Interprets String as Number -
toDouble
Returns double value of argument, if possible, wrapped in Optional Interprets String as Number -
toBoolean
Returns boolean value of argument, if possible, wrapped in Optional Interprets Strings "true" invalid input: '&' "false" as boolean -
toString
Returns String representation of argument, wrapped in Optional for array argument, returns Arrays.toString() for others, returns Objects.toString() Note: this method does not return Optional.empty() -
squashNulls
Squashes nulls in a list or map. Modifies the data. -
recursivelySquashNulls
Recursively squash nulls in maps and lists. Modifies the data.
-