Class TruckRestrictionWarning

java.lang.Object
com.here.sdk.navigation.TruckRestrictionWarning

public final class TruckRestrictionWarning extends Object

Represents truck restrictions. For example, there can be a bridge ahead not high enough to pass a big truck or there can be a road ahead where the truck’s weight exceeds the permissible limit.

  • Field Details

    • id

      public int id

      Unique identifier for this specific truck restriction warning instance. Each warning type (truck restrictions, speed warnings, etc.) maintains its own independent ID namespace. Use this ID to track, update, or dismiss individual warning instances of this type.

    • distanceInMeters

      public double distanceInMeters

      The distance from the current location to the restriction.

    • weightRestriction

      @Nullable public WeightRestriction weightRestriction

      Weight restriction. It is null when there is no known weight restriction ahead.

    • dimensionRestriction

      @Nullable public DimensionRestriction dimensionRestriction

      Vehicle dimension restrictions. It is null when there is no known dimension restriction ahead.

    • distanceType

      @NonNull public DistanceType distanceType

      Indicates if the specified truck restriction is ahead of the vehicle or has just passed by. If it is ahead, then distanceInMeters is greater than 0.

    • trailerCount

      @Nullable public IntegerRange trailerCount

      The trailer count for which the current restriction applies. If the field is 'null' then the current restriction does not have a condition based on trailers count.

    • timeRule

      @Nullable public TimeRule timeRule

      Time rule indicating the time periods for which the restriction applies. If the field is 'null' then the restriction is applicable at anytime.

    • truckRoadType

      @Nullable public TruckRoadType truckRoadType

      Truck road type restriction.

    • hazardousMaterials

      @NonNull public List<HazardousMaterial> hazardousMaterials

      The list of hazardous materials which are restricted on the road section for which the warning applies.

    • tunnelCategory

      @Nullable public TunnelCategory tunnelCategory

      Tunnel category.

    • axleCount

      @Nullable public IntegerRange axleCount

      The axle count for which the current restriction applies. If this field is null, the restriction does not depend on axle count.

  • Constructor Details

    • TruckRestrictionWarning

      public TruckRestrictionWarning(double distanceInMeters, @NonNull DistanceType distanceType)

      Creates a new instance.

      Parameters:
      distanceInMeters -

      The distance from the current location to the restriction.

      distanceType -

      Indicates if the specified truck restriction is ahead of the vehicle or has just passed by. If it is ahead, then distanceInMeters is greater than 0.

  • Method Details

    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • isGeneral

      public boolean isGeneral()

      Checks if this truck restriction warning is general. A general warning has no specific restriction conditions set. Please note that time rule still might be set for a general warning, but it is not considered as a specific restriction condition. This method only checks that no specific conditions are set for the warning.

      Returns:

      true if all restriction fields are null or empty, false otherwise.