GUtil

open class GUtil(source)

Deprecated

This class is only here to maintain binary compatibility with existing plugins.

Plugins should prefer external collection frameworks over this class. Internally, all code should use org.gradle.util.internal.GUtil.

Deprecated

Will be removed in Gradle 9.0.

Constructors

Link copied to clipboard
constructor()

Functions

Link copied to clipboard
open fun <K, V> addMaps(map1: Map<K, V>, map2: Map<K, V>): Map<K, V>
Link copied to clipboard
open fun <V, T : Collection<in V>?> addToCollection(dest: T, src: Iterable<out V>): T
open fun <V, T : Collection<in V>?> addToCollection(dest: T, srcs: Array<Iterable<out V>>): T
open fun <V, T : Collection<in V>?> addToCollection(dest: T, failOnNull: Boolean, src: Iterable<out V>): T
open fun <V, T : Collection<in V>?> addToCollection(dest: T, failOnNull: Boolean, srcs: Array<Iterable<out V>>): T
Link copied to clipboard
open fun addToMap(dest: Map<String, String>, src: Map<out Any, out Any>)
Link copied to clipboard
open fun asPath(collection: Iterable<out Any>): String
Link copied to clipboard
Link copied to clipboard
open fun collectionize(input: Any): Collection<out Any>
Flattens input collections (including arrays *but* not maps).
Link copied to clipboard
@Nullable
open fun <T> elvis(@Nullable object: T, @Nullable defaultValue: T): T
Prefer getOrDefault if the value is expensive to compute or would trigger early configuration.
Link copied to clipboard
open fun endsWith(longer: CharSequence, shorter: CharSequence): Boolean
Checks whether the fist CharSequence ends with the second.
Link copied to clipboard
open fun flatten(elements: Collection<Any>): List<Any>
open fun <T : Collection<out Any>?> flatten(elements: Array<Any>, addTo: T): T
open fun <T : Collection<out Any>?> flatten(elements: Collection<out Any>, addTo: T): T
open fun flatten(elements: Collection<Any>, flattenMapsAndArrays: Boolean): List<Any>
open fun <T : Collection<out Any>?> flatten(elements: Array<Any>, addTo: T, flattenMaps: Boolean): T
open fun <T : Collection<out Any>?> flatten(elements: Collection<out Any>, addTo: T, flattenMapsAndArrays: Boolean): T
open fun <T : Collection<out Any>?> flatten(elements: Collection<out Any>, addTo: T, flattenMaps: Boolean, flattenArrays: Boolean): T
Link copied to clipboard
open fun <T : Collection<out Any>?> flattenElements(elements: Array<Any>): T
Link copied to clipboard
@Nullable
open fun <T> getOrDefault(@Nullable object: T, defaultValueSupplier: Factory<T>): T
Link copied to clipboard
open fun isSecureUrl(url: URI): Boolean
Link copied to clipboard
open fun isTrue(@Nullable object: Any): Boolean
Link copied to clipboard
open fun <T> last(comparator: Comparator<in T>, lastValue: T): Comparator<T>
Link copied to clipboard
open fun loadProperties(propertyFile: File): Properties
open fun loadProperties(inputStream: InputStream): Properties
open fun loadProperties(url: URL): Properties
Link copied to clipboard
open fun map(objects: Array<Any>): Map<Any, Any>
Link copied to clipboard
open fun prefix(prefix: String, strings: Collection<String>): List<String>
Link copied to clipboard
open fun saveProperties(properties: Properties, propertyFile: File)
open fun saveProperties(properties: Properties, outputStream: OutputStream)
Link copied to clipboard
open fun serialize(object: Any): Array<Byte>
open fun serialize(object: Any, outputStream: OutputStream)
Link copied to clipboard
open fun toCamelCase(string: CharSequence): String
Converts an arbitrary string to a camel-case string which can be used in a Java identifier.
Link copied to clipboard
open fun toConstant(string: CharSequence): String
Converts an arbitrary string to upper case identifier with words separated by _.
Link copied to clipboard
open fun <T : Enum<T>?> toEnum(enumType: Class<out T>, value: Any): T
Link copied to clipboard
open fun <T : Enum<T>?> toEnumSet(enumType: Class<T>, values: Iterable<out Any>): EnumSet<T>
open fun <T : Enum<T>?> toEnumSet(enumType: Class<T>, values: Array<Any>): EnumSet<T>
Link copied to clipboard
Link copied to clipboard
open fun toSecureUrl(scriptUri: URI): URI
Link copied to clipboard
open fun toString(names: Iterable<out Any>): String
Link copied to clipboard
open fun toWords(string: CharSequence): String
Converts an arbitrary string to space-separated words.
open fun toWords(string: CharSequence, separator: Char): String
Link copied to clipboard
@Nullable
open fun <T> uncheckedCall(callable: Callable<T>): T
Calls the given callable converting any thrown exception to an unchecked exception via throwAsUncheckedException