Class CliSpec<CliFlagsT extends CliFlags>
- java.lang.Object
-
- org.apache.bookkeeper.tools.framework.CliSpec<CliFlagsT>
-
public class CliSpec<CliFlagsT extends CliFlags> extends java.lang.Object
A spec to build CLI.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
CliSpec.Builder<CliFlagsT extends CliFlags>
Builder to build a cli spec.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
argumentsUsage()
protected boolean
canEqual(java.lang.Object other)
java.lang.String
category()
java.util.Set<Command>
commands()
java.io.PrintStream
console()
java.lang.String
description()
boolean
equals(java.lang.Object o)
CliFlagsT
flags()
int
hashCode()
boolean
isCommandGroup()
java.lang.String
name()
static <T extends CliFlags>
CliSpec.Builder<T>newBuilder()
Create a new builder to build the cli spec.static <T extends CliFlags>
CliSpec.Builder<T>newBuilder(CliSpec<T> spec)
Create a new builder to build the cli spec from an existing spec.java.lang.String
parent()
java.util.function.Function<CliFlagsT,java.lang.Boolean>
runFunc()
java.lang.String
tailer()
java.lang.String
toString()
java.lang.String
usage()
-
-
-
Method Detail
-
newBuilder
public static <T extends CliFlags> CliSpec.Builder<T> newBuilder()
Create a new builder to build the cli spec.- Returns:
- a new builder to build the cli spec.
-
newBuilder
public static <T extends CliFlags> CliSpec.Builder<T> newBuilder(CliSpec<T> spec)
Create a new builder to build the cli spec from an existing spec.- Parameters:
spec
- cli spec- Returns:
- a new builder to build the cli spec from an existing spec.
-
category
public java.lang.String category()
-
name
public java.lang.String name()
-
parent
public java.lang.String parent()
-
usage
public java.lang.String usage()
-
argumentsUsage
public java.lang.String argumentsUsage()
-
flags
public CliFlagsT flags()
-
description
public java.lang.String description()
-
commands
public java.util.Set<Command> commands()
-
tailer
public java.lang.String tailer()
-
runFunc
public java.util.function.Function<CliFlagsT,java.lang.Boolean> runFunc()
-
console
public java.io.PrintStream console()
-
isCommandGroup
public boolean isCommandGroup()
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
canEqual
protected boolean canEqual(java.lang.Object other)
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
-