public class ClientUtils extends Object
SaltClient.| Constructor and Description |
|---|
ClientUtils() |
| Modifier and Type | Method and Description |
|---|---|
static void |
closeQuietly(InputStream stream)
Quietly close a given stream, suppressing exceptions.
|
static ParameterizedType |
parameterizedType(Type ownerType,
Type rawType,
Type... typeArguments)
Helper for constructing parameterized types.
|
static String[] |
splitFunction(String function)
Extract the module and function name from the function string based on '.' .
|
static String |
streamToString(InputStream inputStream)
Convert a given
InputStream to a String. |
static InputStream |
stringToStream(String s)
Convert a given
String to an InputStream. |
public static void closeQuietly(InputStream stream)
stream - Stream to closepublic static InputStream stringToStream(String s)
String to an InputStream.s - a stringpublic static String streamToString(InputStream inputStream)
InputStream to a String.inputStream - an input streampublic static ParameterizedType parameterizedType(Type ownerType, Type rawType, 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 String[] splitFunction(String function)
function - string containing module and function name (e.g. "test.ping")IllegalArgumentException - if a given function string does not contain a '.'Copyright © 2017. All rights reserved.