public class Sugar extends Object
| Constructor and Description |
|---|
Sugar() |
| Modifier and Type | Method and Description |
|---|---|
static <T> T |
cast(Object x)
Casts an object by type inference.
|
<T> T |
fallback(T val,
T fallback)
Returns the given value, or the fallback if the value is null.
|
static <T> Predicate<T> |
not(Predicate<T> t)
Negates the given Predicate
|
static <T> Optional<T> |
optional(T value)
Shortens the Optional.ofNullable(..) syntax.
|
public static <T> Optional<T> optional(T value)
public <T> T fallback(T val,
T fallback)
Copyright © 2017. All rights reserved.