com.here.msdkui.routing

## Class WaypointEntry

- java.lang.Object
- - com.here.msdkui.routing.WaypointEntry

-     public class WaypointEntry
      extends java.lang.Object

  A convenience class that wraps `RouteWaypoint` and adds additional methods.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `WaypointEntry(int resourceIdLabel)` Constructs a new instance using the given resource id label.
    `WaypointEntry(com.here.android.mpa.routing.RouteWaypoint waypoint)` Constructs a new instance using the given `RouteWaypoint`.
    `WaypointEntry(com.here.android.mpa.routing.RouteWaypoint waypoint, int resourceIdLabel)` Constructs a new instance using the given `RouteWaypoint` and resource id label.
    `WaypointEntry(com.here.android.mpa.routing.RouteWaypoint waypoint, java.lang.String label)` Constructs a new instance using the given `RouteWaypoint` and string label.
    `WaypointEntry(java.lang.String label)` Constructs a new instance using the given string label.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.lang.String` | `getLabel(android.content.Context context, java.lang.String defaultValue)` Gets label to be shown for this instance.
    `int` | `getResourceIdLabel()` Gets the resource string id associated with this instance.
    `com.here.android.mpa.routing.RouteWaypoint` | `getRouteWaypoint()` Gets the `RouteWaypoint` associated with this instance.
    `java.lang.String` | `getStringLabel()` Gets the string label associated with this instance.
    `boolean` | `isDraggable()` Indicates whether this instance is draggable when used as an element of a `WaypointList`.
    `boolean` | `isRemovable()` Indicates whether this instance is removable when used as an element of a `WaypointList`.
    `boolean` | `isValid()` Indicates whether this instance contains a valid coordinate.
    `WaypointEntry` | `setDraggable(boolean draggable)` Sets this instance to be draggable when used as an element of a `WaypointList`.
    `WaypointEntry` | `setRemovable(boolean removable)` Sets this instance to be removable when used as an element of a `WaypointList`.
    `WaypointEntry` | `setResourceIdLabel(int stringId)` Sets the resource id label to this instance.
    `WaypointEntry` | `setRouteWaypoint(com.here.android.mpa.routing.RouteWaypoint routeWaypoint)` Sets the `RouteWaypoint` for this instance.
    `WaypointEntry` | `setStringLabel(java.lang.String label)` Sets the string label to this instance.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### WaypointEntry

          public WaypointEntry(java.lang.String label)

      Constructs a new instance using the given string label.

      Note that this does not set a default `GeoCoordinate`.

      Parameters:
        `label` - the text to show in the `WaypointList`.

    - #### WaypointEntry

          public WaypointEntry(@StringRes
                               int resourceIdLabel)

      Constructs a new instance using the given resource id label. For more information about resource id label see `(int)`

      Note that this does not set a default `GeoCoordinate`.

      Parameters:
        `resourceIdLabel` - the resource id of a string to show in the `WaypointList`.

    - #### WaypointEntry

          public WaypointEntry(com.here.android.mpa.routing.RouteWaypoint waypoint)

      Constructs a new instance using the given `RouteWaypoint`.
      Parameters:
        `waypoint` - the `RouteWaypoint` to set. If no label is provided, the coordinates will be shown in the `WaypointList`.

    - #### WaypointEntry

          public WaypointEntry(com.here.android.mpa.routing.RouteWaypoint waypoint,
                               java.lang.String label)

      Constructs a new instance using the given `RouteWaypoint` and string label.
      Parameters:
        `waypoint` - `RouteWaypoint`.
        `label` - the label to show or null if the coordinates should be shown instead.

    - #### WaypointEntry

          public WaypointEntry(com.here.android.mpa.routing.RouteWaypoint waypoint,
                               @StringRes
                               int resourceIdLabel)

      Constructs a new instance using the given `RouteWaypoint` and resource id label. For more information about resource id label see `(int)`
      Parameters:
        `waypoint` - `RouteWaypoint`.
        `resourceIdLabel` - the resource id of a string to show or 0 if the coordinates should be shown instead.

  - ### Method Detail

    - #### getStringLabel

          @Nullable
          public java.lang.String getStringLabel()

      Gets the string label associated with this instance.
      Returns:
        the label associated or null.

    - #### setStringLabel

          public WaypointEntry setStringLabel(java.lang.String label)

      Sets the string label to this instance.
      Parameters:
        `label` - a string label for this entry.
      Returns:
        an instance of this class.

    - #### getResourceIdLabel

          @StringRes
          public int getResourceIdLabel()

      Gets the resource string id associated with this instance.
      Returns:
        the resource string id associated.

    - #### setResourceIdLabel

          public WaypointEntry setResourceIdLabel(@StringRes
                                                  int stringId)

      Sets the resource id label to this instance. Use resource id label instead of string label for translatable name. See also `getLabel(Context, String)`.
      Parameters:
        `stringId` - a resource string id for this entry.
      Returns:
        an instance of this class.

    - #### getLabel

          public java.lang.String getLabel(@NonNull
                                           android.content.Context context,
                                           @NonNull
                                           java.lang.String defaultValue)

      Gets label to be shown for this instance.
      Parameters:
        `context` - the required `Context`.
        `defaultValue` - string that will be returned if string label and resource id label are invalid.
      Returns:
        first priority have string label (if is not null and not empty) then resource id label (if is valid), otherwise defaultValue param is returned.

    - #### getRouteWaypoint

          public com.here.android.mpa.routing.RouteWaypoint getRouteWaypoint()

      Gets the `RouteWaypoint` associated with this instance.
      Returns:
        the `RouteWaypoint` associated.

    - #### setRouteWaypoint

          public WaypointEntry setRouteWaypoint(com.here.android.mpa.routing.RouteWaypoint routeWaypoint)

      Sets the `RouteWaypoint` for this instance.
      Parameters:
        `routeWaypoint` - a `RouteWaypoint` instance.
      Returns:
        an instance of this class.

    - #### isValid

          public boolean isValid()

      Indicates whether this instance contains a valid coordinate.
      Returns:
        true if the associated `RouteWaypoint` and `RouteWaypoint.getOriginalPosition()` is not null, false otherwise.

    - #### isDraggable

          public boolean isDraggable()

      Indicates whether this instance is draggable when used as an element of a `WaypointList`. Default is true.
      Returns:
        true if draggable, false otherwise.

    - #### setDraggable

          public WaypointEntry setDraggable(boolean draggable)

      Sets this instance to be draggable when used as an element of a `WaypointList`.
      Parameters:
        `draggable` - true if item should be draggable, false otherwise.
      Returns:
        an instance of this class.

    - #### isRemovable

          public boolean isRemovable()

      Indicates whether this instance is removable when used as an element of a `WaypointList`. Default is true.
      Returns:
        true if it is removable, false otherwise.

    - #### setRemovable

          public WaypointEntry setRemovable(boolean removable)

      Sets this instance to be removable when used as an element of a `WaypointList`.
      Parameters:
        `removable` - true if item should be removable, false otherwise.
      Returns:
        an instance of this class.