public class Objects extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
Objects.recursivelySquashNulls |
static class |
Objects.size
Size is a special snowflake and needs specific care
|
static class |
Objects.squashDuplicates |
static class |
Objects.squashNulls |
static class |
Objects.toBoolean |
static class |
Objects.toDouble |
static class |
Objects.toInteger |
static class |
Objects.toLong |
static class |
Objects.toString |
| Constructor and Description |
|---|
Objects() |
| Modifier and Type | Method and Description |
|---|---|
static void |
recursivelySquashNulls(Object input)
Recursively squash nulls in maps and lists.
|
static Optional<Object> |
squashDuplicates(Object input)
Squashes/Deletes duplicates in lists.
|
static void |
squashNulls(Object input)
Squashes nulls in a list or map.
|
static Optional<Boolean> |
toBoolean(Object arg)
Returns boolean value of argument, if possible, wrapped in Optional
Interprets Strings "true" & "false" as boolean
|
static Optional<Double> |
toDouble(Object arg)
Returns double value of argument, if possible, wrapped in Optional
Interprets String as Number
|
static Optional<Integer> |
toInteger(Object arg)
Returns int value of argument, if possible, wrapped in Optional
Interprets String as Number
|
static Optional<Long> |
toLong(Object arg)
Returns long value of argument, if possible, wrapped in Optional
Interprets String as Number
|
static Optional<? extends Number> |
toNumber(Object arg)
Given any object, returns, if possible.
|
static Optional<String> |
toString(Object arg)
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()
|
public static Optional<? extends Number> toNumber(Object arg)
public static Optional<Integer> toInteger(Object arg)
public static Optional<Long> toLong(Object arg)
public static Optional<Double> toDouble(Object arg)
public static Optional<Boolean> toBoolean(Object arg)
public static Optional<String> toString(Object arg)
public static void squashNulls(Object input)
public static void recursivelySquashNulls(Object input)
Copyright © 2023. All rights reserved.