53b0eed95442afeb87adee71cb37ab42f8114ac2
[sdc.git] / common / openecomp-common-configuration-management / openecomp-configuration-management-core / src / main / java / org / openecomp / config / type / ConfigurationQuery.java
1 package org.openecomp.config.type;
2
3 import org.openecomp.config.Constants;
4
5 public class ConfigurationQuery {
6
7   String tenant = Constants.DEFAULT_TENANT;
8   String namespace = Constants.DEFAULT_NAMESPACE;
9   String key;
10   boolean fallback;
11   boolean externalLookup;
12   boolean latest;
13   private boolean nodeSpecific;
14
15   public ConfigurationQuery fallback(boolean fallback) {
16     this.fallback = fallback;
17     return this;
18   }
19
20   public ConfigurationQuery latest(boolean val) {
21     this.latest = val;
22     return this;
23   }
24
25   public ConfigurationQuery nodeSpecific(boolean val) {
26     this.nodeSpecific = val;
27     return this;
28   }
29
30   public ConfigurationQuery externalLookup(boolean val) {
31     this.externalLookup = val;
32     return this;
33   }
34
35   /**
36    * Tenant configuration query.
37    *
38    * @param id the id
39    * @return the configuration query
40    */
41   public ConfigurationQuery tenant(String id) {
42     if (id != null) {
43       tenant = id;
44     }
45     return this;
46   }
47
48
49   /**
50    * Namespace configuration query.
51    *
52    * @param id the id
53    * @return the configuration query
54    */
55   public ConfigurationQuery namespace(String id) {
56     if (id != null) {
57       namespace = id;
58     }
59     return this;
60   }
61
62   public ConfigurationQuery key(String id) {
63     key = id;
64     return this;
65   }
66
67   public String getTenant() {
68     return tenant.toUpperCase();
69   }
70
71   public String getNamespace() {
72     return namespace.toUpperCase();
73   }
74
75   public String getKey() {
76     return key;
77   }
78
79   public boolean isFallback() {
80     return fallback;
81   }
82
83   public boolean isNodeSpecific() {
84     return nodeSpecific;
85   }
86
87   public boolean isExternalLookup() {
88     return externalLookup;
89   }
90
91   public boolean isLatest() {
92     return latest;
93   }
94 }