Package io.permazen.cli.cmd
Class KVGetCommand
java.lang.Object
io.permazen.cli.cmd.AbstractCommand
io.permazen.cli.cmd.AbstractKVCommand
io.permazen.cli.cmd.KVGetCommand
- All Implemented Interfaces:
Command
-
Nested Class Summary
Nested classes/interfaces inherited from class io.permazen.cli.cmd.AbstractKVCommand
AbstractKVCommand.BytesParser, AbstractKVCommand.KVAction -
Field Summary
Fields inherited from class io.permazen.cli.cmd.AbstractKVCommand
CSTRING_PATTERN, HEXBYTES_PATTERNFields inherited from class io.permazen.cli.cmd.AbstractCommand
log, name, paramParser -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic longdumpRange(PrintStream writer, Iterator<KVPair> iter) Print a hex and ASCII decode of the given key/value pairs.static longdumpRange(PrintStream writer, Iterator<KVPair> iter, boolean cstrings, boolean novalues, long limit) Print a hex and ASCII decode of the given key/value pairs.Process command line parameters and return action.Get expanded help (typically multiple lines).Get summarized help (typically a single line).Get theSessionMode(s) supported by this command.Methods inherited from class io.permazen.cli.cmd.AbstractKVCommand
fromCString, getParser, toCStringMethods inherited from class io.permazen.cli.cmd.AbstractCommand
execute, getName, getUsage
-
Constructor Details
-
KVGetCommand
public KVGetCommand()
-
-
Method Details
-
getHelpSummary
Description copied from class:AbstractCommandGet summarized help (typically a single line).- Specified by:
getHelpSummaryin interfaceCommand- Specified by:
getHelpSummaryin classAbstractCommand- Returns:
- one line command summary
-
getHelpDetail
Description copied from class:AbstractCommandGet expanded help (typically multiple lines).The implementation in
AbstractCommanddelegates togetHelpSummary().- Specified by:
getHelpDetailin interfaceCommand- Overrides:
getHelpDetailin classAbstractCommand- Returns:
- detailed command description
-
getSessionModes
Description copied from class:AbstractCommandGet theSessionMode(s) supported by this command.The implementation in
AbstractCommandreturns anEnumSetcontainingSessionMode.CORE_APIandSessionMode.PERMAZEN.- Specified by:
getSessionModesin interfaceCommand- Overrides:
getSessionModesin classAbstractCommand- Returns:
- set of supported
SessionModes
-
getAction
Description copied from class:AbstractCommandProcess command line parameters and return action.- Specified by:
getActionin classAbstractCommand- Parameters:
session- CLI sessionparams- parsed parameters indexed by name- Returns:
- action to perform for the parsed command
-
dumpRange
Print a hex and ASCII decode of the given key/value pairs.- Parameters:
writer- print outputiter- key/value pair iteration- Returns:
- the number of key/value pairs printed
- Throws:
IllegalArgumentException- ifwriteroriteris null
-
dumpRange
public static long dumpRange(PrintStream writer, Iterator<KVPair> iter, boolean cstrings, boolean novalues, long limit) Print a hex and ASCII decode of the given key/value pairs.- Parameters:
writer- print outputiter- key/value pair iterationcstrings- decode keys and values as stringsnovalues- only print the keys, omitting the valueslimit- stop after this many key/value pairs- Returns:
- the number of key/value pairs printed
- Throws:
IllegalArgumentException- iflimitis negativeIllegalArgumentException- ifwriteroriteris null
-