Remove JournalWriter.getLastEntry()
[controller.git] / opendaylight / md-sal / sal-distributed-datastore / src / main / java / org / opendaylight / controller / cluster / datastore / persisted / ShardManagerSnapshot.java
1 /*
2  * Copyright (c) 2017 Brocade Communications 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.datastore.persisted;
9
10 import com.google.common.collect.ImmutableList;
11 import java.io.Serializable;
12 import java.util.List;
13 import org.eclipse.jdt.annotation.NonNull;
14
15 /**
16  * Represents the persisted snapshot state for the ShardManager.
17  *
18  * @author Thomas Pantelis
19  */
20 public final class ShardManagerSnapshot implements Serializable {
21     @java.io.Serial
22     private static final long serialVersionUID = 1L;
23
24     private final List<String> shardList;
25
26     public ShardManagerSnapshot(final @NonNull List<String> shardList) {
27         this.shardList = ImmutableList.copyOf(shardList);
28     }
29
30     public List<String> getShardList() {
31         return shardList;
32     }
33
34     @java.io.Serial
35     private Object writeReplace() {
36         return new SM(this);
37     }
38
39     @Override
40     public String toString() {
41         return "ShardManagerSnapshot [ShardList = " + shardList + " ]";
42     }
43 }