Fix FindBugs warnings in cds-access-api and enable enforcement
[controller.git] / opendaylight / md-sal / cds-access-api / src / main / java / org / opendaylight / controller / cluster / access / concepts / AbstractSuccessProxy.java
1 /*
2  * Copyright (c) 2016 Cisco 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.access.concepts;
9
10 import com.google.common.annotations.Beta;
11 import javax.annotation.Nonnull;
12 import org.opendaylight.yangtools.concepts.WritableIdentifier;
13
14 /**
15  * Abstract Externalizable proxy for use with {@link RequestSuccess} subclasses.
16  *
17  * @author Robert Varga
18  *
19  * @param <T> Target identifier type
20  */
21 @Beta
22 public abstract class AbstractSuccessProxy<T extends WritableIdentifier, C extends RequestSuccess<T, C>>
23         extends AbstractResponseProxy<T, C> {
24     private static final long serialVersionUID = 1L;
25
26     protected AbstractSuccessProxy() {
27         // For Externalizable
28     }
29
30     protected AbstractSuccessProxy(@Nonnull final C success) {
31         super(success);
32     }
33
34     @Override
35     final C createResponse(final T target, final long sequence) {
36         return createSuccess(target, sequence);
37     }
38
39     @Nonnull
40     protected abstract C createSuccess(@Nonnull T target, long sequence);
41 }