Class Rollout.TrafficPercentStrategy.Builder

java.lang.Object
com.google.protobuf.AbstractMessageLite.Builder
com.google.protobuf.AbstractMessage.Builder<BuilderT>
com.google.protobuf.GeneratedMessage.Builder<Rollout.TrafficPercentStrategy.Builder>
com.google.api.servicemanagement.v1.Rollout.TrafficPercentStrategy.Builder
All Implemented Interfaces:
Rollout.TrafficPercentStrategyOrBuilder, com.google.protobuf.Message.Builder, com.google.protobuf.MessageLite.Builder, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, Cloneable
Enclosing class:
Rollout.TrafficPercentStrategy

public static final class Rollout.TrafficPercentStrategy.Builder extends com.google.protobuf.GeneratedMessage.Builder<Rollout.TrafficPercentStrategy.Builder> implements Rollout.TrafficPercentStrategyOrBuilder
 Strategy that specifies how clients of Google Service Controller want to
 send traffic to use different config versions. This is generally
 used by API proxy to split traffic based on your configured percentage for
 each config version.

 One example of how to gradually rollout a new service configuration using
 this
 strategy:
 Day 1

 Rollout {
 id: "example.googleapis.com/rollout_20160206"
 traffic_percent_strategy {
 percentages: {
 "example.googleapis.com/20160201": 70.00
 "example.googleapis.com/20160206": 30.00
 }
 }
 }

 Day 2

 Rollout {
 id: "example.googleapis.com/rollout_20160207"
 traffic_percent_strategy: {
 percentages: {
 "example.googleapis.com/20160206": 100.00
 }
 }
 }
 
Protobuf type google.api.servicemanagement.v1.Rollout.TrafficPercentStrategy
  • Method Details

    • getDescriptor

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

      protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection(int number)
      Overrides:
      internalGetMapFieldReflection in class com.google.protobuf.GeneratedMessage.Builder<Rollout.TrafficPercentStrategy.Builder>
    • internalGetMutableMapFieldReflection

      protected com.google.protobuf.MapFieldReflectionAccessor internalGetMutableMapFieldReflection(int number)
      Overrides:
      internalGetMutableMapFieldReflection in class com.google.protobuf.GeneratedMessage.Builder<Rollout.TrafficPercentStrategy.Builder>
    • internalGetFieldAccessorTable

      protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()
      Specified by:
      internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessage.Builder<Rollout.TrafficPercentStrategy.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.GeneratedMessage.Builder<Rollout.TrafficPercentStrategy.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.GeneratedMessage.Builder<Rollout.TrafficPercentStrategy.Builder>
    • getDefaultInstanceForType

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

      Specified by:
      build in interface com.google.protobuf.Message.Builder
      Specified by:
      build in interface com.google.protobuf.MessageLite.Builder
    • buildPartial

      public Rollout.TrafficPercentStrategy buildPartial()
      Specified by:
      buildPartial in interface com.google.protobuf.Message.Builder
      Specified by:
      buildPartial in interface com.google.protobuf.MessageLite.Builder
    • mergeFrom

      public Rollout.TrafficPercentStrategy.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<Rollout.TrafficPercentStrategy.Builder>
    • mergeFrom

    • isInitialized

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

      public Rollout.TrafficPercentStrategy.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<Rollout.TrafficPercentStrategy.Builder>
      Throws:
      IOException
    • getPercentagesCount

      public int getPercentagesCount()
      Description copied from interface: Rollout.TrafficPercentStrategyOrBuilder
       Maps service configuration IDs to their corresponding traffic percentage.
       Key is the service configuration ID, Value is the traffic percentage
       which must be greater than 0.0 and the sum must equal to 100.0.
       
      map<string, double> percentages = 1;
      Specified by:
      getPercentagesCount in interface Rollout.TrafficPercentStrategyOrBuilder
    • containsPercentages

      public boolean containsPercentages(String key)
       Maps service configuration IDs to their corresponding traffic percentage.
       Key is the service configuration ID, Value is the traffic percentage
       which must be greater than 0.0 and the sum must equal to 100.0.
       
      map<string, double> percentages = 1;
      Specified by:
      containsPercentages in interface Rollout.TrafficPercentStrategyOrBuilder
    • getPercentages

      @Deprecated public Map<String,Double> getPercentages()
      Deprecated.
      Use getPercentagesMap() instead.
      Specified by:
      getPercentages in interface Rollout.TrafficPercentStrategyOrBuilder
    • getPercentagesMap

      public Map<String,Double> getPercentagesMap()
       Maps service configuration IDs to their corresponding traffic percentage.
       Key is the service configuration ID, Value is the traffic percentage
       which must be greater than 0.0 and the sum must equal to 100.0.
       
      map<string, double> percentages = 1;
      Specified by:
      getPercentagesMap in interface Rollout.TrafficPercentStrategyOrBuilder
    • getPercentagesOrDefault

      public double getPercentagesOrDefault(String key, double defaultValue)
       Maps service configuration IDs to their corresponding traffic percentage.
       Key is the service configuration ID, Value is the traffic percentage
       which must be greater than 0.0 and the sum must equal to 100.0.
       
      map<string, double> percentages = 1;
      Specified by:
      getPercentagesOrDefault in interface Rollout.TrafficPercentStrategyOrBuilder
    • getPercentagesOrThrow

      public double getPercentagesOrThrow(String key)
       Maps service configuration IDs to their corresponding traffic percentage.
       Key is the service configuration ID, Value is the traffic percentage
       which must be greater than 0.0 and the sum must equal to 100.0.
       
      map<string, double> percentages = 1;
      Specified by:
      getPercentagesOrThrow in interface Rollout.TrafficPercentStrategyOrBuilder
    • clearPercentages

      public Rollout.TrafficPercentStrategy.Builder clearPercentages()
    • removePercentages

      public Rollout.TrafficPercentStrategy.Builder removePercentages(String key)
       Maps service configuration IDs to their corresponding traffic percentage.
       Key is the service configuration ID, Value is the traffic percentage
       which must be greater than 0.0 and the sum must equal to 100.0.
       
      map<string, double> percentages = 1;
    • getMutablePercentages

      @Deprecated public Map<String,Double> getMutablePercentages()
      Deprecated.
      Use alternate mutation accessors instead.
    • putPercentages

      public Rollout.TrafficPercentStrategy.Builder putPercentages(String key, double value)
       Maps service configuration IDs to their corresponding traffic percentage.
       Key is the service configuration ID, Value is the traffic percentage
       which must be greater than 0.0 and the sum must equal to 100.0.
       
      map<string, double> percentages = 1;
    • putAllPercentages

      public Rollout.TrafficPercentStrategy.Builder putAllPercentages(Map<String,Double> values)
       Maps service configuration IDs to their corresponding traffic percentage.
       Key is the service configuration ID, Value is the traffic percentage
       which must be greater than 0.0 and the sum must equal to 100.0.
       
      map<string, double> percentages = 1;