public class ClientUtils
extends java.lang.Object
SaltClient
.Constructor and Description |
---|
ClientUtils() |
Modifier and Type | Method and Description |
---|---|
static void |
closeQuietly(java.io.InputStream stream)
Quietly close a given stream, suppressing exceptions.
|
static java.lang.reflect.ParameterizedType |
parameterizedType(java.lang.reflect.Type ownerType,
java.lang.reflect.Type rawType,
java.lang.reflect.Type... typeArguments)
Helper for constructing parameterized types.
|
static java.lang.String[] |
splitFunction(java.lang.String function)
Extract the module and function name from the function string based on '.' .
|
static java.lang.String |
streamToString(java.io.InputStream inputStream)
Convert a given
InputStream to a String . |
static java.io.InputStream |
stringToStream(java.lang.String s)
Convert a given
String to an InputStream . |
public static void closeQuietly(java.io.InputStream stream)
stream
- Stream to closepublic static java.io.InputStream stringToStream(java.lang.String s)
String
to an InputStream
.s
- a stringpublic static java.lang.String streamToString(java.io.InputStream inputStream)
InputStream
to a String
.inputStream
- an input streampublic static java.lang.reflect.ParameterizedType parameterizedType(java.lang.reflect.Type ownerType, java.lang.reflect.Type rawType, java.lang.reflect.Type... typeArguments)
ownerType
- the owner typerawType
- the raw typetypeArguments
- the type arguments$Gson$Types.newParameterizedTypeWithOwner(java.lang.reflect.Type, java.lang.reflect.Type, java.lang.reflect.Type...)
public static java.lang.String[] splitFunction(java.lang.String function)
function
- string containing module and function name (e.g. "test.ping")java.lang.IllegalArgumentException
- if a given function string does not contain a '.'