Class TrimOperationOrList<T>

Object
com.owenfeehan.pathpatternfinder.trim.TrimOperationOrList<T>
Type Parameters:
T - type of objects the trimmer works upon
All Implemented Interfaces:
TrimOperation<T>

public class TrimOperationOrList<T>
extends Object
implements TrimOperation<T>
Tries to apply each operation in a list until one is successful.
Author:
Owen Feehan
  • Constructor Details

  • Method Details

    • trim

      public Optional<Pattern> trim​(List<T> source)
      Description copied from interface: TrimOperation
      Attempts to trim the list of objects by finding a Pattern.
      Specified by:
      trim in interface TrimOperation<T>
      Parameters:
      source - list of objects
      Returns:
      if successful, a pattern with the trimmed elements (and what remains to be resolved) as elements, otherwise Optional.empty() if unsuccessful