Преглед на файлове

Added a toString implementation

peter_backlund преди 18 години
родител
ревизия
b72f65a322
променени са 1 файла, в които са добавени 6 реда и са изтрити 0 реда
  1. 6
    0
      dddsample/src/main/java/se/citerus/dddsample/domain/model/location/Location.java

+ 6
- 0
dddsample/src/main/java/se/citerus/dddsample/domain/model/location/Location.java Целия файл

@@ -70,6 +70,7 @@ public final class Location implements Entity<Location> {
70 70
     return sameIdentityAs(other);
71 71
   }
72 72
 
73
+  @Override
73 74
   public boolean sameIdentityAs(final Location other) {
74 75
     return this.unLocode.sameValueAs(other.unLocode);
75 76
   }
@@ -82,6 +83,11 @@ public final class Location implements Entity<Location> {
82 83
     return unLocode.hashCode();
83 84
   }
84 85
 
86
+  @Override
87
+  public String toString() {
88
+    return name + " [" + unLocode + "]";
89
+  }
90
+
85 91
   Location() {
86 92
     // Needed by Hibernate
87 93
   }