Package org.patternfly.style
Class BreakpointCollector<V>
java.lang.Object
org.patternfly.style.BreakpointCollector<V>
- Type Parameters:
V
- the type of the values to be collected
- All Implemented Interfaces:
Collector<Tuple<Breakpoint,
V>, StringBuilder, String>
public class BreakpointCollector<V>
extends Object
implements Collector<Tuple<Breakpoint,V>,StringBuilder,String>
The
BreakpointCollector
collects tuples of Breakpoint
and a generic value V
as CSS modifier classes
and returns the collected data as a String
. See Breakpoints
for details how the CSS modifier classes are
built.
The joining methods accept a string function that can be used to further modify the value. See the examples below for details.
// pf-m-foo pf-m-bar-on-lg
breakpoints(default_, "foo", lg, "bar")
.stream().collect(modifiers());
// pf-m-prefix-foo pf-m-prefix-bar-on-lg
breakpoints(default_, "foo", lg, "bar")
.stream().collect(modifiers(v -> "prefix-" + v));
// pf-m-a pf-m-b-on-sm-height pf-m-c-on-md-height pf-m-d-on-lg-height pf-m-e-on-xl-height pf-m-f-on-2xl-height
breakpoints(
default_, "a",
sm, "b",
md, "c",
lg, "d",
xl, "e",
_2xl, "f")
.stream().collect(verticalModifiers());
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface java.util.stream.Collector
Collector.Characteristics
-
Method Summary
Modifier and TypeMethodDescriptioncombiner()
finisher()
static <V> Collector
<Tuple<Breakpoint, V>, StringBuilder, String> Returns a collector that accumulatesTuple<Breakpoint, V>
objects into aStringBuilder
and produces aString
representation of the accumulated modifiers.static <V> Collector
<Tuple<Breakpoint, V>, StringBuilder, String> Returns a collector that accumulatesTuple<Breakpoint, V>
objects into aStringBuilder
and produces aString
representation of the accumulated modifiers.supplier()
static <V> Collector
<Tuple<Breakpoint, V>, StringBuilder, String> Returns a collector that accumulatesTuple<Breakpoint, V>
objects into aStringBuilder
and produces aString
representation of the accumulated vertical modifiers.static <V> Collector
<Tuple<Breakpoint, V>, StringBuilder, String> verticalModifiers
(Function<V, String> stringValue) Returns a collector that accumulatesTuple<Breakpoint, V>
objects into aStringBuilder
and produces aString
representation of the accumulated vertical modifiers.
-
Method Details
-
modifiers
Returns a collector that accumulatesTuple<Breakpoint, V>
objects into aStringBuilder
and produces aString
representation of the accumulated modifiers.- Type Parameters:
V
- the type of the value in theTuple
-
modifiers
public static <V> Collector<Tuple<Breakpoint,V>, modifiersStringBuilder, String> (Function<V, String> stringValue) Returns a collector that accumulatesTuple<Breakpoint, V>
objects into aStringBuilder
and produces aString
representation of the accumulated modifiers.- Type Parameters:
V
- the type of the value in theTuple
- Parameters:
stringValue
- a function that converts the value of theTuple
to aString
-
verticalModifiers
Returns a collector that accumulatesTuple<Breakpoint, V>
objects into aStringBuilder
and produces aString
representation of the accumulated vertical modifiers.- Type Parameters:
V
- the type of the value in theTuple
-
verticalModifiers
public static <V> Collector<Tuple<Breakpoint,V>, verticalModifiersStringBuilder, String> (Function<V, String> stringValue) Returns a collector that accumulatesTuple<Breakpoint, V>
objects into aStringBuilder
and produces aString
representation of the accumulated vertical modifiers.- Type Parameters:
V
- the type of the value in theTuple
- Parameters:
stringValue
- a function that converts the value of theTuple
to aString
-
supplier
- Specified by:
supplier
in interfaceCollector<Tuple<Breakpoint,
V>, StringBuilder, String>
-
accumulator
- Specified by:
accumulator
in interfaceCollector<Tuple<Breakpoint,
V>, StringBuilder, String>
-
combiner
- Specified by:
combiner
in interfaceCollector<Tuple<Breakpoint,
V>, StringBuilder, String>
-
finisher
- Specified by:
finisher
in interfaceCollector<Tuple<Breakpoint,
V>, StringBuilder, String>
-
characteristics
- Specified by:
characteristics
in interfaceCollector<Tuple<Breakpoint,
V>, StringBuilder, String>
-