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 com.google.common.base.Preconditions;
11 import com.google.common.base.Verify;
12 import java.io.Serializable;
14 final class BucketImpl<T extends BucketData<T>> implements Bucket<T>, Serializable {
15 private static final long serialVersionUID = 1L;
17 private final long version;
19 // Guaranteed to be non-null
22 BucketImpl(final long version, final T data) {
23 this.version = version;
24 this.data = Preconditions.checkNotNull(data);
28 public long getVersion() {
38 public String toString() {
39 return "BucketImpl{" + "version=" + version + ", data=" + data + '}';
42 private Object readResolve() {
43 Verify.verifyNotNull(data);