Class TrimConstantSubstring
Object
com.owenfeehan.pathpatternfinder.trim.constantsubstring.TrimConstantSubstring
- All Implemented Interfaces:
TrimOperation<String>
public class TrimConstantSubstring extends Object implements TrimOperation<String>
Attempts to split a string by finding an identical sub-string in all strings, so long as it is
always located at the same index (relative to left).
- Author:
- Owen Feehan
-
Constructor Summary
Constructors Constructor Description TrimConstantSubstring(UnresolvedPatternElementFactory factory)Constructor -
Method Summary
-
Constructor Details
-
TrimConstantSubstring
Constructor- Parameters:
factory- factory for creating unresolved pattern elements
-
-
Method Details
-
trim
Description copied from interface:TrimOperationAttempts to trim the list of objects by finding aPattern.- Specified by:
trimin 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
-