Class RouteMatrixElement

  • All Implemented Interfaces:
    RouteMatrixElementOrBuilder, com.google.protobuf.Message, com.google.protobuf.MessageLite, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, Serializable

    public final class RouteMatrixElement
    extends com.google.protobuf.GeneratedMessageV3
    implements RouteMatrixElementOrBuilder
     Contains route information computed for an origin/destination pair in the
     ComputeRouteMatrix API. This proto can be streamed to the client.
     
    Protobuf type google.maps.routing.v2.RouteMatrixElement
    See Also:
    Serialized Form
    • Field Detail

      • ORIGIN_INDEX_FIELD_NUMBER

        public static final int ORIGIN_INDEX_FIELD_NUMBER
        See Also:
        Constant Field Values
      • DESTINATION_INDEX_FIELD_NUMBER

        public static final int DESTINATION_INDEX_FIELD_NUMBER
        See Also:
        Constant Field Values
      • DISTANCE_METERS_FIELD_NUMBER

        public static final int DISTANCE_METERS_FIELD_NUMBER
        See Also:
        Constant Field Values
      • STATIC_DURATION_FIELD_NUMBER

        public static final int STATIC_DURATION_FIELD_NUMBER
        See Also:
        Constant Field Values
      • TRAVEL_ADVISORY_FIELD_NUMBER

        public static final int TRAVEL_ADVISORY_FIELD_NUMBER
        See Also:
        Constant Field Values
      • FALLBACK_INFO_FIELD_NUMBER

        public static final int FALLBACK_INFO_FIELD_NUMBER
        See Also:
        Constant Field Values
      • LOCALIZED_VALUES_FIELD_NUMBER

        public static final int LOCALIZED_VALUES_FIELD_NUMBER
        See Also:
        Constant Field Values
    • Method Detail

      • newInstance

        protected Object newInstance​(com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter unused)
        Overrides:
        newInstance in class com.google.protobuf.GeneratedMessageV3
      • getDescriptor

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

        protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
        Specified by:
        internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessageV3
      • hasOriginIndex

        public boolean hasOriginIndex()
         Zero-based index of the origin in the request.
         
        optional int32 origin_index = 1;
        Specified by:
        hasOriginIndex in interface RouteMatrixElementOrBuilder
        Returns:
        Whether the originIndex field is set.
      • getOriginIndex

        public int getOriginIndex()
         Zero-based index of the origin in the request.
         
        optional int32 origin_index = 1;
        Specified by:
        getOriginIndex in interface RouteMatrixElementOrBuilder
        Returns:
        The originIndex.
      • hasDestinationIndex

        public boolean hasDestinationIndex()
         Zero-based index of the destination in the request.
         
        optional int32 destination_index = 2;
        Specified by:
        hasDestinationIndex in interface RouteMatrixElementOrBuilder
        Returns:
        Whether the destinationIndex field is set.
      • getDestinationIndex

        public int getDestinationIndex()
         Zero-based index of the destination in the request.
         
        optional int32 destination_index = 2;
        Specified by:
        getDestinationIndex in interface RouteMatrixElementOrBuilder
        Returns:
        The destinationIndex.
      • hasStatus

        public boolean hasStatus()
         Error status code for this element.
         
        .google.rpc.Status status = 3;
        Specified by:
        hasStatus in interface RouteMatrixElementOrBuilder
        Returns:
        Whether the status field is set.
      • getStatus

        public com.google.rpc.Status getStatus()
         Error status code for this element.
         
        .google.rpc.Status status = 3;
        Specified by:
        getStatus in interface RouteMatrixElementOrBuilder
        Returns:
        The status.
      • getConditionValue

        public int getConditionValue()
         Indicates whether the route was found or not. Independent of status.
         
        .google.maps.routing.v2.RouteMatrixElementCondition condition = 9;
        Specified by:
        getConditionValue in interface RouteMatrixElementOrBuilder
        Returns:
        The enum numeric value on the wire for condition.
      • getDistanceMeters

        public int getDistanceMeters()
         The travel distance of the route, in meters.
         
        int32 distance_meters = 4;
        Specified by:
        getDistanceMeters in interface RouteMatrixElementOrBuilder
        Returns:
        The distanceMeters.
      • hasDuration

        public boolean hasDuration()
         The length of time needed to navigate the route. If you set the
         [routing_preference][google.maps.routing.v2.ComputeRouteMatrixRequest.routing_preference]
         to `TRAFFIC_UNAWARE`, then this value is the same as `static_duration`. If
         you set the `routing_preference` to either `TRAFFIC_AWARE` or
         `TRAFFIC_AWARE_OPTIMAL`, then this value is calculated taking traffic
         conditions into account.
         
        .google.protobuf.Duration duration = 5;
        Specified by:
        hasDuration in interface RouteMatrixElementOrBuilder
        Returns:
        Whether the duration field is set.
      • getDuration

        public com.google.protobuf.Duration getDuration()
         The length of time needed to navigate the route. If you set the
         [routing_preference][google.maps.routing.v2.ComputeRouteMatrixRequest.routing_preference]
         to `TRAFFIC_UNAWARE`, then this value is the same as `static_duration`. If
         you set the `routing_preference` to either `TRAFFIC_AWARE` or
         `TRAFFIC_AWARE_OPTIMAL`, then this value is calculated taking traffic
         conditions into account.
         
        .google.protobuf.Duration duration = 5;
        Specified by:
        getDuration in interface RouteMatrixElementOrBuilder
        Returns:
        The duration.
      • getDurationOrBuilder

        public com.google.protobuf.DurationOrBuilder getDurationOrBuilder()
         The length of time needed to navigate the route. If you set the
         [routing_preference][google.maps.routing.v2.ComputeRouteMatrixRequest.routing_preference]
         to `TRAFFIC_UNAWARE`, then this value is the same as `static_duration`. If
         you set the `routing_preference` to either `TRAFFIC_AWARE` or
         `TRAFFIC_AWARE_OPTIMAL`, then this value is calculated taking traffic
         conditions into account.
         
        .google.protobuf.Duration duration = 5;
        Specified by:
        getDurationOrBuilder in interface RouteMatrixElementOrBuilder
      • hasStaticDuration

        public boolean hasStaticDuration()
         The duration of traveling through the route without taking traffic
         conditions into consideration.
         
        .google.protobuf.Duration static_duration = 6;
        Specified by:
        hasStaticDuration in interface RouteMatrixElementOrBuilder
        Returns:
        Whether the staticDuration field is set.
      • getStaticDuration

        public com.google.protobuf.Duration getStaticDuration()
         The duration of traveling through the route without taking traffic
         conditions into consideration.
         
        .google.protobuf.Duration static_duration = 6;
        Specified by:
        getStaticDuration in interface RouteMatrixElementOrBuilder
        Returns:
        The staticDuration.
      • getStaticDurationOrBuilder

        public com.google.protobuf.DurationOrBuilder getStaticDurationOrBuilder()
         The duration of traveling through the route without taking traffic
         conditions into consideration.
         
        .google.protobuf.Duration static_duration = 6;
        Specified by:
        getStaticDurationOrBuilder in interface RouteMatrixElementOrBuilder
      • hasTravelAdvisory

        public boolean hasTravelAdvisory()
         Additional information about the route. For example: restriction
         information and toll information
         
        .google.maps.routing.v2.RouteTravelAdvisory travel_advisory = 7;
        Specified by:
        hasTravelAdvisory in interface RouteMatrixElementOrBuilder
        Returns:
        Whether the travelAdvisory field is set.
      • getTravelAdvisory

        public RouteTravelAdvisory getTravelAdvisory()
         Additional information about the route. For example: restriction
         information and toll information
         
        .google.maps.routing.v2.RouteTravelAdvisory travel_advisory = 7;
        Specified by:
        getTravelAdvisory in interface RouteMatrixElementOrBuilder
        Returns:
        The travelAdvisory.
      • hasFallbackInfo

        public boolean hasFallbackInfo()
         In some cases when the server is not able to compute the route with the
         given preferences for this particular origin/destination pair, it may
         fall back to using a different mode of computation. When fallback mode is
         used, this field contains detailed information about the fallback response.
         Otherwise this field is unset.
         
        .google.maps.routing.v2.FallbackInfo fallback_info = 8;
        Specified by:
        hasFallbackInfo in interface RouteMatrixElementOrBuilder
        Returns:
        Whether the fallbackInfo field is set.
      • getFallbackInfo

        public FallbackInfo getFallbackInfo()
         In some cases when the server is not able to compute the route with the
         given preferences for this particular origin/destination pair, it may
         fall back to using a different mode of computation. When fallback mode is
         used, this field contains detailed information about the fallback response.
         Otherwise this field is unset.
         
        .google.maps.routing.v2.FallbackInfo fallback_info = 8;
        Specified by:
        getFallbackInfo in interface RouteMatrixElementOrBuilder
        Returns:
        The fallbackInfo.
      • getFallbackInfoOrBuilder

        public FallbackInfoOrBuilder getFallbackInfoOrBuilder()
         In some cases when the server is not able to compute the route with the
         given preferences for this particular origin/destination pair, it may
         fall back to using a different mode of computation. When fallback mode is
         used, this field contains detailed information about the fallback response.
         Otherwise this field is unset.
         
        .google.maps.routing.v2.FallbackInfo fallback_info = 8;
        Specified by:
        getFallbackInfoOrBuilder in interface RouteMatrixElementOrBuilder
      • hasLocalizedValues

        public boolean hasLocalizedValues()
         Text representations of properties of the `RouteMatrixElement`.
         
        .google.maps.routing.v2.RouteMatrixElement.LocalizedValues localized_values = 10;
        Specified by:
        hasLocalizedValues in interface RouteMatrixElementOrBuilder
        Returns:
        Whether the localizedValues field is set.
      • isInitialized

        public final boolean isInitialized()
        Specified by:
        isInitialized in interface com.google.protobuf.MessageLiteOrBuilder
        Overrides:
        isInitialized in class com.google.protobuf.GeneratedMessageV3
      • writeTo

        public void writeTo​(com.google.protobuf.CodedOutputStream output)
                     throws IOException
        Specified by:
        writeTo in interface com.google.protobuf.MessageLite
        Overrides:
        writeTo in class com.google.protobuf.GeneratedMessageV3
        Throws:
        IOException
      • getSerializedSize

        public int getSerializedSize()
        Specified by:
        getSerializedSize in interface com.google.protobuf.MessageLite
        Overrides:
        getSerializedSize in class com.google.protobuf.GeneratedMessageV3
      • equals

        public boolean equals​(Object obj)
        Specified by:
        equals in interface com.google.protobuf.Message
        Overrides:
        equals in class com.google.protobuf.AbstractMessage
      • hashCode

        public int hashCode()
        Specified by:
        hashCode in interface com.google.protobuf.Message
        Overrides:
        hashCode in class com.google.protobuf.AbstractMessage
      • parseFrom

        public static RouteMatrixElement parseFrom​(ByteBuffer data)
                                            throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static RouteMatrixElement parseFrom​(ByteBuffer data,
                                                   com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                            throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static RouteMatrixElement parseFrom​(com.google.protobuf.ByteString data)
                                            throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static RouteMatrixElement parseFrom​(com.google.protobuf.ByteString data,
                                                   com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                            throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static RouteMatrixElement parseFrom​(byte[] data)
                                            throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static RouteMatrixElement parseFrom​(byte[] data,
                                                   com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                            throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static RouteMatrixElement parseFrom​(com.google.protobuf.CodedInputStream input,
                                                   com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                            throws IOException
        Throws:
        IOException
      • newBuilderForType

        public RouteMatrixElement.Builder newBuilderForType()
        Specified by:
        newBuilderForType in interface com.google.protobuf.Message
        Specified by:
        newBuilderForType in interface com.google.protobuf.MessageLite
      • toBuilder

        public RouteMatrixElement.Builder toBuilder()
        Specified by:
        toBuilder in interface com.google.protobuf.Message
        Specified by:
        toBuilder in interface com.google.protobuf.MessageLite
      • newBuilderForType

        protected RouteMatrixElement.Builder newBuilderForType​(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)
        Specified by:
        newBuilderForType in class com.google.protobuf.GeneratedMessageV3
      • getParserForType

        public com.google.protobuf.Parser<RouteMatrixElement> getParserForType()
        Specified by:
        getParserForType in interface com.google.protobuf.Message
        Specified by:
        getParserForType in interface com.google.protobuf.MessageLite
        Overrides:
        getParserForType in class com.google.protobuf.GeneratedMessageV3
      • getDefaultInstanceForType

        public RouteMatrixElement getDefaultInstanceForType()
        Specified by:
        getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuilder
        Specified by:
        getDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilder