Expose parameter names as String constants
[netconf.git] / restconf / restconf-nb-rfc8040 / src / main / java / org / opendaylight / restconf / nb / rfc8040 / InsertParam.java
index 206e66a627f09a2fdd5012ecdc74dbb0abf45ff2..4c60198c8687769984b490cc0e46d954d353be8b 100644 (file)
@@ -34,6 +34,10 @@ public enum InsertParam implements RestconfQueryParam<InsertParam> {
      */
     LAST("last");
 
+    // API consistency: must not be confused with enum constants
+    @SuppressWarnings("checkstyle:ConstantName")
+    public static final @NonNull String uriName = "insert";
+
     private @NonNull String uriValue;
 
     InsertParam(final String uriValue) {
@@ -47,7 +51,7 @@ public enum InsertParam implements RestconfQueryParam<InsertParam> {
 
     @Override
     public String paramName() {
-        return uriName();
+        return uriName;
     }
 
     @Override
@@ -55,10 +59,6 @@ public enum InsertParam implements RestconfQueryParam<InsertParam> {
         return uriValue;
     }
 
-    public static @NonNull String uriName() {
-        return "insert";
-    }
-
     // Note: returns null of unknowns
     public static @Nullable InsertParam forUriValue(final String uriValue) {
         switch (uriValue) {