Type Parameters:
V - the element type

public interface StyleClaim<V>
A claim of a single style element.
Since:
4.10.0
  • 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-duplication
      lens - value extractor from a Style instance
      emitable - 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-duplication
      lens - value extractor from a Style instance
      filter - a filter for values, will only receive non-null values
      emitable - 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

      @Nullable Emitable apply(Style style)
      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