2 * Copyright (c) 2017 Inocybe Technologies 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.raft.behaviors;
10 import java.io.Externalizable;
11 import java.io.IOException;
12 import java.io.ObjectInput;
13 import java.io.ObjectOutput;
14 import org.opendaylight.yangtools.util.AbstractStringIdentifier;
17 * An Identifier for a follower.
19 * @author Thomas Pantelis
21 class FollowerIdentifier extends AbstractStringIdentifier<FollowerIdentifier> {
23 private static final long serialVersionUID = 1L;
25 FollowerIdentifier(final String followerId) {
30 private Object writeReplace() {
31 return new FI(getValue());
34 @Deprecated(since = "7.0.0", forRemoval = true)
35 private static class Proxy implements Externalizable {
37 private static final long serialVersionUID = 1L;
39 private FollowerIdentifier identifier;
41 // checkstyle flags the public modifier as redundant which really doesn't make sense since it clearly isn't
42 // redundant. It is explicitly needed for Java serialization to be able to create instances via reflection.
43 @SuppressWarnings("checkstyle:RedundantModifier")
48 public void writeExternal(final ObjectOutput out) {
49 throw new UnsupportedOperationException();
53 public void readExternal(final ObjectInput in) throws IOException, ClassNotFoundException {
54 identifier = new FollowerIdentifier((String) in.readObject());
58 private Object readResolve() {