Do not leak SupressFBWarnigs from YangNetconfError
[yangtools.git] / data / yang-data-api / src / main / java / org / opendaylight / yangtools / yang / data / api / YangNetconfError.java
1 /*
2  * Copyright (c) 2021 PANTHEON.tech, 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.yangtools.yang.data.api;
9
10 import com.google.common.annotations.Beta;
11 import java.util.List;
12 import javax.annotation.processing.Generated;
13 import org.eclipse.jdt.annotation.NonNullByDefault;
14 import org.eclipse.jdt.annotation.Nullable;
15 import org.immutables.value.Value;
16 import org.opendaylight.yangtools.yang.common.ErrorSeverity;
17 import org.opendaylight.yangtools.yang.common.ErrorTag;
18 import org.opendaylight.yangtools.yang.common.ErrorType;
19
20 /**
21  * Baseline interface for metadata associated with a NETCONF notion of an 'error'. Except what NETCONF regards as
22  * an 'error', really means 'notable event' in that it can either be a warning or an error. No warnings were defined
23  * at the time this distinction was made.
24  */
25 @Beta
26 @NonNullByDefault
27 @Value.Immutable(copy = false)
28 @Value.Style(stagedBuilder = true, allowedClasspathAnnotations = { SuppressWarnings.class, Generated.class })
29 // FIXME: 8.0.0: Split this interface into two:
30 //               - yang.common.NetconfError, which does not have a builder sets up the stage
31 //               - data.api.schema.NormalizedNetconfError
32 public interface YangNetconfError {
33     /**
34      * Return this error's severity.
35      *
36      * @return Error severity.
37      */
38     ErrorSeverity severity();
39
40     /**
41      * Return this error's type.
42      *
43      * @return Error type.
44      */
45     ErrorType type();
46
47     /**
48      * Return this error's tag.
49      *
50      * @return Error tag.
51      */
52     ErrorTag tag();
53
54     /**
55      * Return this errors's {@code error-message}, if available. This value is expected to be defined in a YANG model
56      * through a {@code error-message} statement.
57      *
58      * @return Event message, or null.
59      */
60     @Nullable String message();
61
62     /**
63      * Return this error's {@code error-app-tag}, if available. This value is expected to be defined in a YANG model
64      * through a {@code error-app-tag} statement.
65      *
66      * @return Application tag, or null.
67      */
68     @Nullable String appTag();
69
70     /**
71      * Return the path which triggered this error, if available.
72      *
73      * @return Triggering path, or null.
74      */
75     // FIXME: 8.0.0: yang.common returns concepts.HierarchicalIdentifier<?>
76     @Nullable YangInstanceIdentifier path();
77
78     /**
79      * Return this error's additional info.
80      *
81      * @return Additional info.
82      */
83     // FIXME: 8.0.0: return NetconfErrorInfoRepresentation
84     List<YangErrorInfo> info();
85 }