com.twitter.common.base
Class Commands

java.lang.Object
  extended by com.twitter.common.base.Commands

public final class Commands
extends Object

Utility functions for working with commands.


Field Summary
static Command NOOP
          A command that does nothing when executed.
 
Method Summary
static
<E extends Exception>
ExceptionalSupplier<Void,E>
asSupplier(ExceptionalCommand<E> command)
          Converts a command into a supplier returning null.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NOOP

public static final Command NOOP
A command that does nothing when executed.

Method Detail

asSupplier

public static <E extends Exception> ExceptionalSupplier<Void,E> asSupplier(ExceptionalCommand<E> command)
Converts a command into a supplier returning null.

Returns:
A supplier whose Supplier.get() will cause the given command to be executed and null to be returned.