public class Objects extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
Objects.size |
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 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)
Copyright © 2016. All rights reserved.