Expose parameter names as String constants
[netconf.git] / restconf / restconf-nb-rfc8040 / src / main / java / org / opendaylight / restconf / nb / rfc8040 / DepthParam.java
index d489c7f0bdcac251f5148a53ad8c9a5f1db13518..8ece8d1e3d6ac383b64b33ee0cfa1123bf902d42 100644 (file)
@@ -19,6 +19,10 @@ import org.eclipse.jdt.annotation.Nullable;
  * <a href="https://datatracker.ietf.org/doc/html/rfc8040#section-4.8.3">RFC8040 section 4.8.2</a>.
  */
 public final class DepthParam implements RestconfQueryParam<DepthParam> {
+    // API consistency: must not be confused with enum constants
+    @SuppressWarnings("checkstyle:ConstantName")
+    public static final @NonNull String uriName = "depth";
+
     private static final @NonNull URI CAPABILITY = URI.create("urn:ietf:params:restconf:capability:depth:1.0");
     private static final @NonNull DepthParam MIN = of(1);
     private static final @NonNull DepthParam MAX = of(65535);
@@ -41,7 +45,7 @@ public final class DepthParam implements RestconfQueryParam<DepthParam> {
 
     @Override
     public String paramName() {
-        return uriName();
+        return uriName;
     }
 
     @Override
@@ -49,10 +53,6 @@ public final class DepthParam implements RestconfQueryParam<DepthParam> {
         return String.valueOf(value);
     }
 
-    public static @NonNull String uriName() {
-        return "depth";
-    }
-
     @Beta
     public static @NonNull DepthParam min() {
         return MIN;