Class TrimInteger
Object
com.owenfeehan.pathpatternfinder.trim.TrimInteger
- All Implemented Interfaces:
TrimOperation<String>
public class TrimInteger extends Object implements TrimOperation<String>
Reads an integer from the left-side of the string (greedy, it grabs an integer of maximally
possible length).
Only succeeds if every string has an integer at the left, otherwise returns Optional.empty()
.
- Author:
- Owen Feehan
-
Constructor Summary
Constructors Constructor Description TrimInteger(UnresolvedPatternElementFactory factory)
Creates given a factory for creating unresolved pattern-elements. -
Method Summary
-
Constructor Details
-
TrimInteger
Creates given a factory for creating unresolved pattern-elements.- Parameters:
factory
- the factory
-
-
Method Details
-
trim
Description copied from interface:TrimOperation
Attempts to trim the list of objects by finding aPattern
.- Specified by:
trim
in interfaceTrimOperation<String>
- 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
-