Package com.google.maps.routing.v2
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>
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 enumgoogle.maps.routing.v2.TrafficModel
-
-
Enum Constant Summary
Enum Constants Enum Constant Description BEST_GUESSIndicates that the returned `duration` should be the best estimate of travel time given what is known about both historical traffic conditions and live traffic.OPTIMISTICIndicates 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.PESSIMISTICIndicates 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_UNSPECIFIEDUnused.UNRECOGNIZED
-
Field Summary
Fields Modifier and Type Field Description static intBEST_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.static intOPTIMISTIC_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.static intPESSIMISTIC_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.static intTRAFFIC_MODEL_UNSPECIFIED_VALUEUnused.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static TrafficModelforNumber(int value)static com.google.protobuf.Descriptors.EnumDescriptorgetDescriptor()com.google.protobuf.Descriptors.EnumDescriptorgetDescriptorForType()intgetNumber()com.google.protobuf.Descriptors.EnumValueDescriptorgetValueDescriptor()static com.google.protobuf.Internal.EnumLiteMap<TrafficModel>internalGetValueMap()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 TrafficModelvalueOf(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.
-
-
-
Enum Constant Detail
-
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 Detail
-
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:
- Constant Field Values
-
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:
- Constant Field Values
-
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:
- Constant Field Values
-
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:
- Constant Field Values
-
-
Method Detail
-
values
public static TrafficModel[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (TrafficModel c : TrafficModel.values()) System.out.println(c);
- 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 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 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 nameNullPointerException- 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:
getValueDescriptorin interfacecom.google.protobuf.ProtocolMessageEnum
-
getDescriptorForType
public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType()
- Specified by:
getDescriptorForTypein interfacecom.google.protobuf.ProtocolMessageEnum
-
getDescriptor
public static final 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 nameNullPointerException- if the argument is null
-
-