Enum TrafficModel

java.lang.Object
java.lang.Enum<TrafficModel>
com.google.maps.routing.v2.TrafficModel
All Implemented Interfaces:
com.google.protobuf.Internal.EnumLite, com.google.protobuf.ProtocolMessageEnum, Serializable, Comparable<TrafficModel>

@Generated public enum TrafficModel extends Enum<TrafficModel> implements com.google.protobuf.ProtocolMessageEnum
 This field specifies one of the following assumptions to use when calculating
 travel time in traffic conditions, shown in the enums below. Depending on the
 enum chosen, the `duration` field of the TrafficModel response will vary. The
 value contains the predicted time to destination in traffic, based on
 historical averages. `TrafficModel` is only available for requests that have
 set [`RoutingPreference`][google.maps.routing.v2.RoutingPreference] to
 `TRAFFIC_AWARE_OPTIMAL` and
 [`RouteTravelMode`][google.maps.routing.v2.RouteTravelMode] to `DRIVE`.
 
Protobuf enum google.maps.routing.v2.TrafficModel
  • Enum Constant Summary

    Enum Constants
    Enum Constant
    Description
    Indicates that the returned `duration` should be the best estimate of travel time given what is known about both historical traffic conditions and live traffic.
    Indicates that the returned duration should be shorter than the actual travel time on most days, though occasional days with particularly good traffic conditions may be faster than this value.
    Indicates that the returned duration should be longer than the actual travel time on most days, though occasional days with particularly bad traffic conditions may exceed this value.
    Unused.
     
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    Indicates that the returned `duration` should be the best estimate of travel time given what is known about both historical traffic conditions and live traffic.
    static final int
    Indicates that the returned duration should be shorter than the actual travel time on most days, though occasional days with particularly good traffic conditions may be faster than this value.
    static final int
    Indicates that the returned duration should be longer than the actual travel time on most days, though occasional days with particularly bad traffic conditions may exceed this value.
    static final int
    Unused.
  • Method Summary

    Modifier and Type
    Method
    Description
    forNumber(int value)
     
    static com.google.protobuf.Descriptors.EnumDescriptor
     
    final com.google.protobuf.Descriptors.EnumDescriptor
     
    final int
     
    final com.google.protobuf.Descriptors.EnumValueDescriptor
     
    static com.google.protobuf.Internal.EnumLiteMap<TrafficModel>
     
    valueOf(int value)
    Deprecated.
    valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc)
    Returns the enum constant of this type with the specified name.
    Returns the enum constant of this type with the specified name.
    static TrafficModel[]
    Returns an array containing the constants of this enum type, in the order they are declared.

    Methods inherited from class java.lang.Enum

    clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait
  • Enum Constant Details

    • TRAFFIC_MODEL_UNSPECIFIED

      public static final TrafficModel TRAFFIC_MODEL_UNSPECIFIED
       Unused. If specified, will default to `BEST_GUESS`.
       
      TRAFFIC_MODEL_UNSPECIFIED = 0;
    • BEST_GUESS

      public static final TrafficModel BEST_GUESS
       Indicates that the returned `duration` should be the best
       estimate of travel time given what is known about both historical traffic
       conditions and live traffic. Live traffic becomes more important the closer
       the `departure_time` is to now.
       
      BEST_GUESS = 1;
    • PESSIMISTIC

      public static final TrafficModel PESSIMISTIC
       Indicates that the returned duration should be longer than the
       actual travel time on most days, though occasional days with particularly
       bad traffic conditions may exceed this value.
       
      PESSIMISTIC = 2;
    • OPTIMISTIC

      public static final TrafficModel OPTIMISTIC
       Indicates that the returned duration should be shorter than the actual
       travel time on most days, though occasional days with particularly good
       traffic conditions may be faster than this value.
       
      OPTIMISTIC = 3;
    • UNRECOGNIZED

      public static final TrafficModel UNRECOGNIZED
  • Field Details

    • TRAFFIC_MODEL_UNSPECIFIED_VALUE

      public static final int TRAFFIC_MODEL_UNSPECIFIED_VALUE
       Unused. If specified, will default to `BEST_GUESS`.
       
      TRAFFIC_MODEL_UNSPECIFIED = 0;
      See Also:
    • BEST_GUESS_VALUE

      public static final int BEST_GUESS_VALUE
       Indicates that the returned `duration` should be the best
       estimate of travel time given what is known about both historical traffic
       conditions and live traffic. Live traffic becomes more important the closer
       the `departure_time` is to now.
       
      BEST_GUESS = 1;
      See Also:
    • PESSIMISTIC_VALUE

      public static final int PESSIMISTIC_VALUE
       Indicates that the returned duration should be longer than the
       actual travel time on most days, though occasional days with particularly
       bad traffic conditions may exceed this value.
       
      PESSIMISTIC = 2;
      See Also:
    • OPTIMISTIC_VALUE

      public static final int OPTIMISTIC_VALUE
       Indicates that the returned duration should be shorter than the actual
       travel time on most days, though occasional days with particularly good
       traffic conditions may be faster than this value.
       
      OPTIMISTIC = 3;
      See Also:
  • Method Details

    • values

      public static TrafficModel[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static TrafficModel valueOf(String name)
      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum type has no constant with the specified name
      NullPointerException - if the argument is null
    • getNumber

      public final int getNumber()
      Specified by:
      getNumber in interface com.google.protobuf.Internal.EnumLite
      Specified by:
      getNumber in interface com.google.protobuf.ProtocolMessageEnum
    • valueOf

      @Deprecated public static TrafficModel valueOf(int value)
      Deprecated.
      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
      Parameters:
      value - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum type has no constant with the specified name
      NullPointerException - if the argument is null
    • forNumber

      public static TrafficModel forNumber(int value)
      Parameters:
      value - The numeric wire value of the corresponding enum entry.
      Returns:
      The enum associated with the given numeric wire value.
    • internalGetValueMap

      public static com.google.protobuf.Internal.EnumLiteMap<TrafficModel> internalGetValueMap()
    • getValueDescriptor

      public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor()
      Specified by:
      getValueDescriptor in interface com.google.protobuf.ProtocolMessageEnum
    • getDescriptorForType

      public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType()
      Specified by:
      getDescriptorForType in interface com.google.protobuf.ProtocolMessageEnum
    • getDescriptor

      public static com.google.protobuf.Descriptors.EnumDescriptor getDescriptor()
    • valueOf

      public static TrafficModel valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc)
      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
      Parameters:
      desc - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum type has no constant with the specified name
      NullPointerException - if the argument is null