All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.softicar.platform.common.string.regex.PatternFinderResult Maven / Gradle / Ivy

Go to download

The SoftiCAR Platform is a lightweight, Java-based library to create interactive business web applications.

There is a newer version: 50.0.0
Show newest version
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;
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy