org.safehaus.chop.api.Signal Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of chop-api Show documentation
Show all versions of chop-api Show documentation
Common API for Chop entities shared across environments and across
various modules of the project.
The newest version!
package org.safehaus.chop.api;
/** The state dependent and/or impacting signals sent to a runner. */
public enum Signal {
START( 0 ), STOP( 1 ), RESET( 2 ), LOAD( 3 ), COMPLETED( 4 );
private final int id;
private Signal( int id ) {
this.id = id;
}
public int getId() {
return id;
}
public Signal get( int id ) {
switch ( id ) {
case 0:
return START;
case 1:
return STOP;
case 2:
return RESET;
case 3:
return LOAD;
case 4:
return COMPLETED;
}
throw new RuntimeException( "Should never get here!" );
}
}