1 package org.simantics.district.route.internal;
3 import java.util.Objects;
5 import org.simantics.db.Resource;
6 import org.simantics.district.route.Waypoint;
9 * @author Tuukka Lehtonen
12 public class WaypointImpl implements Waypoint {
14 private final Resource element;
17 public WaypointImpl(Resource element, String label) {
18 Objects.requireNonNull(element, "Non-null element required");
19 this.element = element;
23 @SuppressWarnings("unchecked")
25 public <T> T getObject() {
30 public String getLabel() {
34 public void setLabel(String label) {
39 public String toString() {
43 public Waypoint withLabel(String label) {
44 return new WaypointImpl(element, label);
48 public int hashCode() {
51 result = prime * result + element.hashCode();
56 public boolean equals(Object obj) {
61 if (getClass() != obj.getClass())
63 WaypointImpl other = (WaypointImpl) obj;
64 return element.equals(other.element);