@Deprecated public class GUtil extends Object
Plugins should prefer external collection frameworks over this class.
Internally, all code should use GUtil
.
Constructor | Description |
---|---|
GUtil() |
Deprecated.
|
Modifier and Type | Method | Description |
---|---|---|
static <K,V> |
addMaps(Map<K,V> map1,
Map<K,V> map2) |
Deprecated.
|
static <V,T extends Collection<? super V>> |
addToCollection(T dest,
boolean failOnNull,
Iterable<? extends V> src) |
Deprecated.
|
static <V,T extends Collection<? super V>> |
addToCollection(T dest,
boolean failOnNull,
Iterable<? extends V>... srcs) |
Deprecated.
|
static <V,T extends Collection<? super V>> |
addToCollection(T dest,
Iterable<? extends V> src) |
Deprecated.
|
static <V,T extends Collection<? super V>> |
addToCollection(T dest,
Iterable<? extends V>... srcs) |
Deprecated.
|
static void |
addToMap(Map<String,String> dest,
Map<?,?> src) |
Deprecated.
|
static String |
asPath(Iterable<?> collection) |
Deprecated.
|
static Comparator<String> |
caseInsensitive() |
Deprecated.
|
static Collection<?> |
collectionize(Object input) |
Deprecated.
Flattens input collections (including arrays *but* not maps).
|
static <T> T |
elvis(T object,
T defaultValue) |
Deprecated.
Prefer
getOrDefault(Object, Factory) if the value is expensive to compute or
would trigger early configuration. |
static boolean |
endsWith(CharSequence longer,
CharSequence shorter) |
Deprecated.
Checks whether the fist
CharSequence ends with the second. |
static <T extends Collection<?>> |
flatten(Object[] elements,
T addTo) |
Deprecated.
|
static <T extends Collection<?>> |
flatten(Object[] elements,
T addTo,
boolean flattenMaps) |
Deprecated.
|
static <T extends Collection<?>> |
flatten(Collection<?> elements,
T addTo) |
Deprecated.
|
static <T extends Collection<?>> |
flatten(Collection<?> elements,
T addTo,
boolean flattenMapsAndArrays) |
Deprecated.
|
static <T extends Collection<?>> |
flatten(Collection<?> elements,
T addTo,
boolean flattenMaps,
boolean flattenArrays) |
Deprecated.
|
static List<Object> |
flatten(Collection<Object> elements) |
Deprecated.
|
static List<Object> |
flatten(Collection<Object> elements,
boolean flattenMapsAndArrays) |
Deprecated.
|
static <T extends Collection<?>> |
flattenElements(Object... elements) |
Deprecated.
|
static <T> T |
getOrDefault(T object,
org.gradle.internal.Factory<T> defaultValueSupplier) |
Deprecated.
|
static boolean |
isSecureUrl(URI url) |
Deprecated.
|
static boolean |
isTrue(Object object) |
Deprecated.
|
static <T> Comparator<T> |
last(Comparator<? super T> comparator,
T lastValue) |
Deprecated.
|
static Properties |
loadProperties(File propertyFile) |
Deprecated.
|
static Properties |
loadProperties(InputStream inputStream) |
Deprecated.
|
static Properties |
loadProperties(URL url) |
Deprecated.
|
static Map<Object,Object> |
map(Object... objects) |
Deprecated.
|
static List<String> |
prefix(String prefix,
Collection<String> strings) |
Deprecated.
|
static void |
saveProperties(Properties properties,
File propertyFile) |
Deprecated.
|
static void |
saveProperties(Properties properties,
OutputStream outputStream) |
Deprecated.
|
static byte[] |
serialize(Object object) |
Deprecated.
|
static void |
serialize(Object object,
OutputStream outputStream) |
Deprecated.
|
static String |
toCamelCase(CharSequence string) |
Deprecated.
Converts an arbitrary string to a camel-case string which can be used in a Java identifier.
|
static String |
toConstant(CharSequence string) |
Deprecated.
Converts an arbitrary string to upper case identifier with words separated by _.
|
static <T extends Enum<T>> |
toEnum(Class<? extends T> enumType,
Object value) |
Deprecated.
|
static <T extends Enum<T>> |
toEnumSet(Class<T> enumType,
Iterable<?> values) |
Deprecated.
|
static <T extends Enum<T>> |
toEnumSet(Class<T> enumType,
Object[] values) |
Deprecated.
|
static String |
toLowerCamelCase(CharSequence string) |
Deprecated.
|
static URI |
toSecureUrl(URI scriptUri) |
Deprecated.
|
static String |
toString(Iterable<?> names) |
Deprecated.
|
static String |
toWords(CharSequence string) |
Deprecated.
Converts an arbitrary string to space-separated words.
|
static String |
toWords(CharSequence string,
char separator) |
Deprecated.
|
static <T> T |
uncheckedCall(Callable<T> callable) |
Deprecated.
Calls the given callable converting any thrown exception to an unchecked exception via
UncheckedException.throwAsUncheckedException(Throwable) |
public static <T extends Collection<?>> T flatten(Object[] elements, T addTo, boolean flattenMaps)
public static <T extends Collection<?>> T flatten(Object[] elements, T addTo)
public static <T extends Collection<?>> T flatten(Collection<?> elements, T addTo)
public static <T extends Collection<?>> T flattenElements(Object... elements)
public static <T extends Collection<?>> T flatten(Collection<?> elements, T addTo, boolean flattenMapsAndArrays)
public static <T extends Collection<?>> T flatten(Collection<?> elements, T addTo, boolean flattenMaps, boolean flattenArrays)
public static Collection<?> collectionize(Object input)
input
- any objectpublic static List<Object> flatten(Collection<Object> elements, boolean flattenMapsAndArrays)
public static List<Object> flatten(Collection<Object> elements)
public static List<String> prefix(String prefix, Collection<String> strings)
@Nullable public static <T> T elvis(@Nullable T object, @Nullable T defaultValue)
getOrDefault(Object, Factory)
if the value is expensive to compute or
would trigger early configuration.@Nullable public static <T> T getOrDefault(@Nullable T object, org.gradle.internal.Factory<T> defaultValueSupplier)
public static <V,T extends Collection<? super V>> T addToCollection(T dest, boolean failOnNull, Iterable<? extends V> src)
public static <V,T extends Collection<? super V>> T addToCollection(T dest, Iterable<? extends V> src)
@Deprecated public static <V,T extends Collection<? super V>> T addToCollection(T dest, boolean failOnNull, Iterable<? extends V>... srcs)
@Deprecated public static <V,T extends Collection<? super V>> T addToCollection(T dest, Iterable<? extends V>... srcs)
public static Comparator<String> caseInsensitive()
public static Properties loadProperties(File propertyFile)
public static Properties loadProperties(URL url)
public static Properties loadProperties(InputStream inputStream)
public static void saveProperties(Properties properties, File propertyFile)
public static void saveProperties(Properties properties, OutputStream outputStream)
public static String toCamelCase(CharSequence string)
public static String toLowerCamelCase(CharSequence string)
public static String toConstant(CharSequence string)
public static String toWords(CharSequence string)
public static String toWords(CharSequence string, char separator)
public static byte[] serialize(Object object)
public static void serialize(Object object, OutputStream outputStream)
public static <T> Comparator<T> last(Comparator<? super T> comparator, T lastValue)
@Nullable public static <T> T uncheckedCall(Callable<T> callable)
UncheckedException.throwAsUncheckedException(Throwable)
T
- Callable's return typecallable
- The callable to callCallable.call()
public static <T extends Enum<T>> T toEnum(Class<? extends T> enumType, Object value)
public static <T extends Enum<T>> EnumSet<T> toEnumSet(Class<T> enumType, Object[] values)
public static <T extends Enum<T>> EnumSet<T> toEnumSet(Class<T> enumType, Iterable<?> values)
public static boolean endsWith(CharSequence longer, CharSequence shorter)
CharSequence
ends with the second.
If the CharSequence.charAt(int)
method of both sequences is fast,
this check is faster than converting them to Strings and using String.endsWith(String)
.public static boolean isSecureUrl(URI url)