-
Notifications
You must be signed in to change notification settings - Fork 65
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'release-1.2' into java/yuryf-ft-profile-valkey-424
Signed-off-by: Yury-Fridlyand <yury.fridlyand@improving.com>
- Loading branch information
Showing
11 changed files
with
1,245 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
460 changes: 460 additions & 0 deletions
460
java/client/src/main/java/glide/api/commands/servermodules/Json.java
Large diffs are not rendered by default.
Oops, something went wrong.
64 changes: 64 additions & 0 deletions
64
java/client/src/main/java/glide/api/models/commands/json/JsonGetOptions.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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]); | ||
} | ||
} |
67 changes: 67 additions & 0 deletions
67
java/client/src/main/java/glide/api/models/commands/json/JsonGetOptionsBinary.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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]); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.