A collection of utilities for converting to strings.
Type Params | Return Type | Name and description |
---|---|---|
|
static String |
stringize(Object stringy) Converts most things to a string. |
|
static java.util.List<String> |
stringize(Iterable<?> stringyThings) Converts a collection of most things to a list of strings. |
|
static java.util.List<String> |
stringizeDropNull(Iterable<?> stringyThings) Like stringize, but drops any nulls, or empty instances of Provider and java.util.Optional |
|
static String |
stringizeOrNull(Object stringy) Like stringize, but returns null rather than throwing an exception, when item is null ,
an empty {@Link Provider} or an empty java.util.Optional. |
|
static void |
updateStringProperty(Project project, Provider<String> provider, Object stringy) Updates a Provider. |
|
static void |
updateStringProperty(ProjectOperations projectOperations, Provider<String> provider, Object stringy) Updates a Provider. |
Converts most things to a string. Closures are evaluated as well.
stringy
- An object that can be converted to a string or a closure that
can be evaluated to something that can be converted to a string.Converts a collection of most things to a list of strings. Closures are evaluated as well.
Iterable
- list of objects that can be converted to strings, including closure that can be evaluated
into objects that can be converted to strings.Like stringize, but drops any nulls, or empty instances of Provider and java.util.Optional
Like stringize, but returns null
rather than throwing an exception, when item is null
,
an empty {
null
Updates a Provider. If the Provider is a Property it will be updated in place, otherwise the provider will be assigned a new Provider instance. This method should only be called on Gradle < 6.0
project
- Project context for creating providersprovider
- Current providerstringy
- Value that should be lazy-resolved.Updates a Provider. If the Provider is a Property it will be updated in place, otherwise the provider will be assigned a new Provider instance. This method requires Gradle 4.3 at minimum
project
- Project context for creating providersprovider
- Current providerstringy
- Value that should be lazy-resolved.