Package com.ocs.dynamo.utils
Class StringUtils
- java.lang.Object
-
- com.ocs.dynamo.utils.StringUtils
-
public final class StringUtils extends Object
String utility functions- Author:
- Bas Rutten
-
-
Field Summary
Fields Modifier and Type Field Description static StringHTML_LINE_BREAK
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static StringcamelCaseToHumanFriendly(String camelCaseString, boolean capitalize)Converts CamelCase string to human friendlystatic StringgetHtmlLineBreak()static booleanisValidEmail(String value)Checks if an value is a valid email address - this is actually a very simple check that only checks for the @-signstatic StringprependProtocol(String value)Prepends the default protocol ("http://") to a value that represents a URLstatic StringpropertyIdToHumanFriendly(Object propertyId, boolean capitalize)Converts a propertyId to astatic StringrestrictToMaxFieldLength(String value, Class<?> clazz, String fieldName)Restricts a string value to the maximum length of a certain field
-
-
-
Field Detail
-
HTML_LINE_BREAK
public static final String HTML_LINE_BREAK
- See Also:
- Constant Field Values
-
-
Method Detail
-
camelCaseToHumanFriendly
public static String camelCaseToHumanFriendly(String camelCaseString, boolean capitalize)
Converts CamelCase string to human friendly- Parameters:
camelCaseString- the Camel Case string to convertcapitalize- indicates whether to capitalize every word (if set tofalsethen only the first word will be capitalized- Returns:
-
getHtmlLineBreak
public static String getHtmlLineBreak()
-
isValidEmail
public static boolean isValidEmail(String value)
Checks if an value is a valid email address - this is actually a very simple check that only checks for the @-sign- Parameters:
value- the value to check
-
prependProtocol
public static String prependProtocol(String value)
Prepends the default protocol ("http://") to a value that represents a URL- Parameters:
value- the value- Returns:
-
propertyIdToHumanFriendly
public static String propertyIdToHumanFriendly(Object propertyId, boolean capitalize)
Converts a propertyId to a- Parameters:
propertyId- the ID of the property- Returns:
-
-