Skip to content

Commit

Permalink
Merge branch 'release-1.2' into java/yuryf-ft-profile-valkey-424
Browse files Browse the repository at this point in the history
Signed-off-by: Yury-Fridlyand <yury.fridlyand@improving.com>
  • Loading branch information
Yury-Fridlyand authored Oct 17, 2024
2 parents 6b23e6b + adcc76f commit 94ae1d3
Show file tree
Hide file tree
Showing 11 changed files with 1,245 additions and 3 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#### Changes
* Python: Add commands FT.ALIASADD, FT.ALIASDEL, FT.ALIASUPDATE([#2471](https://github.com/valkey-io/valkey-glide/pull/2471))
* Python: Python FT.DROPINDEX command ([#2437](https://github.com/valkey-io/valkey-glide/pull/2437))
* Python: Python: Added FT.CREATE command([#2413](https://github.com/valkey-io/valkey-glide/pull/2413))
* Python: Add JSON.ARRLEN command ([#2403](https://github.com/valkey-io/valkey-glide/pull/2403))
Expand All @@ -11,6 +12,7 @@
* Java: Added `FT.SEARCH` ([#2439](https://github.com/valkey-io/valkey-glide/pull/2439))
* Java: Added `FT.AGGREGATE` ([#2466](https://github.com/valkey-io/valkey-glide/pull/2466))
* Java: Added `FT.PROFILE` ([#2473](https://github.com/valkey-io/valkey-glide/pull/2473))
* Java: Added `JSON.SET` and `JSON.GET` ([#2462](https://github.com/valkey-io/valkey-glide/pull/2462))
* Core: Update routing for commands from server modules ([#2461](https://github.com/valkey-io/valkey-glide/pull/2461))

#### Breaking Changes
Expand Down
460 changes: 460 additions & 0 deletions java/client/src/main/java/glide/api/commands/servermodules/Json.java

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
/** Copyright Valkey GLIDE Project Contributors - SPDX Identifier: Apache-2.0 */
package glide.api.models.commands.json;

import glide.api.commands.servermodules.Json;
import java.util.ArrayList;
import java.util.List;
import lombok.Builder;

/** Additional parameters for {@link Json#get} command. */
@Builder
public final class JsonGetOptions {
/** ValKey API string to designate INDENT */
public static final String INDENT_VALKEY_API = "INDENT";

/** ValKey API string to designate NEWLINE */
public static final String NEWLINE_VALKEY_API = "NEWLINE";

/** ValKey API string to designate SPACE */
public static final String SPACE_VALKEY_API = "SPACE";

/** ValKey API string to designate SPACE */
public static final String NOESCAPE_VALKEY_API = "NOESCAPE";

/** Sets an indentation string for nested levels. */
private String indent;

/** Sets a string that's printed at the end of each line. */
private String newline;

/** Sets a string that's put between a key and a value. */
private String space;

/** Allowed to be present for legacy compatibility and has no other effect. */
private boolean noescape;

/**
* Converts JsonGetOptions into a String[].
*
* @return String[]
*/
public String[] toArgs() {
List<String> args = new ArrayList<>();
if (indent != null) {
args.add(INDENT_VALKEY_API);
args.add(indent);
}

if (newline != null) {
args.add(NEWLINE_VALKEY_API);
args.add(newline);
}

if (space != null) {
args.add(SPACE_VALKEY_API);
args.add(space);
}

if (noescape) {
args.add(NOESCAPE_VALKEY_API);
}

return args.toArray(new String[0]);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
/** Copyright Valkey GLIDE Project Contributors - SPDX Identifier: Apache-2.0 */
package glide.api.models.commands.json;

import static glide.api.models.GlideString.gs;

import glide.api.commands.servermodules.Json;
import glide.api.models.GlideString;
import java.util.ArrayList;
import java.util.List;
import lombok.Builder;

/** GlideString version of additional parameters for {@link Json#get} command. */
@Builder
public final class JsonGetOptionsBinary {
/** ValKey API string to designate INDENT */
public static final GlideString INDENT_VALKEY_API = gs("INDENT");

/** ValKey API string to designate NEWLINE */
public static final GlideString NEWLINE_VALKEY_API = gs("NEWLINE");

/** ValKey API string to designate SPACE */
public static final GlideString SPACE_VALKEY_API = gs("SPACE");

/** ValKey API string to designate SPACE */
public static final GlideString NOESCAPE_VALKEY_API = gs("NOESCAPE");

/** Sets an indentation string for nested levels. */
private GlideString indent;

/** Sets a string that's printed at the end of each line. */
private GlideString newline;

/** Sets a string that's put between a key and a value. */
private GlideString space;

/** Allowed to be present for legacy compatibility and has no other effect. */
private boolean noescape;

/**
* Converts JsonGetOptions into a GlideString[].
*
* @return GlideString[]
*/
public GlideString[] toArgs() {
List<GlideString> args = new ArrayList<>();
if (indent != null) {
args.add(INDENT_VALKEY_API);
args.add(indent);
}

if (newline != null) {
args.add(NEWLINE_VALKEY_API);
args.add(newline);
}

if (space != null) {
args.add(SPACE_VALKEY_API);
args.add(space);
}

if (noescape) {
args.add(NOESCAPE_VALKEY_API);
}

return args.toArray(new GlideString[0]);
}
}
1 change: 1 addition & 0 deletions java/client/src/main/java/module-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
exports glide.api.models.commands.scan;
exports glide.api.models.commands.stream;
exports glide.api.models.commands.FT;
exports glide.api.models.commands.json;
exports glide.api.models.configuration;
exports glide.api.models.exceptions;
exports glide.api.commands.servermodules;
Expand Down
Loading

0 comments on commit 94ae1d3

Please sign in to comment.