@Value.Enclosing public abstract class BuildConfigFields extends Object implements Iterable<BuildConfigFields.Field>
BuildConfig.java
file. Each field knows its Java
type, variable name, and value.Modifier and Type | Class and Description |
---|---|
static class |
BuildConfigFields.Field
An individual field in a
BuildConfigFields . |
Constructor and Description |
---|
BuildConfigFields() |
Modifier and Type | Method and Description |
---|---|
static BuildConfigFields |
fromFieldDeclarations(Iterable<String> declarations) |
static BuildConfigFields |
fromFields(Iterable<BuildConfigFields.Field> fields) |
String |
generateBuildConfigDotJava(UnflavoredBuildTarget source,
String javaPackage,
boolean useConstantExpressions)
Creates the Java code for a
BuildConfig.java file in the specified javaPackage . |
abstract Map<String,BuildConfigFields.Field> |
getNameToField() |
Iterator<BuildConfigFields.Field> |
iterator() |
static BuildConfigFields |
of() |
static BuildConfigFields |
of(Map<String,? extends BuildConfigFields.Field> nameToField) |
BuildConfigFields |
putAll(BuildConfigFields fields) |
String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
forEach, spliterator
public abstract Map<String,BuildConfigFields.Field> getNameToField()
public static BuildConfigFields of(Map<String,? extends BuildConfigFields.Field> nameToField)
public static BuildConfigFields of()
public static BuildConfigFields fromFieldDeclarations(Iterable<String> declarations)
public static BuildConfigFields fromFields(Iterable<BuildConfigFields.Field> fields)
BuildConfigFields
that contains the specified fields in iteration order.public BuildConfigFields putAll(BuildConfigFields fields)
BuildConfigFields
with all of the fields from this object, combined with
all of the fields from the specified fields
. If both objects have fields with the
same name, the entry from the fields
parameter wins.public String generateBuildConfigDotJava(UnflavoredBuildTarget source, String javaPackage, boolean useConstantExpressions)
BuildConfig.java
file in the specified javaPackage
.source
- The build target of the rule that is responsible for generating this
BuildConfig.java file.javaPackage
- The Java package for the generated file.useConstantExpressions
- Whether the value of each field in the generated Java code should
be the literal value from the BuildConfigFields.Field
(i.e., a constant expression) or a
non-constant-expression that is guaranteed to evaluate to the literal value.public Iterator<BuildConfigFields.Field> iterator()
iterator
in interface Iterable<BuildConfigFields.Field>
BuildConfigFields
.
The Iterator.remove()
method of the return value is not supported.