Utils Class
- java.
lang. Object - com.
microsoft. azure. management. resources. fluentcore. utils. Utils
- com.
public final class Utils
Defines a few utilities.
Method Summary
Modifier and Type | Method and Description |
---|---|
static com.microsoft.azure.PagedList<OutT> |
<OutT,InT>toPagedList(List<InT> list, Func1<InT,OutT> mapper)
Converts the given list of a type to paged list of a different type. |
static void |
addToListIfNotExists(List<String> list, String value)
Adds a value to the list if does not already exists. |
static java.lang.String |
createOdataFilterForTags(String tagName, String tagValue)
Creates an Odata filter string that can be used for filtering list results by tags. |
static rx.Observable<byte[]> |
downloadFileAsync(String url, Retrofit retrofit)
Download a file asynchronously. |
static com.microsoft.azure.AzureEnvironment |
extractAzureEnvironment(RestClient restClient)
Try to extract the environment the client is authenticated to based on the information on the rest client. |
static java.lang.String |
getResponseBodyInString(ResponseBody responseBody)
Get the response body as string. |
static java.lang.String |
getStorageConnectionString(String accountName, String accountKey, RestClient restClient)
Get the Azure storage account connection string. |
static void |
removeFromList(List<String> list, String value)
Removes a value from the list. |
static java.lang.String | resourceGroupId(String id) |
static rx.Observable<U> |
rootResource(Observable<Indexable> stream)
Gets an observable of type |
static boolean |
toPrimitiveBoolean(Boolean value)
Converts an object Boolean to a primitive boolean. |
static int |
toPrimitiveInt(Integer value)
Converts an object Integer to a primitive int. |
static int |
toPrimitiveInt(Long value)
Converts an object Long to a primitive int. |
static long |
toPrimitiveLong(Long value)
Converts an object Long to a primitive long. |
Methods inherited from java.lang.Object
Method Details
<OutT,InT>toPagedList
public static PagedList
Converts the given list of a type to paged list of a different type.
Parameters:
Returns:
addToListIfNotExists
public static void addToListIfNotExists(List
Adds a value to the list if does not already exists.
Parameters:
createOdataFilterForTags
public static String createOdataFilterForTags(String tagName, String tagValue)
Creates an Odata filter string that can be used for filtering list results by tags.
Parameters:
Returns:
downloadFileAsync
public static Observable
Download a file asynchronously.
Parameters:
Returns:
extractAzureEnvironment
public static AzureEnvironment extractAzureEnvironment(RestClient restClient)
Try to extract the environment the client is authenticated to based on the information on the rest client.
Parameters:
Returns:
getResponseBodyInString
public static String getResponseBodyInString(ResponseBody responseBody)
Get the response body as string.
Parameters:
Returns:
Throws:
getStorageConnectionString
public static String getStorageConnectionString(String accountName, String accountKey, RestClient restClient)
Get the Azure storage account connection string.
Parameters:
Returns:
removeFromList
public static void removeFromList(List
Removes a value from the list.
Parameters:
resourceGroupId
public static String resourceGroupId(String id)
Parameters:
Returns:
rootResource
toPrimitiveBoolean
public static boolean toPrimitiveBoolean(Boolean value)
Converts an object Boolean to a primitive boolean.
Parameters:
Returns:
toPrimitiveInt
public static int toPrimitiveInt(Integer value)
Converts an object Integer to a primitive int.
Parameters:
Returns:
toPrimitiveInt
public static int toPrimitiveInt(Long value)
Converts an object Long to a primitive int.
Parameters:
Returns:
toPrimitiveLong
public static long toPrimitiveLong(Long value)
Converts an object Long to a primitive long.
Parameters:
Returns: