Modifier and Type | Method and Description |
---|---|
static void |
checkArgument(boolean expression)
Ensures the truth of an expression involving one or more parameters to
the calling method.
|
static void |
checkArgument(boolean expression,
Object errorMessage)
Checks the truth of an expression.
|
static <T> T |
checkNotNull(T reference)
Deprecated.
|
static void |
checkState(boolean expression)
Ensures the truth of an expression involving the state of the calling
instance, but not involving any parameters to the calling method.
|
static void |
checkState(boolean expression,
String message)
Ensures the truth of an expression involving the state of the calling
instance, but not involving any parameters to the calling method.
|
static CryptoCipher |
getCipherInstance(String transformation,
Properties properties)
Helper method to create a CryptoCipher instance and throws only
IOException.
|
static Properties |
getDefaultProperties()
Gets a properties instance that defaults to the System Properties
plus any other properties found in the file
SYSTEM_PROPERTIES_FILE |
static Properties |
getProperties(Properties newProp)
Gets the properties merged with default properties.
|
static List<String> |
splitClassNames(String clazzNames,
String separator)
Splits class names sequence into substrings, Trim each substring into an
entry,and returns an list of the entries.
|
public static void checkArgument(boolean expression)
expression
- a boolean expression.IllegalArgumentException
- if expression is false.public static void checkArgument(boolean expression, Object errorMessage)
expression
- a boolean expression.errorMessage
- the exception message to use if the check fails; will
be converted to a string using String
.valueOf(Object)
.IllegalArgumentException
- if expression is false.@Deprecated public static <T> T checkNotNull(T reference)
Objects.requireNonNull(Object)
.T
- the type of the object reference to be checked.reference
- an object reference.NullPointerException
- if reference is null.public static void checkState(boolean expression)
expression
- a boolean expression.IllegalStateException
- if expression is false.public static void checkState(boolean expression, String message)
expression
- a boolean expression.message
- Error message for the exception when the expression is false.IllegalStateException
- if expression is false.public static CryptoCipher getCipherInstance(String transformation, Properties properties) throws IOException
properties
- The Properties
class represents a set of
properties.transformation
- the name of the transformation, e.g.,
AES/CBC/PKCS5Padding.
See the Java Cryptography Architecture Standard Algorithm Name Documentation
for information about standard transformation names.IOException
- if an I/O error occurs.public static Properties getDefaultProperties()
SYSTEM_PROPERTIES_FILE
public static Properties getProperties(Properties newProp)
newProp
- User-defined propertiespublic static List<String> splitClassNames(String clazzNames, String separator)
clazzNames
- a string consist of a list of the entries joined by a
delimiter, may be null or empty in which case an empty list is returned.separator
- a delimiter for the input string.Copyright © 2016–2022 The Apache Software Foundation. All rights reserved.