forked from jenkinsci/configuration-as-code-plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCNode.java
More file actions
53 lines (42 loc) · 1.45 KB
/
CNode.java
File metadata and controls
53 lines (42 loc) · 1.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
package io.jenkins.plugins.casc.model;
import io.jenkins.plugins.casc.ConfiguratorException;
/**
* A configuration Node in yaml tree.
* (We didn't used <em>Node</em> as class name to avoid collision with commonly used Jenkins class hudson.model.Node
* @author <a href="mailto:[email protected]">Nicolas De Loof</a>
*/
public interface CNode extends Cloneable {
enum Type {
MAPPING,
SEQUENCE,
SCALAR
}
Type getType();
default Mapping asMapping() throws ConfiguratorException {
throw new ConfiguratorException("Item isn't a Mapping");
}
default Sequence asSequence() throws ConfiguratorException {
throw new ConfiguratorException("Item isn't a Sequence");
}
default Scalar asScalar() throws ConfiguratorException {
throw new ConfiguratorException("Item isn't a Scalar");
}
/** @deprecated sensitive data are identified based on target attribute being a ${@link hudson.util.Secret} */
@Deprecated
default boolean isSensitiveData() {
return false;
}
/**
* Indicates if the field should be included when describing even if empty
* @return false by default
*/
default boolean isPrintableWhenEmpty() {
return false;
}
/**
* Indicate the source (file, line number) this specific configuration node comes from.
* This is used to offer relevant diagnostic messages
*/
Source getSource();
CNode clone();
}