Class UserDefinedProviderInfo

  • All Implemented Interfaces:
    ProviderInfo<UserDefinedProviderInfo>, SkylarkProviderInfo,,,

    public class UserDefinedProviderInfo
    extends Object
    implements ProviderInfo<UserDefinedProviderInfo>,,
    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 file
    • Constructor Detail

      • UserDefinedProviderInfo

        public UserDefinedProviderInfo​(Provider<UserDefinedProviderInfo> provider,
                             <String,​Object> fieldValues)
        Create an instance of UserDefinedProviderInfo
        provider - The provider that created this UserDefinedProviderInfo object
        fieldValues - 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
    • Method Detail

      • repr

        public void repr​( printer)
        Specified by:
        repr in interface
      • getValue

        public Object getValue​(String name)
        Specified by:
        getValue in interface
      • getFieldNames

        public<String> getFieldNames()
        Specified by:
        getFieldNames in interface
      • getErrorMessageForUnknownField

        public String getErrorMessageForUnknownField​(String field)
        Specified by:
        getErrorMessageForUnknownField in interface
      • isImmutable

        public boolean isImmutable()
        Specified by:
        isImmutable in interface