Utils Class
- java.
lang. Object - com.
microsoft. azure. management. resources. fluentcore. utils. Utils
- com.
public class Utils
Defines a few utilities.
Method Summary
Modifier and Type | Method and Description |
---|---|
String |
createOdataFilterForTags(String tagName, String tagValue)
Creates an Odata filter string that can be used for filtering list results by tags. |
Observable<byte[]> |
downloadFileAsync(String url, Retrofit retrofit)
Download a file asynchronously. |
static<U extends Indexable> Observable<U> |
rootResource(Observable<Indexable> stream)
Gets an observable of U that emits only the root resource from a given observable of Indexable. |
static<OutT, InT> PagedList<OutT> |
toPagedList(List<InT> list, final Func1<InT, OutT> mapper)
Converts the given list of a type to paged list of a different type. |
boolean |
toPrimitiveBoolean(Boolean value)
Converts an object Boolean to a primitive boolean. |
int |
toPrimitiveInt(Integer value)
Converts an object Integer to a primitive int. |
int |
toPrimitiveInt(Long value)
Converts an object Long to a primitive int. |
long |
toPrimitiveLong(Long value)
Converts an object Long to a primitive long. |
Method Details
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:
rootResource
public static static Observable rootResource(Observable
Gets an observable of U that emits only the root resource from a given observable of Indexable.
Parameters:
Returns:
toPagedList
public static static
Converts the given list of a type to paged list of a different type.
Parameters:
Returns:
toPrimitiveBoolean
public static boolean toPrimitiveBoolean(Boolean value)
Converts an object Boolean to a primitive boolean.
Parameters:
Boolean
value
Returns:
false
if the given Boolean value is null or false else true
toPrimitiveInt
public static int toPrimitiveInt(Integer value)
Converts an object Integer to a primitive int.
Parameters:
Integer
value
Returns:
0
if the given Integer value is null else integer value
toPrimitiveInt
public static int toPrimitiveInt(Long value)
Converts an object Long to a primitive int.
Parameters:
Long
value
Returns:
0
if the given Long value is null else integer value
toPrimitiveLong
public static long toPrimitiveLong(Long value)
Converts an object Long to a primitive long.
Parameters:
Long
value
Returns:
0
if the given Long value is null else long value
Applies to
Azure SDK for Java