public class Util
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static boolean |
enableLog |
| Constructor and Description |
|---|
Util() |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
array2DEquals(java.util.List<java.util.List<java.lang.String>> a,
java.util.List<java.util.List<java.lang.String>> b)
array2DEquals determines whether two 2-dimensional string arrays are identical.
|
static boolean |
arrayEquals(java.util.List<java.lang.String> a,
java.util.List<java.lang.String> b)
arrayEquals determines whether two string arrays are identical.
|
static java.util.List<java.lang.String> |
arrayRemoveDuplicates(java.util.List<java.lang.String> s)
arrayRemoveDuplicates removes any duplicated elements in a string array preserving the order.
|
static java.lang.String |
arrayToString(java.util.List<java.lang.String> s)
arrayToString gets a printable string for a string array.
|
static java.lang.String |
convertInSyntax(java.lang.String expString)
convertInSyntax Convert 'in' to 'include' to fit aviatorscript,because aviatorscript don't support native 'in' syntax
|
static java.lang.String |
escapeAssertion(java.lang.String s)
escapeAssertion escapes the dots in the assertion, because the expression evaluation doesn't support such variable names.
|
static boolean |
hasEval(java.lang.String exp) |
static void |
logEnforce(java.lang.Object[] request,
boolean result,
java.util.List<java.lang.String> explain)
logEnforce prints the log of Enforce.
|
static void |
logPrint(java.lang.String v)
logPrint prints the log.
|
static void |
logPrintf(java.lang.String format,
java.lang.String... v)
logPrintf prints the log with the format.
|
static void |
logPrintfError(java.lang.String format,
java.lang.Object... v)
logPrintf prints the log with the format as an error.
|
static void |
logPrintfWarn(java.lang.String format,
java.lang.Object... v)
logPrintf prints the log with the format as a warning.
|
static java.lang.String |
md5(java.lang.String data) |
static java.lang.String |
paramsToString(java.lang.String[] s)
paramsToString gets a printable string for variable number of parameters.
|
static java.lang.String |
removeComments(java.lang.String s)
removeComments removes the comments starting with # in the text.
|
static java.lang.String |
replaceEval(java.lang.String s,
java.lang.String replacement) |
static boolean |
setEquals(java.util.List<java.lang.String> a,
java.util.List<java.lang.String> b)
setEquals determines whether two string sets are identical.
|
static java.lang.String[] |
splitCommaDelimited(java.lang.String s)
splitCommaDelimited splits a comma-delimited string according to the default processing method of the CSV file
into a string array.
|
public static void logPrint(java.lang.String v)
v - the log.public static void logPrintf(java.lang.String format,
java.lang.String... v)
format - the format of the log.v - the log.public static void logPrintfWarn(java.lang.String format,
java.lang.Object... v)
format - the format of the log.v - the log.public static void logPrintfError(java.lang.String format,
java.lang.Object... v)
format - the format of the log.v - the log.public static void logEnforce(java.lang.Object[] request,
boolean result,
java.util.List<java.lang.String> explain)
request - the Enforce request.result - the Enforce result.explain - to explain enforcement by matched rules.public static java.lang.String escapeAssertion(java.lang.String s)
s - the value of the matcher and effect assertions.public static java.lang.String convertInSyntax(java.lang.String expString)
expString - the value of the matcherpublic static java.lang.String removeComments(java.lang.String s)
s - a line in the model.public static boolean arrayEquals(java.util.List<java.lang.String> a,
java.util.List<java.lang.String> b)
a - the first array.b - the second array.public static boolean array2DEquals(java.util.List<java.util.List<java.lang.String>> a,
java.util.List<java.util.List<java.lang.String>> b)
a - the first 2-dimensional array.b - the second 2-dimensional array.public static java.util.List<java.lang.String> arrayRemoveDuplicates(java.util.List<java.lang.String> s)
s - the array.public static java.lang.String arrayToString(java.util.List<java.lang.String> s)
s - the array.public static java.lang.String paramsToString(java.lang.String[] s)
s - the parameters.public static java.lang.String[] splitCommaDelimited(java.lang.String s)
s - the string.public static boolean setEquals(java.util.List<java.lang.String> a,
java.util.List<java.lang.String> b)
a - the first set.b - the second set.public static boolean hasEval(java.lang.String exp)
public static java.lang.String replaceEval(java.lang.String s,
java.lang.String replacement)
public static java.lang.String md5(java.lang.String data)
Copyright © 2017–2022. All rights reserved.