[Minor] Added some JavaDoc
This commit is contained in:
parent
2cbdca3da8
commit
62794e8e59
|
@ -18,6 +18,9 @@ package li.strolch.utils;
|
||||||
import li.strolch.utils.dbc.DBC;
|
import li.strolch.utils.dbc.DBC;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* The {@link StringMatchMode} is used to match String in different scenarios. The strings can be matched case sensitive
|
||||||
|
* or case insensitive as well as using contains or equals.
|
||||||
|
*
|
||||||
* @author Robert von Burg <eitch@eitchnet.ch>
|
* @author Robert von Burg <eitch@eitchnet.ch>
|
||||||
*/
|
*/
|
||||||
public enum StringMatchMode {
|
public enum StringMatchMode {
|
||||||
|
@ -29,25 +32,42 @@ public enum StringMatchMode {
|
||||||
private final boolean equals;
|
private final boolean equals;
|
||||||
private final boolean caseSensitve;
|
private final boolean caseSensitve;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param equals
|
||||||
|
* true if should be matched for entire string
|
||||||
|
* @param caseSensitive
|
||||||
|
* true if should be a case insensitive match
|
||||||
|
*/
|
||||||
private StringMatchMode(boolean equals, boolean caseSensitive) {
|
private StringMatchMode(boolean equals, boolean caseSensitive) {
|
||||||
this.equals = equals;
|
this.equals = equals;
|
||||||
this.caseSensitve = caseSensitive;
|
this.caseSensitve = caseSensitive;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return the caseSensitve
|
* @return true if should be a case insensitive match
|
||||||
*/
|
*/
|
||||||
public boolean isCaseSensitve() {
|
public boolean isCaseSensitve() {
|
||||||
return this.caseSensitve;
|
return this.caseSensitve;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return the equals
|
* @return true if should be matched for entire string
|
||||||
*/
|
*/
|
||||||
public boolean isEquals() {
|
public boolean isEquals() {
|
||||||
return this.equals;
|
return this.equals;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns true if <code>value2</code> matches <code>value1</code>. I.e. for contains <code>value2</code> must be
|
||||||
|
* contained in <code>value1</code>
|
||||||
|
*
|
||||||
|
* @param value1
|
||||||
|
* the value to be matched against
|
||||||
|
* @param value2
|
||||||
|
* the value to match with the first value
|
||||||
|
*
|
||||||
|
* @return if <code>value2</code> matches <code>value1</code> according to the current settings
|
||||||
|
*/
|
||||||
public boolean matches(String value1, String value2) {
|
public boolean matches(String value1, String value2) {
|
||||||
DBC.PRE.assertNotNull("value1 must be set!", value1); //$NON-NLS-1$
|
DBC.PRE.assertNotNull("value1 must be set!", value1); //$NON-NLS-1$
|
||||||
DBC.PRE.assertNotNull("value2 must be set!", value2); //$NON-NLS-1$
|
DBC.PRE.assertNotNull("value2 must be set!", value2); //$NON-NLS-1$
|
||||||
|
|
Loading…
Reference in New Issue