Package io.permazen.cli.cmd
Class DecodeKeyCommand
java.lang.Object
io.permazen.cli.cmd.AbstractCommand
io.permazen.cli.cmd.AbstractKVCommand
io.permazen.cli.cmd.DecodeKeyCommand
- 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_PATTERN
Fields inherited from class io.permazen.cli.cmd.AbstractCommand
log, name, paramParser
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
decode
(Transaction tx, byte[] key) Decode a key/value in the context of aTransaction
.io.permazen.cli.cmd.DecodeKeyCommand.DecodeKeyAction
Process command line parameters and return action.Get expanded help (typically multiple lines).Get summarized help (typically a single line).protected Parser<?>
Convert parameter spec type name into aParser
.Methods inherited from class io.permazen.cli.cmd.AbstractKVCommand
fromCString, toCString
Methods inherited from class io.permazen.cli.cmd.AbstractCommand
execute, getName, getSessionModes, getUsage
-
Constructor Details
-
DecodeKeyCommand
public DecodeKeyCommand()
-
-
Method Details
-
getHelpSummary
Description copied from class:AbstractCommand
Get summarized help (typically a single line).- Specified by:
getHelpSummary
in interfaceCommand
- Specified by:
getHelpSummary
in classAbstractCommand
- Returns:
- one line command summary
-
getHelpDetail
Description copied from class:AbstractCommand
Get expanded help (typically multiple lines).The implementation in
AbstractCommand
delegates togetHelpSummary()
.- Specified by:
getHelpDetail
in interfaceCommand
- Overrides:
getHelpDetail
in classAbstractCommand
- Returns:
- detailed command description
-
getParser
Description copied from class:AbstractCommand
Convert parameter spec type name into aParser
. Used for custom type names not supported byParamParser
.The implementation in
AbstractCommand
supports allEncoding
s registered with the database, plus:objid
for an object ID of the form64e8f29755302fe1
(returnsObjId
)
- Overrides:
getParser
in classAbstractKVCommand
- Parameters:
typeName
- parameter encoding ID or encoding ID alias- Returns:
- parser for parameters of the specified type
-
getAction
public io.permazen.cli.cmd.DecodeKeyCommand.DecodeKeyAction getAction(Session session, Map<String, Object> params) Description copied from class:AbstractCommand
Process command line parameters and return action.- Specified by:
getAction
in classAbstractCommand
- Parameters:
session
- CLI sessionparams
- parsed parameters indexed by name- Returns:
- action to perform for the parsed command
-
decode
Decode a key/value in the context of aTransaction
.- Parameters:
tx
- transactionkey
- key to decode- Returns:
- description of decoded key
- Throws:
IllegalArgumentException
- if either parameter is null
-