Fix warnings and javadocs in sal-akka-raft
[controller.git] / opendaylight / md-sal / sal-akka-raft / src / main / java / org / opendaylight / controller / cluster / raft / NoopProcedure.java
1 /*
2  * Copyright (c) 2015 Brocade Communications 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.raft;
9
10 import akka.japi.Procedure;
11
12 /**
13  * An akka Procedure that does nothing.
14  *
15  * @author Thomas Pantelis
16  *
17  * @param <T> the Procedure type
18  */
19 public class NoopProcedure<T> implements Procedure<T> {
20
21     private static final NoopProcedure<Object> INSTANCE = new NoopProcedure<>();
22
23     private NoopProcedure() {
24     }
25
26     @SuppressWarnings("unchecked")
27     public static <T> NoopProcedure<T> instance() {
28         return (NoopProcedure<T>) INSTANCE;
29     }
30
31     @Override
32     public void apply(Object notUsed) {
33         // nothing to do
34     }
35 }