Class FunctionBlockMatcher<T>

java.lang.Object
org.xwiki.rendering.block.match.FunctionBlockMatcher<T>
Type Parameters:
T - the type of searched value
All Implemented Interfaces:
BlockMatcher

@Unstable public class FunctionBlockMatcher<T> extends Object implements BlockMatcher
Search for a specific value in a Block.
Since:
15.9RC1
Version:
$Id: 4bdbd32908c6c68cf84594f32ad5252d44417066 $
  • Constructor Details

    • FunctionBlockMatcher

      public FunctionBlockMatcher(Function<Block,Optional<T>> function)
      Parameters:
      function - the function in charger of searching of the value in the Block
  • Method Details

    • match

      public boolean match(Block block)
      Description copied from interface: BlockMatcher
      True if the provided block is matched.
      Specified by:
      match in interface BlockMatcher
      Parameters:
      block - the block to match
      Returns:
      true if the provided block is matched, false otherwise
    • getValue

      public Optional<T> getValue()
      Returns:
      the found value