// Path: jue/src/nl/q42/jue/State.java
// public enum AlertMode {
// 	/**
// 	 * Light is not performing alert effect
// 	 */
// 	NONE,
// 		
// 	/**
// 	 * Light is performing one breathe cycle
// 	 */
// 	SELECT,
// 		
// 	/**
// 	 * Light is performing breathe cycles for 30 seconds (unless cancelled)
// 	 */
// 	LSELECT
// }
// 
// Path: jue/src/nl/q42/jue/State.java
// public enum Effect {
// 	/**
// 	 * No effect
// 	 */
// 	NONE,
// 		
// 	/**
// 	 * Cycle through all hues with current saturation and brightness
// 	 */
// 	COLORLOOP
// }


import java.util.ArrayList;
import nl.q42.jue.State.AlertMode;
import nl.q42.jue.State.Effect;
package nl.q42.jue;



/**
 * Collection of updates to the state of a light.
 */
public class StateUpdate {
	private ArrayList<Command> commands = new ArrayList<Command>();
	
	String toJson() {
		StringBuilder json = new StringBuilder("{");
		
		for (int i = 0; i < commands.size(); i++) {
			json.append(commands.get(i).toJson());
			if (i < commands.size() - 1) json.append(",");
		}
		
		json.append("}");
		
		return json.toString();
	}
	
	/**
	 * Turn light on.
	 * @return this object for chaining calls
	 */
// Path: jue/src/nl/q42/jue/State.java
// public enum AlertMode {
// 	/**
// 	 * Light is not performing alert effect
// 	 */
// 	NONE,
// 		
// 	/**
// 	 * Light is performing one breathe cycle
// 	 */
// 	SELECT,
// 		
// 	/**
// 	 * Light is performing breathe cycles for 30 seconds (unless cancelled)
// 	 */
// 	LSELECT
// }
// 
// Path: jue/src/nl/q42/jue/State.java
// public enum Effect {
// 	/**
// 	 * No effect
// 	 */
// 	NONE,
// 		
// 	/**
// 	 * Cycle through all hues with current saturation and brightness
// 	 */
// 	COLORLOOP
// }


// Path: jue/src/nl/q42/jue/StateUpdate.java
import java.util.ArrayList;
import nl.q42.jue.State.AlertMode;
import nl.q42.jue.State.Effect;

package nl.q42.jue;



/**
 * Collection of updates to the state of a light.
 */
public class StateUpdate {
	private ArrayList<Command> commands = new ArrayList<Command>();
	
	String toJson() {
		StringBuilder json = new StringBuilder("{");
		
		for (int i = 0; i < commands.size(); i++) {
			json.append(commands.get(i).toJson());
			if (i < commands.size() - 1) json.append(",");
		}
		
		json.append("}");
		
		return json.toString();
	}
	
	/**
	 * Turn light on.
	 * @return this object for chaining calls
	 */
	public StateUpdate turnOn() {