| Package | Description |
|---|---|
| com.landawn.abacus.util |
| Modifier and Type | Field and Description |
|---|---|
static u.Nullable<Boolean> |
u.Nullable.FALSE
Presents
Boolean.FALSE. |
static u.Nullable<Boolean> |
u.Nullable.TRUE
Presents
Boolean.TRUE. |
| Modifier and Type | Method and Description |
|---|---|
static <T> u.Nullable<T> |
N.castIfAssignable(Object val,
Class<T> targetType)
Returns an empty
Nullable if val is null while targetType is primitive or can not be assigned to targetType. |
static <T> u.Nullable<T> |
u.Nullable.empty() |
<E extends Exception> |
u.Nullable.filter(Throwables.Predicate<? super T,E> predicate) |
<U,E extends Exception> |
u.Nullable.flatMap(Throwables.Function<? super T,u.Nullable<U>,E> mapper) |
<U,E extends Exception> |
u.Nullable.flatMapIfNotNull(Throwables.Function<? super T,u.Nullable<U>,E> mapper)
Flat map if not null.
|
static <T> u.Nullable<T> |
u.Nullable.from(u.Optional<T> optional) |
static <T> u.Nullable<T> |
Iterators.get(Iterator<? extends T> iter,
long index) |
static <K,V> u.Nullable<V> |
Maps.get(Map<K,? extends V> map,
Object key) |
static <T> u.Nullable<T> |
N.getOnlyElement(Iterable<? extends T> iterable)
Gets the only element.
|
static <T> u.Nullable<T> |
N.getOnlyElement(Iterator<? extends T> iter)
Gets the only element.
|
<E extends Exception> |
u.Nullable.ifNotNull(Throwables.Consumer<? super T,E> action)
If not null.
|
<E extends Exception,E2 extends Exception> |
u.Nullable.ifNotNullOrElse(Throwables.Consumer<? super T,E> action,
Throwables.Runnable<E2> emptyAction)
If not null or else.
|
static <R,E extends Exception> |
N.ifOrEmpty(boolean b,
Throwables.Supplier<R,E> supplier)
Returns a
Nullable with value got from the specified supplier if b is true,
otherwise returns an empty Nullable if b is false. |
static <T,R,E extends Exception> |
N.ifOrEmpty(boolean b,
T init,
Throwables.Function<? super T,R,E> func)
Returns a
Nullable with value returned by func.apply(init) if b is true,
otherwise returns an empty Nullable if b is false. |
<E extends Exception> |
u.Nullable.ifPresent(Throwables.Consumer<? super T,E> action) |
<E extends Exception,E2 extends Exception> |
u.Nullable.ifPresentOrElse(Throwables.Consumer<? super T,E> action,
Throwables.Runnable<E2> emptyAction)
If present or else.
|
static <T extends Comparable<? super T>> |
Iterables.kthLargest(Collection<? extends T> c,
int k)
Returns
Nullable.empty() if the specified Array/Collection is null or empty, or its length/size is less than k. |
static <T> u.Nullable<T> |
Iterables.kthLargest(Collection<? extends T> c,
int k,
Comparator<? super T> cmp)
Returns
Nullable.empty() if the specified Array/Collection is null or empty, or its length/size is less than k. |
static <T extends Comparable<? super T>> |
Iterables.kthLargest(T[] a,
int k)
Returns
Nullable.empty() if the specified Array/Collection is null or empty, or its length/size is less than k. |
static <T> u.Nullable<T> |
Iterables.kthLargest(T[] a,
int k,
Comparator<? super T> cmp)
Returns
Nullable.empty() if the specified Array/Collection is null or empty, or its length/size is less than k. |
<U,E extends Exception> |
u.Optional.map(Throwables.Function<? super T,? extends U,E> mapper) |
<U,E extends Exception> |
u.Nullable.map(Throwables.Function<? super T,? extends U,E> mapper) |
<T,E extends Exception> |
Joiner.mapIfNotEmpty(Throwables.Function<? super String,T,E> mapper)
Call
mapper only if at least one element/object/entry is appended. |
<U,E extends Exception> |
u.Nullable.mapIfNotNull(Throwables.Function<? super T,? extends U,E> mapper)
Map if not null.
|
<T,E extends Exception> |
u.OptionalBoolean.mapToObj(Throwables.BooleanFunction<T,E> mapper)
Map to obj.
|
<T,E extends Exception> |
u.OptionalByte.mapToObj(Throwables.ByteFunction<T,E> mapper)
Map to obj.
|
<T,E extends Exception> |
u.OptionalChar.mapToObj(Throwables.CharFunction<T,E> mapper)
Map to obj.
|
<T,E extends Exception> |
u.OptionalDouble.mapToObj(Throwables.DoubleFunction<T,E> mapper)
Map to obj.
|
<T,E extends Exception> |
u.OptionalFloat.mapToObj(Throwables.FloatFunction<T,E> mapper)
Map to obj.
|
<T,E extends Exception> |
u.OptionalInt.mapToObj(Throwables.IntFunction<T,E> mapper)
Map to obj.
|
<T,E extends Exception> |
u.OptionalLong.mapToObj(Throwables.LongFunction<T,E> mapper)
Map to obj.
|
<T,E extends Exception> |
u.OptionalShort.mapToObj(Throwables.ShortFunction<T,E> mapper)
Map to obj.
|
static <T extends Comparable<? super T>> |
Iterables.max(Collection<? extends T> c)
Returns
Nullable.empty() if the specified Array/Collection is null or empty. |
static <T> u.Nullable<T> |
Iterables.max(Collection<? extends T> c,
Comparator<? super T> cmp)
Returns
Nullable.empty() if the specified Array/Collection is null or empty. |
static <T extends Comparable<? super T>> |
Iterables.max(Iterator<? extends T> iter)
Returns
Nullable.empty() if the specified Array/Collection is null or empty. |
static <T> u.Nullable<T> |
Iterables.max(Iterator<? extends T> iter,
Comparator<? super T> cmp)
Returns
Nullable.empty() if the specified Array/Collection is null or empty. |
static <T extends Comparable<? super T>> |
Iterables.max(T[] a)
Returns
Nullable.empty() if the specified Array/Collection is null or empty. |
static <T> u.Nullable<T> |
Iterables.max(T[] a,
Comparator<? super T> cmp)
Returns
Nullable.empty() if the specified Array/Collection is null or empty. |
static <T> u.Nullable<T> |
Iterables.maxBy(Collection<? extends T> c,
Function<? super T,? extends Comparable> keyMapper)
Returns
Nullable.empty() if the specified Array/Collection is null or empty. |
static <T> u.Nullable<T> |
Iterables.maxBy(Iterator<? extends T> iter,
Function<? super T,? extends Comparable> keyMapper)
Returns
Nullable.empty() if the specified Array/Collection is null or empty. |
static <T> u.Nullable<T> |
Iterables.maxBy(T[] a,
Function<? super T,? extends Comparable> keyMapper)
Returns
Nullable.empty() if the specified Array/Collection is null or empty. |
static <T extends Comparable<? super T>> |
Iterables.median(Collection<? extends T> c)
Returns
Nullable.empty() if the specified Array/Collection is null or empty. |
static <T> u.Nullable<T> |
Iterables.median(Collection<? extends T> c,
Comparator<? super T> cmp)
Returns
Nullable.empty() if the specified Array/Collection is null or empty. |
static <T extends Comparable<? super T>> |
Iterables.median(T[] a)
Returns
Nullable.empty() if the specified Array/Collection is null or empty. |
static <T> u.Nullable<T> |
Iterables.median(T[] a,
Comparator<? super T> cmp)
Returns
Nullable.empty() if the specified Array/Collection is null or empty. |
static <T> u.Nullable<T> |
Iterables.medianBy(Collection<? extends T> c,
Function<? super T,? extends Comparable> keyMapper)
Returns
Nullable.empty() if the specified Array/Collection is null or empty. |
static <T> u.Nullable<T> |
Iterables.medianBy(T[] a,
Function<? super T,? extends Comparable> keyMapper)
Returns
Nullable.empty() if the specified Array/Collection is null or empty. |
static <T extends Comparable<? super T>> |
Iterables.min(Collection<? extends T> c)
Returns
Nullable.empty() if the specified Array/Collection is null or empty. |
static <T> u.Nullable<T> |
Iterables.min(Collection<? extends T> c,
Comparator<? super T> cmp)
Returns
Nullable.empty() if the specified Array/Collection is null or empty. |
static <T extends Comparable<? super T>> |
Iterables.min(Iterator<? extends T> iter)
Returns
Nullable.empty() if the specified Array/Collection is null or empty. |
static <T> u.Nullable<T> |
Iterables.min(Iterator<? extends T> iter,
Comparator<? super T> cmp)
Returns
Nullable.empty() if the specified Array/Collection is null or empty. |
static <T extends Comparable<? super T>> |
Iterables.min(T[] a)
Returns
Nullable.empty() if the specified Array/Collection is null or empty. |
static <T> u.Nullable<T> |
Iterables.min(T[] a,
Comparator<? super T> cmp)
Returns
Nullable.empty() if the specified Array/Collection is null or empty. |
static <T> u.Nullable<T> |
Iterables.minBy(Collection<? extends T> c,
Function<? super T,? extends Comparable> keyMapper)
Returns
Nullable.empty() if the specified Array/Collection is null or empty. |
static <T> u.Nullable<T> |
Iterables.minBy(Iterator<? extends T> iter,
Function<? super T,? extends Comparable> keyMapper)
Returns
Nullable.empty() if the specified Array/Collection is null or empty. |
static <T> u.Nullable<T> |
Iterables.minBy(T[] a,
Function<? super T,? extends Comparable> keyMapper)
Returns
Nullable.empty() if the specified Array/Collection is null or empty. |
static u.Nullable<String> |
u.Nullable.of(String value) |
static <T> u.Nullable<T> |
u.Nullable.of(T value) |
<E extends Exception> |
u.Nullable.or(Throwables.Supplier<u.Nullable<? extends T>,E> supplier) |
<E extends Exception> |
u.Nullable.orIfNull(Throwables.Supplier<u.Nullable<? extends T>,E> supplier)
Or if null.
|
static <R> u.Nullable<R> |
N.tryOrEmpty(Callable<R> cmd)
Returns a
Nullable with the value returned by action or an empty Nullable if exception happens. |
static <T,R,E extends Exception> |
N.tryOrEmpty(T init,
Throwables.Function<? super T,R,E> func)
Returns a
Nullable with the value returned by func.apply(init) or an empty Nullable if exception happens. |
| Modifier and Type | Method and Description |
|---|---|
static <K,V> Map<K,Pair<V,u.Nullable<V>>> |
Maps.difference(Map<K,V> map,
Map<K,V> map2) |
static <K,V> Map<K,Pair<u.Nullable<V>,u.Nullable<V>>> |
Maps.symmetricDifference(Map<K,V> map,
Map<K,V> map2) |
static <K,V> Map<K,Pair<u.Nullable<V>,u.Nullable<V>>> |
Maps.symmetricDifference(Map<K,V> map,
Map<K,V> map2) |
| Modifier and Type | Method and Description |
|---|---|
<U,E extends Exception> |
u.Nullable.flatMap(Throwables.Function<? super T,u.Nullable<U>,E> mapper) |
<U,E extends Exception> |
u.Nullable.flatMapIfNotNull(Throwables.Function<? super T,u.Nullable<U>,E> mapper)
Flat map if not null.
|
<E extends Exception> |
u.Nullable.or(Throwables.Supplier<u.Nullable<? extends T>,E> supplier) |
<E extends Exception> |
u.Nullable.orIfNull(Throwables.Supplier<u.Nullable<? extends T>,E> supplier)
Or if null.
|
Copyright © 2021. All rights reserved.