Package com.google.maps.routing.v2
Enum 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 ConstantsEnum ConstantDescriptionIndicates 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
FieldsModifier and TypeFieldDescriptionstatic final intIndicates 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 intIndicates 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 intIndicates 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 intUnused. -
Method Summary
Modifier and TypeMethodDescriptionstatic TrafficModelforNumber(int value) static com.google.protobuf.Descriptors.EnumDescriptorfinal com.google.protobuf.Descriptors.EnumDescriptorfinal intfinal com.google.protobuf.Descriptors.EnumValueDescriptorstatic com.google.protobuf.Internal.EnumLiteMap<TrafficModel>static TrafficModelvalueOf(int value) Deprecated.static TrafficModelvalueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) Returns the enum constant of this type with the specified name.static TrafficModelReturns 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.
-
Enum Constant Details
-
TRAFFIC_MODEL_UNSPECIFIED
Unused. If specified, will default to `BEST_GUESS`.
TRAFFIC_MODEL_UNSPECIFIED = 0; -
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
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
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
-
-
Field Details
-
TRAFFIC_MODEL_UNSPECIFIED_VALUE
public static final int TRAFFIC_MODEL_UNSPECIFIED_VALUEUnused. If specified, will default to `BEST_GUESS`.
TRAFFIC_MODEL_UNSPECIFIED = 0;- See Also:
-
BEST_GUESS_VALUE
public static final int BEST_GUESS_VALUEIndicates 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_VALUEIndicates 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_VALUEIndicates 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
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
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 nameNullPointerException- if the argument is null
-
getNumber
public final int getNumber()- Specified by:
getNumberin interfacecom.google.protobuf.Internal.EnumLite- Specified by:
getNumberin interfacecom.google.protobuf.ProtocolMessageEnum
-
valueOf
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 nameNullPointerException- if the argument is null
-
forNumber
- Parameters:
value- The numeric wire value of the corresponding enum entry.- Returns:
- The enum associated with the given numeric wire value.
-
internalGetValueMap
-
getValueDescriptor
public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor()- Specified by:
getValueDescriptorin interfacecom.google.protobuf.ProtocolMessageEnum
-
getDescriptorForType
public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType()- Specified by:
getDescriptorForTypein interfacecom.google.protobuf.ProtocolMessageEnum
-
getDescriptor
public static com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() -
valueOf
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 nameNullPointerException- if the argument is null
-