@Retention(value=RUNTIME) @Target(value=METHOD) public @interface CliAvailabilityIndicator
This annotation must only be applied to a public no-argument method that returns primitive boolean. The method should be inexpensive to evaluate, as this method can be called very frequently. If expensive operations are necessary to compute command availability, it is suggested the method return a boolean field that is maintained using the observer pattern.
It is possible that a particular availability method might be able to
represent the availability status of multiple commands. As such, an
availability indicator annotation will indicate the commands that it applies
to. If a specific command has multiple aliases (ie by using an array for
CliCommand.value()), only one of the commands need to be specified in
the CliAvailabilityIndicator annotation.
public abstract String[] value
Copyright © 2009–2017 Pivotal Software, Inc.. All rights reserved.