Interface StyleClaim<V>
- Type Parameters:
V- the element type
public interface StyleClaim<V>
A claim of a single style element.
- Since:
- 4.10.0
-
Method Summary
Modifier and TypeMethodDescription@Nullable EmitablePrepare an emitable to apply this claim based on the style.static <T> StyleClaim<T> claim(String claimKey, Function<Style, @Nullable T> lens, BiConsumer<T, TokenEmitter> emitable) Create a new style claim that will emit content for any non-null value.static <T> StyleClaim<T> claim(String claimKey, Function<Style, @Nullable T> lens, Predicate<T> filter, BiConsumer<T, TokenEmitter> emitable) Create a new style claim that will emit content for any non-null value that passes the filter.claimKey()The key identifying this style element.
-
Method Details
-
claim
static <T> StyleClaim<T> claim(String claimKey, Function<Style, @Nullable T> lens, BiConsumer<T, TokenEmitter> emitable) Create a new style claim that will emit content for any non-null value.- Type Parameters:
T- the value type- Parameters:
claimKey- claim key for de-duplicationlens- value extractor from aStyleinstanceemitable- the function that handles emitting- Returns:
- a new claim
- Since:
- 4.10.0
-
claim
static <T> StyleClaim<T> claim(String claimKey, Function<Style, @Nullable T> lens, Predicate<T> filter, BiConsumer<T, TokenEmitter> emitable) Create a new style claim that will emit content for any non-null value that passes the filter.- Type Parameters:
T- the value type- Parameters:
claimKey- claim key for de-duplicationlens- value extractor from aStyleinstancefilter- a filter for values, will only receive non-null valuesemitable- the function that handles emitting- Returns:
- a new claim
- Since:
- 4.10.0
-
claimKey
String claimKey()The key identifying this style element.- Returns:
- the key to claim
- Since:
- 4.10.0
-
apply
Prepare an emitable to apply this claim based on the style.- Parameters:
style- the style to test- Returns:
- an emitable for this style claim, if it is applicable to the provided style
- Since:
- 4.10.0
-