mirror of
https://github.com/shekhargulati/strman-java.git
synced 2026-11-03 08:23:55 +00:00
Resolved #49
This commit is contained in:
@@ -488,6 +488,18 @@ public abstract class Strman {
|
|||||||
* @param second The second String
|
* @param second The second String
|
||||||
* @return true if first and second are not equal false otherwise
|
* @return true if first and second are not equal false otherwise
|
||||||
*/
|
*/
|
||||||
|
public static boolean unequal(final String first, final String second) {
|
||||||
|
return !Objects.equals(first, second);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Tests if two Strings are inequal
|
||||||
|
*
|
||||||
|
* @param first The first String
|
||||||
|
* @param second The second String
|
||||||
|
* @return true if first and second are not equal false otherwise
|
||||||
|
* @deprecated use unequal instead
|
||||||
|
*/
|
||||||
public static boolean inequal(final String first, final String second) {
|
public static boolean inequal(final String first, final String second) {
|
||||||
return !Objects.equals(first, second);
|
return !Objects.equals(first, second);
|
||||||
}
|
}
|
||||||
@@ -1043,7 +1055,7 @@ public abstract class Strman {
|
|||||||
* Decamelize String
|
* Decamelize String
|
||||||
*
|
*
|
||||||
* @param value The input String
|
* @param value The input String
|
||||||
* @param chr string to use
|
* @param chr string to use
|
||||||
* @return String decamelized.
|
* @return String decamelized.
|
||||||
*/
|
*/
|
||||||
public static String toDecamelize(final String value, final String chr) {
|
public static String toDecamelize(final String value, final String chr) {
|
||||||
|
|||||||
@@ -819,5 +819,12 @@ public class StrmanTest {
|
|||||||
Arrays.stream(fixture).forEach(el -> assertThat(String.format("toSnakeCase(%s) should be de_camelize", el), toSnakeCase(el), equalTo("de_camelize")));
|
Arrays.stream(fixture).forEach(el -> assertThat(String.format("toSnakeCase(%s) should be de_camelize", el), toSnakeCase(el), equalTo("de_camelize")));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void unequal_shouldTestInequalityOfStrings() throws Exception {
|
||||||
|
assertThat(unequal("a", "b"), equalTo(true));
|
||||||
|
assertThat(unequal("a", "a"), equalTo(false));
|
||||||
|
assertThat(unequal("0", "1"), equalTo(true));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user