2 * Copyright (c) 2014 Cisco Systems, Inc. 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.remote.rpc.registry.gossip;
10 import static com.google.common.base.Verify.verifyNotNull;
11 import static java.util.Objects.requireNonNull;
13 import java.io.Serializable;
15 final class BucketImpl<T extends BucketData<T>> implements Bucket<T>, Serializable {
16 private static final long serialVersionUID = 1L;
18 private final long version;
20 // Guaranteed to be non-null
23 BucketImpl(final long version, final T data) {
24 this.version = version;
25 this.data = requireNonNull(data);
29 public long getVersion() {
39 public String toString() {
40 return "BucketImpl{" + "version=" + version + ", data=" + data + '}';
43 private Object readResolve() {