public class UserDefinedProviderInfo extends Object implements ProviderInfo<UserDefinedProviderInfo>, com.google.devtools.build.lib.skylarkinterface.SkylarkValue, com.google.devtools.build.lib.syntax.ClassObject
ProviderInfo
that is created by a Provider
that is defined at runtime by a user.
e.g. FooInfo = provider(fields=["foo"]); info = FooInfo(foo="bar")
in a build fileConstructor and Description |
---|
UserDefinedProviderInfo(Provider<UserDefinedProviderInfo> provider,
com.google.common.collect.ImmutableMap<String,Object> fieldValues)
Create an instance of
UserDefinedProviderInfo |
Modifier and Type | Method and Description |
---|---|
String |
getErrorMessageForUnknownField(String field) |
com.google.common.collect.ImmutableCollection<String> |
getFieldNames() |
Provider<UserDefinedProviderInfo> |
getProvider() |
ProviderInfo<?> |
getProviderInfo() |
Object |
getValue(String name) |
boolean |
isImmutable() |
void |
repr(com.google.devtools.build.lib.skylarkinterface.SkylarkPrinter printer) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public UserDefinedProviderInfo(Provider<UserDefinedProviderInfo> provider, com.google.common.collect.ImmutableMap<String,Object> fieldValues)
UserDefinedProviderInfo
provider
- The provider that created this UserDefinedProviderInfo
objectfieldValues
- A mapping of field names to their values. Note that the names must be valid
skylark identifiers as they are accessed via info_instance.<field>
. The values must
be valid when used in the Skylark interpreter. That is, either primitives, or instances of
SkylarkValue
public Provider<UserDefinedProviderInfo> getProvider()
getProvider
in interface ProviderInfo<UserDefinedProviderInfo>
Provider
instance that constructs instances of this info.public ProviderInfo<?> getProviderInfo()
getProviderInfo
in interface SkylarkProviderInfo
public void repr(com.google.devtools.build.lib.skylarkinterface.SkylarkPrinter printer)
repr
in interface com.google.devtools.build.lib.skylarkinterface.SkylarkPrintable
@Nullable public Object getValue(String name)
getValue
in interface com.google.devtools.build.lib.syntax.ClassObject
public com.google.common.collect.ImmutableCollection<String> getFieldNames()
getFieldNames
in interface com.google.devtools.build.lib.syntax.ClassObject
@Nullable public String getErrorMessageForUnknownField(String field)
getErrorMessageForUnknownField
in interface com.google.devtools.build.lib.syntax.ClassObject
public boolean isImmutable()
isImmutable
in interface com.google.devtools.build.lib.skylarkinterface.SkylarkValue