Class AllocationPolicy.Builder

  • All Implemented Interfaces:
    AllocationPolicyOrBuilder, com.google.protobuf.Message.Builder, com.google.protobuf.MessageLite.Builder, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, Cloneable
    Enclosing class:
    AllocationPolicy

    public static final class AllocationPolicy.Builder
    extends com.google.protobuf.GeneratedMessageV3.Builder<AllocationPolicy.Builder>
    implements AllocationPolicyOrBuilder
     A Job's resource allocation policy describes when, where, and how compute
     resources should be allocated for the Job.
     
    Protobuf type google.cloud.batch.v1.AllocationPolicy
    • Method Detail

      • getDescriptor

        public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
      • internalGetMapField

        protected com.google.protobuf.MapField internalGetMapField​(int number)
        Overrides:
        internalGetMapField in class com.google.protobuf.GeneratedMessageV3.Builder<AllocationPolicy.Builder>
      • internalGetMutableMapField

        protected com.google.protobuf.MapField internalGetMutableMapField​(int number)
        Overrides:
        internalGetMutableMapField in class com.google.protobuf.GeneratedMessageV3.Builder<AllocationPolicy.Builder>
      • internalGetFieldAccessorTable

        protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
        Specified by:
        internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessageV3.Builder<AllocationPolicy.Builder>
      • clear

        public AllocationPolicy.Builder clear()
        Specified by:
        clear in interface com.google.protobuf.Message.Builder
        Specified by:
        clear in interface com.google.protobuf.MessageLite.Builder
        Overrides:
        clear in class com.google.protobuf.GeneratedMessageV3.Builder<AllocationPolicy.Builder>
      • getDescriptorForType

        public com.google.protobuf.Descriptors.Descriptor getDescriptorForType()
        Specified by:
        getDescriptorForType in interface com.google.protobuf.Message.Builder
        Specified by:
        getDescriptorForType in interface com.google.protobuf.MessageOrBuilder
        Overrides:
        getDescriptorForType in class com.google.protobuf.GeneratedMessageV3.Builder<AllocationPolicy.Builder>
      • getDefaultInstanceForType

        public AllocationPolicy getDefaultInstanceForType()
        Specified by:
        getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuilder
        Specified by:
        getDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilder
      • build

        public AllocationPolicy build()
        Specified by:
        build in interface com.google.protobuf.Message.Builder
        Specified by:
        build in interface com.google.protobuf.MessageLite.Builder
      • buildPartial

        public AllocationPolicy buildPartial()
        Specified by:
        buildPartial in interface com.google.protobuf.Message.Builder
        Specified by:
        buildPartial in interface com.google.protobuf.MessageLite.Builder
      • clone

        public AllocationPolicy.Builder clone()
        Specified by:
        clone in interface com.google.protobuf.Message.Builder
        Specified by:
        clone in interface com.google.protobuf.MessageLite.Builder
        Overrides:
        clone in class com.google.protobuf.GeneratedMessageV3.Builder<AllocationPolicy.Builder>
      • setField

        public AllocationPolicy.Builder setField​(com.google.protobuf.Descriptors.FieldDescriptor field,
                                                 Object value)
        Specified by:
        setField in interface com.google.protobuf.Message.Builder
        Overrides:
        setField in class com.google.protobuf.GeneratedMessageV3.Builder<AllocationPolicy.Builder>
      • clearField

        public AllocationPolicy.Builder clearField​(com.google.protobuf.Descriptors.FieldDescriptor field)
        Specified by:
        clearField in interface com.google.protobuf.Message.Builder
        Overrides:
        clearField in class com.google.protobuf.GeneratedMessageV3.Builder<AllocationPolicy.Builder>
      • clearOneof

        public AllocationPolicy.Builder clearOneof​(com.google.protobuf.Descriptors.OneofDescriptor oneof)
        Specified by:
        clearOneof in interface com.google.protobuf.Message.Builder
        Overrides:
        clearOneof in class com.google.protobuf.GeneratedMessageV3.Builder<AllocationPolicy.Builder>
      • setRepeatedField

        public AllocationPolicy.Builder setRepeatedField​(com.google.protobuf.Descriptors.FieldDescriptor field,
                                                         int index,
                                                         Object value)
        Specified by:
        setRepeatedField in interface com.google.protobuf.Message.Builder
        Overrides:
        setRepeatedField in class com.google.protobuf.GeneratedMessageV3.Builder<AllocationPolicy.Builder>
      • addRepeatedField

        public AllocationPolicy.Builder addRepeatedField​(com.google.protobuf.Descriptors.FieldDescriptor field,
                                                         Object value)
        Specified by:
        addRepeatedField in interface com.google.protobuf.Message.Builder
        Overrides:
        addRepeatedField in class com.google.protobuf.GeneratedMessageV3.Builder<AllocationPolicy.Builder>
      • mergeFrom

        public AllocationPolicy.Builder mergeFrom​(com.google.protobuf.Message other)
        Specified by:
        mergeFrom in interface com.google.protobuf.Message.Builder
        Overrides:
        mergeFrom in class com.google.protobuf.AbstractMessage.Builder<AllocationPolicy.Builder>
      • isInitialized

        public final boolean isInitialized()
        Specified by:
        isInitialized in interface com.google.protobuf.MessageLiteOrBuilder
        Overrides:
        isInitialized in class com.google.protobuf.GeneratedMessageV3.Builder<AllocationPolicy.Builder>
      • mergeFrom

        public AllocationPolicy.Builder mergeFrom​(com.google.protobuf.CodedInputStream input,
                                                  com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                           throws IOException
        Specified by:
        mergeFrom in interface com.google.protobuf.Message.Builder
        Specified by:
        mergeFrom in interface com.google.protobuf.MessageLite.Builder
        Overrides:
        mergeFrom in class com.google.protobuf.AbstractMessage.Builder<AllocationPolicy.Builder>
        Throws:
        IOException
      • hasLocation

        public boolean hasLocation()
         Location where compute resources should be allocated for the Job.
         
        .google.cloud.batch.v1.AllocationPolicy.LocationPolicy location = 1;
        Specified by:
        hasLocation in interface AllocationPolicyOrBuilder
        Returns:
        Whether the location field is set.
      • clearLocation

        public AllocationPolicy.Builder clearLocation()
         Location where compute resources should be allocated for the Job.
         
        .google.cloud.batch.v1.AllocationPolicy.LocationPolicy location = 1;
      • getLocationBuilder

        public AllocationPolicy.LocationPolicy.Builder getLocationBuilder()
         Location where compute resources should be allocated for the Job.
         
        .google.cloud.batch.v1.AllocationPolicy.LocationPolicy location = 1;
      • getInstancesCount

        public int getInstancesCount()
         Describe instances that can be created by this AllocationPolicy.
         Only instances[0] is supported now.
         
        repeated .google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate instances = 8;
        Specified by:
        getInstancesCount in interface AllocationPolicyOrBuilder
      • clearInstances

        public AllocationPolicy.Builder clearInstances()
         Describe instances that can be created by this AllocationPolicy.
         Only instances[0] is supported now.
         
        repeated .google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate instances = 8;
      • removeInstances

        public AllocationPolicy.Builder removeInstances​(int index)
         Describe instances that can be created by this AllocationPolicy.
         Only instances[0] is supported now.
         
        repeated .google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate instances = 8;
      • getInstancesBuilder

        public AllocationPolicy.InstancePolicyOrTemplate.Builder getInstancesBuilder​(int index)
         Describe instances that can be created by this AllocationPolicy.
         Only instances[0] is supported now.
         
        repeated .google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate instances = 8;
      • addInstancesBuilder

        public AllocationPolicy.InstancePolicyOrTemplate.Builder addInstancesBuilder()
         Describe instances that can be created by this AllocationPolicy.
         Only instances[0] is supported now.
         
        repeated .google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate instances = 8;
      • addInstancesBuilder

        public AllocationPolicy.InstancePolicyOrTemplate.Builder addInstancesBuilder​(int index)
         Describe instances that can be created by this AllocationPolicy.
         Only instances[0] is supported now.
         
        repeated .google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate instances = 8;
      • getInstancesBuilderList

        public List<AllocationPolicy.InstancePolicyOrTemplate.Builder> getInstancesBuilderList()
         Describe instances that can be created by this AllocationPolicy.
         Only instances[0] is supported now.
         
        repeated .google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate instances = 8;
      • hasServiceAccount

        public boolean hasServiceAccount()
         Service account that VMs will run as.
         
        .google.cloud.batch.v1.ServiceAccount service_account = 9;
        Specified by:
        hasServiceAccount in interface AllocationPolicyOrBuilder
        Returns:
        Whether the serviceAccount field is set.
      • setServiceAccount

        public AllocationPolicy.Builder setServiceAccount​(ServiceAccount value)
         Service account that VMs will run as.
         
        .google.cloud.batch.v1.ServiceAccount service_account = 9;
      • mergeServiceAccount

        public AllocationPolicy.Builder mergeServiceAccount​(ServiceAccount value)
         Service account that VMs will run as.
         
        .google.cloud.batch.v1.ServiceAccount service_account = 9;
      • clearServiceAccount

        public AllocationPolicy.Builder clearServiceAccount()
         Service account that VMs will run as.
         
        .google.cloud.batch.v1.ServiceAccount service_account = 9;
      • getServiceAccountBuilder

        public ServiceAccount.Builder getServiceAccountBuilder()
         Service account that VMs will run as.
         
        .google.cloud.batch.v1.ServiceAccount service_account = 9;
      • getLabelsCount

        public int getLabelsCount()
        Description copied from interface: AllocationPolicyOrBuilder
         Labels applied to all VM instances and other resources
         created by AllocationPolicy.
         Labels could be user provided or system generated.
         You can assign up to 64 labels. [Google Compute Engine label
         restrictions](https://cloud.google.com/compute/docs/labeling-resources#restrictions)
         apply.
         Label names that start with "goog-" or "google-" are reserved.
         
        map<string, string> labels = 6;
        Specified by:
        getLabelsCount in interface AllocationPolicyOrBuilder
      • containsLabels

        public boolean containsLabels​(String key)
         Labels applied to all VM instances and other resources
         created by AllocationPolicy.
         Labels could be user provided or system generated.
         You can assign up to 64 labels. [Google Compute Engine label
         restrictions](https://cloud.google.com/compute/docs/labeling-resources#restrictions)
         apply.
         Label names that start with "goog-" or "google-" are reserved.
         
        map<string, string> labels = 6;
        Specified by:
        containsLabels in interface AllocationPolicyOrBuilder
      • getLabelsMap

        public Map<String,​String> getLabelsMap()
         Labels applied to all VM instances and other resources
         created by AllocationPolicy.
         Labels could be user provided or system generated.
         You can assign up to 64 labels. [Google Compute Engine label
         restrictions](https://cloud.google.com/compute/docs/labeling-resources#restrictions)
         apply.
         Label names that start with "goog-" or "google-" are reserved.
         
        map<string, string> labels = 6;
        Specified by:
        getLabelsMap in interface AllocationPolicyOrBuilder
      • getLabelsOrDefault

        public String getLabelsOrDefault​(String key,
                                         String defaultValue)
         Labels applied to all VM instances and other resources
         created by AllocationPolicy.
         Labels could be user provided or system generated.
         You can assign up to 64 labels. [Google Compute Engine label
         restrictions](https://cloud.google.com/compute/docs/labeling-resources#restrictions)
         apply.
         Label names that start with "goog-" or "google-" are reserved.
         
        map<string, string> labels = 6;
        Specified by:
        getLabelsOrDefault in interface AllocationPolicyOrBuilder
      • getLabelsOrThrow

        public String getLabelsOrThrow​(String key)
         Labels applied to all VM instances and other resources
         created by AllocationPolicy.
         Labels could be user provided or system generated.
         You can assign up to 64 labels. [Google Compute Engine label
         restrictions](https://cloud.google.com/compute/docs/labeling-resources#restrictions)
         apply.
         Label names that start with "goog-" or "google-" are reserved.
         
        map<string, string> labels = 6;
        Specified by:
        getLabelsOrThrow in interface AllocationPolicyOrBuilder
      • removeLabels

        public AllocationPolicy.Builder removeLabels​(String key)
         Labels applied to all VM instances and other resources
         created by AllocationPolicy.
         Labels could be user provided or system generated.
         You can assign up to 64 labels. [Google Compute Engine label
         restrictions](https://cloud.google.com/compute/docs/labeling-resources#restrictions)
         apply.
         Label names that start with "goog-" or "google-" are reserved.
         
        map<string, string> labels = 6;
      • getMutableLabels

        @Deprecated
        public Map<String,​String> getMutableLabels()
        Deprecated.
        Use alternate mutation accessors instead.
      • putLabels

        public AllocationPolicy.Builder putLabels​(String key,
                                                  String value)
         Labels applied to all VM instances and other resources
         created by AllocationPolicy.
         Labels could be user provided or system generated.
         You can assign up to 64 labels. [Google Compute Engine label
         restrictions](https://cloud.google.com/compute/docs/labeling-resources#restrictions)
         apply.
         Label names that start with "goog-" or "google-" are reserved.
         
        map<string, string> labels = 6;
      • putAllLabels

        public AllocationPolicy.Builder putAllLabels​(Map<String,​String> values)
         Labels applied to all VM instances and other resources
         created by AllocationPolicy.
         Labels could be user provided or system generated.
         You can assign up to 64 labels. [Google Compute Engine label
         restrictions](https://cloud.google.com/compute/docs/labeling-resources#restrictions)
         apply.
         Label names that start with "goog-" or "google-" are reserved.
         
        map<string, string> labels = 6;
      • hasNetwork

        public boolean hasNetwork()
         The network policy.
         
        .google.cloud.batch.v1.AllocationPolicy.NetworkPolicy network = 7;
        Specified by:
        hasNetwork in interface AllocationPolicyOrBuilder
        Returns:
        Whether the network field is set.
      • clearNetwork

        public AllocationPolicy.Builder clearNetwork()
         The network policy.
         
        .google.cloud.batch.v1.AllocationPolicy.NetworkPolicy network = 7;
      • hasPlacement

        public boolean hasPlacement()
         The placement policy.
         
        .google.cloud.batch.v1.AllocationPolicy.PlacementPolicy placement = 10;
        Specified by:
        hasPlacement in interface AllocationPolicyOrBuilder
        Returns:
        Whether the placement field is set.
      • clearPlacement

        public AllocationPolicy.Builder clearPlacement()
         The placement policy.
         
        .google.cloud.batch.v1.AllocationPolicy.PlacementPolicy placement = 10;
      • setUnknownFields

        public final AllocationPolicy.Builder setUnknownFields​(com.google.protobuf.UnknownFieldSet unknownFields)
        Specified by:
        setUnknownFields in interface com.google.protobuf.Message.Builder
        Overrides:
        setUnknownFields in class com.google.protobuf.GeneratedMessageV3.Builder<AllocationPolicy.Builder>
      • mergeUnknownFields

        public final AllocationPolicy.Builder mergeUnknownFields​(com.google.protobuf.UnknownFieldSet unknownFields)
        Specified by:
        mergeUnknownFields in interface com.google.protobuf.Message.Builder
        Overrides:
        mergeUnknownFields in class com.google.protobuf.GeneratedMessageV3.Builder<AllocationPolicy.Builder>