import com.google.common.base.Preconditions;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import javax.annotation.Nonnull;
+import org.opendaylight.controller.cluster.raft.persisted.Snapshot;
/**
* Reply to GetSnapshot that returns a serialized Snapshot instance.
*/
public class GetSnapshotReply {
private final String id;
- private final byte[] snapshot;
+ private final Snapshot snapshot;
- public GetSnapshotReply(@Nonnull String id, @Nonnull byte[] snapshot) {
+ public GetSnapshotReply(@Nonnull String id, @Nonnull Snapshot snapshot) {
this.id = Preconditions.checkNotNull(id);
this.snapshot = Preconditions.checkNotNull(snapshot);
}
+ "this is OK since this class is merely a DTO and does not process the byte[] internally. "
+ "Also it would be inefficient to create a return copy as the byte[] could be large.")
@Nonnull
- public byte[] getSnapshot() {
+ public Snapshot getSnapshot() {
return snapshot;
}
@Override
public String toString() {
- return "GetSnapshotReply [id=" + id + ", snapshot.length=" + snapshot.length + "]";
+ return "GetSnapshotReply [id=" + id + ", snapshot=" + snapshot + "]";
}
}