1e573014a9ed6596ae6af84df0f724a9e730c34c
[controller.git] / opendaylight / md-sal / sal-akka-raft / src / main / java / org / opendaylight / controller / cluster / raft / base / messages / CaptureSnapshotReply.java
1 /*
2  * Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8 package org.opendaylight.controller.cluster.raft.base.messages;
9
10 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
11
12 public class CaptureSnapshotReply {
13     private final byte [] snapshot;
14
15     @SuppressFBWarnings(value = "EI_EXPOSE_REP2", justification = "Stores a reference to an externally mutable byte[] "
16             + "object but this is OK since this class is merely a DTO and does not process byte[] internally. "
17             + "Also it would be inefficient to create a copy as the byte[] could be large.")
18     public CaptureSnapshotReply(byte [] snapshot) {
19         this.snapshot = snapshot;
20     }
21
22     @SuppressFBWarnings(value = "EI_EXPOSE_REP", justification = "Exposes a mutable object stored in a field but "
23             + "this is OK since this class is merely a DTO and does not process the byte[] internally. "
24             + "Also it would be inefficient to create a return copy as the byte[] could be large.")
25     public byte [] getSnapshot() {
26         return snapshot;
27     }
28 }