Make RowUpdate immutable and final 06/86106/1
authorRobert Varga <robert.varga@pantheon.tech>
Tue, 3 Dec 2019 00:06:33 +0000 (01:06 +0100)
committerRobert Varga <robert.varga@pantheon.tech>
Tue, 3 Dec 2019 00:06:33 +0000 (01:06 +0100)
Setters are not used anywhere, let's make sure it stays that way,
turning RowUpdate into a plain record.

Change-Id: I596225f70f8232865bac52af3946132f984a7cea
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
library/impl/src/main/java/org/opendaylight/ovsdb/lib/message/TableUpdate.java

index 9d83eec33d3cd322e5312c8960e3e0d38d0f1048..99c6684f3abec179a1932997ab924d6e54cb9c40 100644 (file)
@@ -20,10 +20,10 @@ public class TableUpdate<E extends TableSchema<E>> {
         return rows;
     }
 
-    public static class RowUpdate<E extends TableSchema<E>> {
+    public static final class RowUpdate<E extends TableSchema<E>> {
         private final UUID uuid;
-        private Row<E> oldRow;
-        private Row<E> newRow;
+        private final Row<E> oldRow;
+        private final Row<E> newRow;
 
         public RowUpdate(final UUID uuid, final Row<E> oldRow, final Row<E> newRow) {
             this.uuid = uuid;
@@ -39,23 +39,13 @@ public class TableUpdate<E extends TableSchema<E>> {
             return oldRow;
         }
 
-        public void setOld(final Row<E> old) {
-            this.oldRow = old;
-        }
-
         public Row<E> getNew() {
             return newRow;
         }
 
-        @SuppressWarnings("checkstyle:HiddenField")
-        public void setNew(final Row<E> newRow) {
-            this.newRow = newRow;
-        }
-
         @Override
         public String toString() {
-            return "RowUpdate [uuid=" + uuid + ", oldRow=" + oldRow + ", newRow=" + newRow
-                    + "]";
+            return "RowUpdate [uuid=" + uuid + ", oldRow=" + oldRow + ", newRow=" + newRow + "]";
         }
     }