Modifier and Type | Method and Description |
---|---|
static int |
countPresent(com.google.common.base.Optional<?>... optionals) |
static long |
fromAbsentToNegative(com.google.common.base.Optional<Long> optional)
Returns
-1 if optional.isPresent() == false , otherwise returns optional.get() |
static long |
fromAbsentToNegative(com.google.common.base.Optional<Long> optional,
long negativeValue)
Returns
negativeValue if optional.isPresent() == false , otherwise returns optional.get() |
static com.google.common.base.Optional<String> |
fromEmptyToNull(String s)
Returns
Optional.absent() if Strings.emptyToNull(s) returns null , otherwise Optional.of(s) |
static com.google.common.base.Optional<Integer> |
fromMissingOrZeroToAbsent(String text) |
static com.google.common.base.Optional<Double> |
fromNegativeToAbsent(double value)
Returns
Optional.absent() if value < 0 , otherwise Optional.of(value) |
static com.google.common.base.Optional<Integer> |
fromNegativeToAbsent(int value)
Returns
Optional.absent() if value < 0 , otherwise Optional.of(value) |
static com.google.common.base.Optional<Long> |
fromNegativeToAbsent(long value)
Returns
Optional.absent() if value < 0 , otherwise Optional.of(value) |
static com.google.common.base.Optional<Long> |
fromNullableDate(Date date)
Returns
Optional.absent() if date == null , otherwise Optional.of(date.getTime()) |
static com.google.common.base.Optional<Integer> |
fromPositiveToPresent(int value)
Returns
Optional.of(value) if value > 0 , otherwise Optional.absent() |
static com.google.common.base.Optional<String> |
fromTrimToNull(String s)
Returns
Optional.absent() if StringUtils.trimToNull(s) returns null , otherwise Optional.of(s) |
static com.google.common.base.Optional<Integer> |
fromZeroToAbsent(int value)
Returns
Optional.absent() if value == 0 , otherwise Optional.of(value) |
static <T> com.google.common.base.Predicate<com.google.common.base.Optional<T>> |
isPresent() |
static com.google.common.base.Optional<Integer> |
optionalInteger(String text) |
static <T> com.google.common.base.Function<com.google.common.base.Optional<T>,T> |
to() |
public static <T> com.google.common.base.Function<com.google.common.base.Optional<T>,T> to()
public static <T> com.google.common.base.Predicate<com.google.common.base.Optional<T>> isPresent()
public static com.google.common.base.Optional<Integer> optionalInteger(String text)
public static com.google.common.base.Optional<Integer> fromMissingOrZeroToAbsent(String text)
public static int countPresent(com.google.common.base.Optional<?>... optionals)
public static long fromAbsentToNegative(com.google.common.base.Optional<Long> optional)
-1
if optional.isPresent() == false
, otherwise returns optional.get()
public static long fromAbsentToNegative(com.google.common.base.Optional<Long> optional, long negativeValue)
negativeValue
if optional.isPresent() == false
, otherwise returns optional.get()
public static com.google.common.base.Optional<Double> fromNegativeToAbsent(double value)
Optional.absent()
if value < 0
, otherwise Optional.of(value)
public static com.google.common.base.Optional<Long> fromNegativeToAbsent(long value)
Optional.absent()
if value < 0
, otherwise Optional.of(value)
public static com.google.common.base.Optional<Integer> fromPositiveToPresent(int value)
Optional.of(value)
if value > 0
, otherwise Optional.absent()
public static com.google.common.base.Optional<Integer> fromZeroToAbsent(int value)
Optional.absent()
if value == 0
, otherwise Optional.of(value)
public static com.google.common.base.Optional<Integer> fromNegativeToAbsent(int value)
Optional.absent()
if value < 0
, otherwise Optional.of(value)
public static com.google.common.base.Optional<Long> fromNullableDate(Date date)
Optional.absent()
if date == null
, otherwise Optional.of(date.getTime())
public static com.google.common.base.Optional<String> fromTrimToNull(String s)
Optional.absent()
if StringUtils.trimToNull(s)
returns null
, otherwise Optional.of(s)
public static com.google.common.base.Optional<String> fromEmptyToNull(String s)
Optional.absent()
if Strings.emptyToNull(s)
returns null
, otherwise Optional.of(s)
Copyright © 2015 The Kuali Foundation. All rights reserved.