// Path: be.iminds.iot.things.api/src/be/iminds/iot/things/api/Thing.java
// public interface Thing {
// 
//     public final static String ID = "thing.id";
//     public final static String DEVICE = "thing.device";
//     public final static String SERVICE = "thing.service";
//     public final static String GATEWAY = "thing.gateway";
//     public final static String TYPE = "thing.type";
//     
// }


import java.util.UUID;
import be.iminds.iot.things.api.Thing;
import java.util.List;
	@Override
	public RuleDTO getDTO() {
		RuleDTO dto = new RuleDTO();
		dto.description = description;
		dto.type = type;
		
		int size = conditions.size();
		dto.sourceTypes = new String[size];
		dto.sources = new UUID[size];
		int i = 0;
		for(Condition c : conditions){
			dto.sourceTypes[i] = c.getType();
			dto.sources[i] = c.getId();
			i++;
		}
		
		size = actions.size();
		dto.destinationTypes = new String[size];
		dto.destinations = new UUID[size];
		i = 0;
		for(Action a : actions){
			dto.destinationTypes[i] = a.getType();
			dto.destinations[i] = a.getId();
			i++;
		}
		
		return dto;
	}

	@Override
// Path: be.iminds.iot.things.api/src/be/iminds/iot/things/api/Thing.java
// public interface Thing {
// 
//     public final static String ID = "thing.id";
//     public final static String DEVICE = "thing.device";
//     public final static String SERVICE = "thing.service";
//     public final static String GATEWAY = "thing.gateway";
//     public final static String TYPE = "thing.type";
//     
// }


// Path: be.iminds.iot.things.rule.api/src/be/iminds/iot/things/rule/api/ConditionActionRule.java
import java.util.UUID;
import be.iminds.iot.things.api.Thing;
import java.util.List;

	@Override
	public RuleDTO getDTO() {
		RuleDTO dto = new RuleDTO();
		dto.description = description;
		dto.type = type;
		
		int size = conditions.size();
		dto.sourceTypes = new String[size];
		dto.sources = new UUID[size];
		int i = 0;
		for(Condition c : conditions){
			dto.sourceTypes[i] = c.getType();
			dto.sources[i] = c.getId();
			i++;
		}
		
		size = actions.size();
		dto.destinationTypes = new String[size];
		dto.destinations = new UUID[size];
		i = 0;
		for(Action a : actions){
			dto.destinationTypes[i] = a.getType();
			dto.destinations[i] = a.getId();
			i++;
		}
		
		return dto;
	}

	@Override
	public void setThing(UUID id, Thing thing) {