import com.google.common.base.MoreObjects;
import java.io.Serializable;
+import org.eclipse.jdt.annotation.NonNull;
import org.opendaylight.yangtools.concepts.Immutable;
public abstract class Envelope<T extends Message<?, ?>> implements Immutable, Serializable {
private static final long serialVersionUID = 1L;
- private final T message;
+ private final @NonNull T message;
private final long txSequence;
private final long sessionId;
*
* @return enclose message
*/
- public T getMessage() {
+ public @NonNull T getMessage() {
return message;
}
import java.io.ObjectInput;
import java.io.ObjectOutput;
import java.util.Objects;
+import org.eclipse.jdt.annotation.NonNull;
import org.opendaylight.yangtools.concepts.WritableIdentifier;
/**
this.memberName = requireNonNull(memberName);
}
- public static FrontendIdentifier create(final MemberName memberName, final FrontendType clientType) {
+ public static @NonNull FrontendIdentifier create(final MemberName memberName, final FrontendType clientType) {
return new FrontendIdentifier(memberName, clientType);
}
- public static FrontendIdentifier readFrom(final DataInput in) throws IOException {
+ public static @NonNull FrontendIdentifier readFrom(final DataInput in) throws IOException {
final MemberName memberName = MemberName.readFrom(in);
final FrontendType clientType = FrontendType.readFrom(in);
return new FrontendIdentifier(memberName, clientType);
clientType.writeTo(out);
}
- public FrontendType getClientType() {
+ public @NonNull FrontendType getClientType() {
return clientType;
}
- public MemberName getMemberName() {
+ public @NonNull MemberName getMemberName() {
return memberName;
}
return memberName.equals(other.memberName) && clientType.equals(other.clientType);
}
- public String toPersistentId() {
+ public @NonNull String toPersistentId() {
return memberName.getName() + "-frontend-" + clientType.getName();
}
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;
}
Proxy(final ClientIdentifier frontendId, final long historyId, final long cookie) {
- this.clientId = requireNonNull(frontendId);
+ clientId = requireNonNull(frontendId);
this.historyId = historyId;
this.cookie = cookie;
}
}
private static final long serialVersionUID = 1L;
- private final ClientIdentifier clientId;
+ private final @NonNull ClientIdentifier clientId;
private final long historyId;
private final long cookie;
}
public LocalHistoryIdentifier(final ClientIdentifier frontendId, final long historyId, final long cookie) {
- this.clientId = requireNonNull(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);
WritableObjects.writeLongs(out, historyId, cookie);
}
- public ClientIdentifier getClientId() {
+ public @NonNull ClientIdentifier getClientId() {
return clientId;
}
import java.io.ObjectInput;
import java.io.ObjectOutput;
import java.nio.charset.StandardCharsets;
+import org.eclipse.jdt.annotation.NonNull;
import org.opendaylight.yangtools.concepts.WritableIdentifier;
/**
}
private static final long serialVersionUID = 1L;
- private final String name;
+
+ private final @NonNull String name;
@SuppressFBWarnings(value = "VO_VOLATILE_REFERENCE_TO_ARRAY",
justification = "The array elements are non-volatile but we don't access them.")
this.serialized = verifyNotNull(serialized);
}
- public static MemberName forName(final String name) {
+ public static @NonNull MemberName forName(final String name) {
checkArgument(!Strings.isNullOrEmpty(name));
// TODO: consider caching instances here
return new MemberName(name);
}
- public static MemberName readFrom(final DataInput in) throws IOException {
+ public static @NonNull MemberName readFrom(final DataInput in) throws IOException {
final byte[] serialized = new byte[in.readInt()];
in.readFully(serialized);
return new MemberName(new String(serialized, StandardCharsets.UTF_8));
out.write(local);
}
- public String getName() {
+ public @NonNull String getName() {
return name;
}
public org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.cds.types.rev191024
- .MemberName toYang() {
+ .@NonNull MemberName toYang() {
return new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.cds.types.rev191024
.MemberName(name);
}
}
private static final long serialVersionUID = 1L;
- private final LocalHistoryIdentifier historyId;
+ private final @NonNull LocalHistoryIdentifier historyId;
private final long transactionId;
private String shortString;
this.transactionId = transactionId;
}
- public static TransactionIdentifier readFrom(final DataInput in) throws IOException {
+ public static @NonNull TransactionIdentifier readFrom(final DataInput in) throws IOException {
final LocalHistoryIdentifier historyId = LocalHistoryIdentifier.readFrom(in);
return new TransactionIdentifier(historyId, WritableObjects.readLong(in));
}
WritableObjects.writeLong(out, transactionId);
}
- public LocalHistoryIdentifier getHistoryId() {
+ public @NonNull LocalHistoryIdentifier getHistoryId() {
return historyId;
}
*/
package org.opendaylight.controller.cluster.datastore.persisted;
+import static com.google.common.base.Verify.verifyNotNull;
import static java.util.Objects.requireNonNull;
-import com.google.common.base.Verify;
import com.google.common.io.ByteStreams;
import java.io.DataInput;
import java.io.Externalizable;
implements Serializable {
protected abstract static class AbstractProxy<T extends Identifier> implements Externalizable {
private static final long serialVersionUID = 1L;
+
private byte[] serialized;
private T identifier;
final int length = in.readInt();
serialized = new byte[length];
in.readFully(serialized);
- identifier = Verify.verifyNotNull(readIdentifier(ByteStreams.newDataInput(serialized)));
+ identifier = verifyNotNull(readIdentifier(ByteStreams.newDataInput(serialized)));
}
protected final Object readResolve() {
- return Verify.verifyNotNull(createObject(identifier, serialized));
+ return verifyNotNull(createObject(identifier, serialized));
}
protected abstract @NonNull T readIdentifier(@NonNull DataInput in) throws IOException;
}
private static final long serialVersionUID = 1L;
- private final byte[] serialized;
- private final T identifier;
+
+ private final byte @NonNull [] serialized;
+ private final @NonNull T identifier;
AbstractIdentifiablePayload(final @NonNull T identifier, final byte @NonNull[] serialized) {
this.identifier = requireNonNull(identifier);
}
protected final Object writeReplace() {
- return Verify.verifyNotNull(externalizableProxy(serialized));
+ return verifyNotNull(externalizableProxy(serialized));
}
@SuppressWarnings("checkstyle:hiddenField")