8ec663553d312814c943aa57c92e5849d0881b83
[mdsal.git] / common / mdsal-common-api / src / main / java / org / opendaylight / mdsal / common / api / EmptyCommitInfo.java
1 /*
2  * Copyright (c) 2018 Pantheon Technologies, s.r.o. 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.mdsal.common.api;
9
10 import com.google.common.util.concurrent.FluentFuture;
11 import com.google.common.util.concurrent.Futures;
12 import org.eclipse.jdt.annotation.NonNullByDefault;
13
14 /**
15  * Empty commit info singleton. Useful when {@link AsyncWriteTransaction#commit()} has nothing more to say.
16  *
17  * @author Robert Varga
18  */
19 @NonNullByDefault
20 final class EmptyCommitInfo implements CommitInfo {
21     static final CommitInfo INSTANCE = new EmptyCommitInfo();
22     static final FluentFuture<CommitInfo> FLUENT_INSTANCE = FluentFuture.from(Futures.immediateFuture(INSTANCE));
23
24     private EmptyCommitInfo() {
25         // Hidden
26     }
27 }