L - type of the left element.public static class ComparablePair.Builder<L> extends Object
pattern builder intended to be used
to create ComparablePairs with custom combination of
comparable and non comparable values.| Modifier | Constructor and Description |
|---|---|
protected |
Builder(L left,
Comparator<L> leftComparator)
Constructor with parameters.
|
| Modifier and Type | Method and Description |
|---|---|
<R extends Comparable<R>> |
andRight(R value)
Creates a new
ComparablePair with
the given right value. |
<R extends Comparable<R>> |
andRight(R value,
boolean nullLast)
Creates a new
ComparablePair with
the given right values. |
<R> ComparablePair<L,R> |
andRight(R value,
Comparator<R> comparator)
Creates a new
ComparablePair with
the given right values. |
protected Builder(L left, Comparator<L> leftComparator)
This constructor is intended to be used internaly of by extending classes.
left - the left element of the pair.leftComparator - the Comparator for the left element.public <R extends Comparable<R>> ComparablePair<L,R> andRight(R value)
ComparablePair with
the given right value.
This implementation considers null to be
less than non-null. Using this method is
the same as invoking
Builder.right(value,false).
R - type of the right element.value - the right element of the pair.public <R extends Comparable<R>> ComparablePair<L,R> andRight(R value, boolean nullLast)
ComparablePair with
the given right values.R - type of the right element.value - the right element of the pair.nullLast - tells to consider null to be greater than non-null.public <R> ComparablePair<L,R> andRight(R value, Comparator<R> comparator)
ComparablePair with
the given right values.R - type of the right element.value - the right element of the pair.comparator - comparator for values of type <R>.Copyright © 2011–2020 Nerd4j. All rights reserved.