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

      @Deprecated public double distanceInMeters
      Deprecated.

      Will be removed in v4.29.0. Use the WarningUpdate implementation instead.

      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

      @Deprecated @NonNull public DistanceType distanceType
      Deprecated.

      Will be removed in v4.29.0. Use the WarningStatus implementation instead.

      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

      @Deprecated public TruckRestrictionWarning(int id, @Deprecated double distanceInMeters, @Nullable WeightRestriction weightRestriction, @Nullable DimensionRestriction dimensionRestriction, @Deprecated @NonNull DistanceType distanceType, @Nullable IntegerRange trailerCount, @Nullable TimeRule timeRule, @Nullable TruckRoadType truckRoadType, @NonNull List<HazardousMaterial> hazardousMaterials, @Nullable TunnelCategory tunnelCategory, @Nullable IntegerRange axleCount)
      Deprecated.

      Will be removed in v4.29.0. Use the constructor without deprecated fields instead.

      Creates a new instance.

      Parameters:
      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 -

      The distance from the current location to the restriction.

      weightRestriction -

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

      dimensionRestriction -

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

      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 -

      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 -

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

      truckRoadType -

      Truck road type restriction.

      hazardousMaterials -

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

      tunnelCategory -

      Tunnel category.

      axleCount -

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

  • 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.