public enum TrafficModel extends Enum<TrafficModel> implements com.google.protobuf.ProtocolMessageEnum
Specifies the assumptions to use when calculating time in traffic. This setting affects the value returned in the `duration` field in the response, which contains the predicted time in traffic based on historical averages.Protobuf enum
google.maps.routing.v2.TrafficModel| Enum Constant and Description |
|---|
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.
|
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.
|
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.
|
TRAFFIC_MODEL_UNSPECIFIED
Unused.
|
UNRECOGNIZED |
| Modifier and Type | Field and Description |
|---|---|
static 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.
|
static 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.
|
static 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.
|
static int |
TRAFFIC_MODEL_UNSPECIFIED_VALUE
Unused.
|
| Modifier and Type | Method and Description |
|---|---|
static TrafficModel |
forNumber(int value) |
static com.google.protobuf.Descriptors.EnumDescriptor |
getDescriptor() |
com.google.protobuf.Descriptors.EnumDescriptor |
getDescriptorForType() |
int |
getNumber() |
com.google.protobuf.Descriptors.EnumValueDescriptor |
getValueDescriptor() |
static com.google.protobuf.Internal.EnumLiteMap<TrafficModel> |
internalGetValueMap() |
static TrafficModel |
valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) |
static TrafficModel |
valueOf(int value)
Deprecated.
Use
forNumber(int) instead. |
static TrafficModel |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static TrafficModel[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final TrafficModel TRAFFIC_MODEL_UNSPECIFIED
Unused. If specified, will default to `BEST_GUESS`.
TRAFFIC_MODEL_UNSPECIFIED = 0;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;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;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;public static final TrafficModel UNRECOGNIZED
public static final int TRAFFIC_MODEL_UNSPECIFIED_VALUE
Unused. If specified, will default to `BEST_GUESS`.
TRAFFIC_MODEL_UNSPECIFIED = 0;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;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;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;public static TrafficModel[] values()
for (TrafficModel c : TrafficModel.values()) System.out.println(c);
public static TrafficModel valueOf(String name)
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is nullpublic final int getNumber()
getNumber in interface com.google.protobuf.Internal.EnumLitegetNumber in interface com.google.protobuf.ProtocolMessageEnum@Deprecated public static TrafficModel valueOf(int value)
forNumber(int) instead.value - The numeric wire value of the corresponding enum entry.public static TrafficModel forNumber(int value)
value - The numeric wire value of the corresponding enum entry.public static com.google.protobuf.Internal.EnumLiteMap<TrafficModel> internalGetValueMap()
public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor()
getValueDescriptor in interface com.google.protobuf.ProtocolMessageEnumpublic final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType()
getDescriptorForType in interface com.google.protobuf.ProtocolMessageEnumpublic static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor()
public static TrafficModel valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc)
Copyright © 2025 Google LLC. All rights reserved.