Package ch.bztf.m226blb1.Utils
Class Helper
java.lang.Object
ch.bztf.m226blb1.Utils.Helper
Helper class for the project. Contains some useful methods.
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
equalsIgnoreCase
(String value, String other) Compares the givenstrings
for equality while ignoring the case.static String
toUpperCaseNullable
(String value) Converts the givenstring
to a upper case string.static String
trimToSize
(String value, @javax.validation.constraints.Min(3L) int size) Trims the given string to the given length, appending...
if the string is longer than the givenlength
.
-
Method Details
-
trimToSize
public static String trimToSize(String value, @Min(3L) @javax.validation.constraints.Min(3L) int size) Trims the given string to the given length, appending...
if the string is longer than the givenlength
.- Parameters:
value
- the value to be checkedsize
- the size of the string (greater than 3)- Returns:
- the trimmed value if it is longer than size, otherwise the original value
-
toUpperCaseNullable
Converts the givenstring
to a upper case string.- Parameters:
value
- the value to be converted- Returns:
- the upper case string or
null
if the value isnull
- Implementation Requirements:
- It can handle
null
values
-
equalsIgnoreCase
Compares the givenstrings
for equality while ignoring the case.- Parameters:
value
- the first value to be comparedother
- the second value to be compared- Returns:
true
if the givenstrings
are equal, ignoring the case- See Also:
-
Objects.equal(Object, Object)
toUpperCaseNullable(String)
-