public class StringUtils extends Object
Constructor and Description |
---|
StringUtils() |
Modifier and Type | Method and Description |
---|---|
static String |
fromBigDecimal(BigDecimal value)
Converts BigDecimal to String.
|
static String |
fromBigInteger(BigInteger value)
Converts BigInteger to String.
|
static String |
fromBoolean(Boolean value)
Converts Boolean to String.
|
static String |
fromByte(Byte b)
Returns the string representation of the specified Byte.
|
static String |
fromByteBuffer(ByteBuffer byteBuffer)
Base64 encodes the data in the specified byte buffer and returns it as a
base64 encoded string.
|
static String |
fromDate(Date value)
Converts the specified date to an ISO 8601 timestamp string and returns
it.
|
static String |
fromDouble(Double d)
Returns the string representation of the specified double.
|
static String |
fromFloat(Float value)
Converts Float to String.
|
static String |
fromInteger(Integer value)
Converts Integer to String.
|
static String |
fromLong(Long value)
Converts Long to String.
|
static String |
fromString(String value)
Converts String to String.
|
static boolean |
isBlank(CharSequence cs)
Checks if a CharSequence is whitespace, empty ("") or null.
|
static String |
join(String joiner,
String... parts)
Joins the strings in parts with joiner between each string
|
static String |
lowerCase(String str)
Converts a string to lower case with Locale.ENGLISH.
|
static String |
replace(String originalString,
String partToMatch,
String replacement)
Finds partToMatch in original string and replaces.
|
static BigDecimal |
toBigDecimal(String s)
Converts from String to BigDecimal.
|
static BigInteger |
toBigInteger(String s)
Converts from String to BigInteger.
|
static Boolean |
toBoolean(StringBuilder value)
Converts
|
static Integer |
toInteger(StringBuilder value)
Converts object to Integer.
|
static String |
toString(StringBuilder value)
Converts object to string.
|
static String |
upperCase(String str)
Converts a string to upper case with Locale.ENGLISH.
|
public static final Charset UTF8
public static Integer toInteger(StringBuilder value)
value
- object value.public static String toString(StringBuilder value)
value
- object value.public static Boolean toBoolean(StringBuilder value)
value
- object value.public static String fromInteger(Integer value)
value
- Integer value.public static String fromLong(Long value)
value
- Long value.public static String fromString(String value)
value
- String value.public static String fromBoolean(Boolean value)
value
- Boolean value.public static String fromBigInteger(BigInteger value)
value
- BigInteger value.public static String fromBigDecimal(BigDecimal value)
value
- Big Decimal value.public static BigInteger toBigInteger(String s)
s
- String value.public static BigDecimal toBigDecimal(String s)
s
- String value.public static String fromFloat(Float value)
value
- Float value.public static String fromDate(Date value)
value
- The date to format as an ISO 8601 timestamp string.public static String fromDouble(Double d)
d
- The double to represent as a string.public static String fromByte(Byte b)
b
- The Byte to represent as a string.public static String fromByteBuffer(ByteBuffer byteBuffer)
byteBuffer
- The data to base64 encode and return as a string.public static String replace(String originalString, String partToMatch, String replacement)
originalString
- original string.partToMatch
- string to match.replacement
- string to replace with.public static String join(String joiner, String... parts)
joiner
- the string to insert between the strings in partsparts
- the parts to joinpublic static String lowerCase(String str)
str
- the string to lower casepublic static String upperCase(String str)
str
- the string to upper casepublic static boolean isBlank(CharSequence cs)
cs
- the CharSequence to check, may be nullCopyright © 2017. All rights reserved.