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;
}
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();
// 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:
// 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.");
}
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;
}
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());