Add RestconfQueryParam
[netconf.git] / restconf / restconf-nb-rfc8040 / src / main / java / org / opendaylight / restconf / nb / rfc8040 / WriteDataParams.java
index 5d907d7999c649cff57859fb4027c4651da9a2ed..6004c8b967aebb19ea9c464ca2bee0e84e8084bd 100644 (file)
@@ -19,10 +19,10 @@ import org.opendaylight.yangtools.concepts.Immutable;
 public final class WriteDataParams implements Immutable {
     private static final @NonNull WriteDataParams EMPTY = new WriteDataParams(null, null);
 
-    private final PointParameter point;
-    private final InsertParameter insert;
+    private final PointParam point;
+    private final InsertParam insert;
 
-    private WriteDataParams(final InsertParameter insert, final PointParameter point) {
+    private WriteDataParams(final InsertParam insert, final PointParam point) {
         this.insert = insert;
         this.point = point;
     }
@@ -31,7 +31,7 @@ public final class WriteDataParams implements Immutable {
         return EMPTY;
     }
 
-    public static @NonNull WriteDataParams of(final InsertParameter insert, final PointParameter point) {
+    public static @NonNull WriteDataParams of(final InsertParam insert, final PointParam point) {
         if (point == null) {
             if (insert == null) {
                 return empty();
@@ -41,9 +41,9 @@ public final class WriteDataParams implements Immutable {
             //        If the values "before" or "after" are used, then a "point" query
             //        parameter for the "insert" query parameter MUST also be present, or a
             //        "400 Bad Request" status-line is returned.
-            if (insert == InsertParameter.BEFORE || insert == InsertParameter.AFTER) {
+            if (insert == InsertParam.BEFORE || insert == InsertParam.AFTER) {
                 throw new IllegalArgumentException(
-                    "Insert parameter " + insert.uriValue() + " cannot be used without a Point parameter.");
+                    "Insert parameter " + insert.paramValue() + " cannot be used without a Point parameter.");
             }
         } else {
             // https://datatracker.ietf.org/doc/html/rfc8040#section-4.8.6:
@@ -51,7 +51,7 @@ public final class WriteDataParams implements Immutable {
             //        If the "insert" query parameter is not present or has a value other
             //        than "before" or "after", then a "400 Bad Request" status-line is
             //        returned.
-            if (insert != InsertParameter.BEFORE && insert != InsertParameter.AFTER) {
+            if (insert != InsertParam.BEFORE && insert != InsertParam.AFTER) {
                 throw new IllegalArgumentException(
                     "Point parameter can be used only with 'after' or 'before' values of Insert parameter.");
             }
@@ -60,11 +60,11 @@ public final class WriteDataParams implements Immutable {
         return new WriteDataParams(insert, point);
     }
 
-    public @Nullable InsertParameter insert() {
+    public @Nullable InsertParam insert() {
         return insert;
     }
 
-    public @Nullable PointParameter point() {
+    public @Nullable PointParam point() {
         return point;
     }
 
@@ -72,7 +72,7 @@ public final class WriteDataParams implements Immutable {
     public String toString() {
         final var helper = MoreObjects.toStringHelper(this).omitNullValues();
         if (insert != null) {
-            helper.add("insert", insert.uriValue());
+            helper.add("insert", insert.paramValue());
         }
         if (point != null) {
             helper.add("point", point.value());