e4965fdacd289547add12f5c8a97b0a95e9551f9
[mdsal.git] / common / mdsal-common-api / src / main / java / org / opendaylight / mdsal / common / api / CommitInfo.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.annotations.Beta;
11 import com.google.common.util.concurrent.FluentFuture;
12 import org.eclipse.jdt.annotation.NonNullByDefault;
13
14 /**
15  * Base interface for tagging information about a successful commit. This can include various ways of identifying
16  * the resulting changeset, timing information or any other piece of data about the commit itself the implementation
17  * deems interesting to the client.
18  *
19  * @author Robert Varga
20  */
21 @Beta
22 @NonNullByDefault
23 public interface CommitInfo {
24     /**
25      * Return an empty {@link CommitInfo}.
26      *
27      * @return An empty {@link CommitInfo} instance.
28      */
29     static CommitInfo empty() {
30         return EmptyCommitInfo.INSTANCE;
31     }
32
33     /**
34      * Return an immediately-completed empty {@link CommitInfo} future.
35      *
36      * @return An empty {@link CommitInfo} instance enclosed in a completed future.
37      */
38     static FluentFuture<CommitInfo> emptyFluentFuture() {
39         return EmptyCommitInfo.FLUENT_INSTANCE;
40     }
41 }