08a409c4063c0c03b169f70fe838ce23c0acb74d
[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 @Beta
20 @NonNullByDefault
21 public interface CommitInfo {
22     /**
23      * Return an empty {@link CommitInfo}.
24      *
25      * @return An empty {@link CommitInfo} instance.
26      */
27     static CommitInfo empty() {
28         return CI.EMPTY;
29     }
30
31     /**
32      * Return an immediately-completed empty {@link CommitInfo} future.
33      *
34      * @return An empty {@link CommitInfo} instance enclosed in a completed future.
35      */
36     static FluentFuture<CommitInfo> emptyFluentFuture() {
37         return CI.EMPTY_FUTURE;
38     }
39 }