Top Description Fields Constructors Methods
com.dlsc.preferencesfx.util

public Class Strings

extends Object
Class Inheritance
Static Imports
java.util.Objects.requireNonNull

Helper methods for working with strings.

Field Summary

Modifier and TypeField and Description
private static final char[]

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
pack-priv static boolean

Returns:

true if str contains the searchStr (case insensitive)
containsIgnoreCase
(String
the string to search in
str
,
String
the string to search for
searchStr
)

Indicates whether the character sequence sequence contains the subSequence, ignoring the case in the same manner as String#equalsIgnoreCase(String).

public static String

Returns:

the HEX representation of the byte array.
hexString
(byte[]
the byte array, must not be null.
bytes
)

Calculates the HEX representation of a byte array.

public static boolean

Returns:

true iff the string is not null and not empty
isNullOrEmpty
(String
the string to test, may be null.
string
)

Checks if a string is null or empty.

public static String

Returns:

the SHA-256 digest of the input string
sha256
(String
the string to digest, must not be null.
string
)

Calculates the SHA-256 digest of a string.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

HEX_ARRAYback to summary
private static final char[] HEX_ARRAY

Constructor Detail

Stringsback to summary
public Strings()

Method Detail

containsIgnoreCaseback to summary
pack-priv static boolean containsIgnoreCase(String str, String searchStr)

Indicates whether the character sequence sequence contains the subSequence, ignoring the case in the same manner as String#equalsIgnoreCase(String).

Parameters
str:String

the string to search in

searchStr:String

the string to search for

Returns:boolean

true if str contains the searchStr (case insensitive)

hexStringback to summary
public static String hexString(byte[] bytes)

Calculates the HEX representation of a byte array.

Parameters
bytes:byte[]

the byte array, must not be null.

Returns:String

the HEX representation of the byte array.

isNullOrEmptyback to summary
public static boolean isNullOrEmpty(String string)

Checks if a string is null or empty.

Parameters
string:String

the string to test, may be null.

Returns:boolean

true iff the string is not null and not empty

sha256back to summary
public static String sha256(String string)

Calculates the SHA-256 digest of a string.

Parameters
string:String

the string to digest, must not be null.

Returns:String

the SHA-256 digest of the input string