From 62794e8e59bd0bd38f08162acecf4366ed622253 Mon Sep 17 00:00:00 2001 From: Robert von Burg Date: Thu, 1 Sep 2016 08:54:41 +0200 Subject: [PATCH] [Minor] Added some JavaDoc --- .../li/strolch/utils/StringMatchMode.java | 24 +++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/li.strolch.utils/src/main/java/li/strolch/utils/StringMatchMode.java b/li.strolch.utils/src/main/java/li/strolch/utils/StringMatchMode.java index a58bd7226..dc7d6294b 100644 --- a/li.strolch.utils/src/main/java/li/strolch/utils/StringMatchMode.java +++ b/li.strolch.utils/src/main/java/li/strolch/utils/StringMatchMode.java @@ -18,6 +18,9 @@ package li.strolch.utils; 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 */ public enum StringMatchMode { @@ -29,25 +32,42 @@ public enum StringMatchMode { private final boolean equals; 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) { this.equals = equals; this.caseSensitve = caseSensitive; } /** - * @return the caseSensitve + * @return true if should be a case insensitive match */ public boolean isCaseSensitve() { return this.caseSensitve; } /** - * @return the equals + * @return true if should be matched for entire string */ public boolean isEquals() { return this.equals; } + /** + * Returns true if value2 matches value1. I.e. for contains value2 must be + * contained in value1 + * + * @param value1 + * the value to be matched against + * @param value2 + * the value to match with the first value + * + * @return if value2 matches value1 according to the current settings + */ public boolean matches(String value1, String value2) { DBC.PRE.assertNotNull("value1 must be set!", value1); //$NON-NLS-1$ DBC.PRE.assertNotNull("value2 must be set!", value2); //$NON-NLS-1$