com.softicar.platform.common.string.regex.PatternFinderResult Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of platform-common Show documentation
Show all versions of platform-common Show documentation
The SoftiCAR Platform is a lightweight, Java-based library to create interactive business web applications.
package com.softicar.platform.common.string.regex;
/**
* Represents the result of a {@link PatternFinder} method.
*
* @author Alexander Schmidt
*/
public class PatternFinderResult {
private final String matchingText;
private final int offset;
PatternFinderResult(String matchingText, Integer offset) {
this.matchingText = matchingText;
this.offset = offset;
}
/**
* Returns the index of the occurrence of the pattern, or {@code -1} if no
* match was found.
*
* @return the pattern index, or {@code -1} if not found
*/
public int getOffset() {
return offset;
}
/**
* Returns the {@link String} against which the pattern matched, or
* null if no match was found.
*
* @return the {@link String} that matched the pattern, or null if
* not found
*/
public String getMatchingText() {
return matchingText;
}
}