2 * Copyright (c) 2022 PANTHEON.tech, s.r.o. and others. All rights reserved.
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
8 package org.opendaylight.controller.cluster.datastore.persisted;
10 import static com.google.common.base.Verify.verifyNotNull;
11 import static java.util.Objects.requireNonNull;
13 import java.util.List;
16 * Serialization proxy for {@link ShardManagerSnapshot}.
18 final class SM implements ShardManagerSnapshot.SerializedForm {
20 private static final long serialVersionUID = 1L;
22 private ShardManagerSnapshot snapshot;
24 @SuppressWarnings("checkstyle:RedundantModifier")
29 SM(final ShardManagerSnapshot snapshot) {
30 this.snapshot = requireNonNull(snapshot);
34 public List<String> shardNames() {
35 return snapshot.getShardList();
39 public void resolveTo(final ShardManagerSnapshot newSnapshot) {
40 snapshot = requireNonNull(newSnapshot);
44 public Object readResolve() {
45 return verifyNotNull(snapshot);