Sprinkle @NonNull annotations
[controller.git] / opendaylight / md-sal / cds-access-api / src / main / java / org / opendaylight / controller / cluster / access / concepts / LocalHistoryIdentifier.java
index 29e3df74f5657a9697731d4cdc60c526a8baf14d..137bf5907f3ca985170f482d49ae48d86debbc56 100644 (file)
@@ -7,14 +7,16 @@
  */
 package org.opendaylight.controller.cluster.access.concepts;
 
+import static java.util.Objects.requireNonNull;
+
 import com.google.common.base.MoreObjects;
-import com.google.common.base.Preconditions;
 import java.io.DataInput;
 import java.io.DataOutput;
 import java.io.Externalizable;
 import java.io.IOException;
 import java.io.ObjectInput;
 import java.io.ObjectOutput;
+import org.eclipse.jdt.annotation.NonNull;
 import org.opendaylight.yangtools.concepts.WritableIdentifier;
 import org.opendaylight.yangtools.concepts.WritableObjects;
 
@@ -50,7 +52,7 @@ public final class LocalHistoryIdentifier implements WritableIdentifier {
         }
 
         Proxy(final ClientIdentifier frontendId, final long historyId, final long cookie) {
-            this.clientId = Preconditions.checkNotNull(frontendId);
+            clientId = requireNonNull(frontendId);
             this.historyId = historyId;
             this.cookie = cookie;
         }
@@ -62,7 +64,7 @@ public final class LocalHistoryIdentifier implements WritableIdentifier {
         }
 
         @Override
-        public void readExternal(final ObjectInput in) throws IOException, ClassNotFoundException {
+        public void readExternal(final ObjectInput in) throws IOException {
             clientId = ClientIdentifier.readFrom(in);
 
             final byte header = WritableObjects.readLongHeader(in);
@@ -76,7 +78,7 @@ public final class LocalHistoryIdentifier implements WritableIdentifier {
     }
 
     private static final long serialVersionUID = 1L;
-    private final ClientIdentifier clientId;
+    private final @NonNull ClientIdentifier clientId;
     private final long historyId;
     private final long cookie;
 
@@ -85,12 +87,12 @@ public final class LocalHistoryIdentifier implements WritableIdentifier {
     }
 
     public LocalHistoryIdentifier(final ClientIdentifier frontendId, final long historyId, final long cookie) {
-        this.clientId = Preconditions.checkNotNull(frontendId);
+        clientId = requireNonNull(frontendId);
         this.historyId = historyId;
         this.cookie = cookie;
     }
 
-    public static LocalHistoryIdentifier readFrom(final DataInput in) throws IOException {
+    public static @NonNull LocalHistoryIdentifier readFrom(final DataInput in) throws IOException {
         final ClientIdentifier clientId = ClientIdentifier.readFrom(in);
 
         final byte header = WritableObjects.readLongHeader(in);
@@ -104,7 +106,7 @@ public final class LocalHistoryIdentifier implements WritableIdentifier {
         WritableObjects.writeLongs(out, historyId, cookie);
     }
 
-    public ClientIdentifier getClientId() {
+    public @NonNull ClientIdentifier getClientId() {
         return clientId;
     }