<commit_before>package smartfactory.utility;

import jade.core.behaviours.DataStore;
import jade.lang.acl.ACLMessage;
import smartfactory.configuration.AgentConfiguration;
import smartfactory.models.Process;
import smartfactory.models.ProcessOperation;
import smartfactory.models.Product;
import smartfactory.models.Resource;
import smartfactory.platform.AgentPlatform;

// TODO : rework mechanics of getters/setters so they log-error if there is null object of required type
public class AgentDataStore extends DataStore {

	public AgentPlatform getAgentPlatform() {
		return (AgentPlatform) get("agentPlatform");
	}

	public void setAgentPlatform(AgentPlatform agentPlatform) {
		put("agentPlatform", agentPlatform);
	}

	public EventSubscribers getEventSubsribers() {
		return (EventSubscribers) get("eventSubscribers");
	}

	public void setEventSubscribers(EventSubscribers eventSubscribers) {
		put("eventSubscribers", eventSubscribers);
	}

	public void setSubAgentConfiguration(AgentConfiguration agentConfiguration) {
		put("subAgentConfiguration", agentConfiguration);
	}

	public AgentConfiguration getSubAgentConfiguration() {
		return (AgentConfiguration) get("subAgentConfiguration");
	}

	public void setProcess(Process process) {
		put("process", process);
	}

	public Process getProcess() {
		return (Process) get("process");
	}

	public void setProcessOperation(ProcessOperation serviceProvisioning) {
		put("process-operation", serviceProvisioning);
	}

	public ProcessOperation getProcessOperation() {
		return (ProcessOperation) get("process-operation");
	}

	public void setProduct(Product product) {
		put("product", product);
	}

	public Product getProduct() {
		return (Product) get("product");
	}

	public void setResource(Resource machine) {
		put("resource", machine);
	}

	public Resource getResource() {
		// TODO : alert if there is no machine
		return (Resource) get("resource");
	}

	public ACLMessage getActivityResult() {
		return (ACLMessage) get("activity-result");
	}

	public void setActivityResult(ACLMessage result) {
		put("activity-result", result);
	}

	public void setActivityRequest(ACLMessage request) {
		put("activity-request", request);
	}

	public ACLMessage getActivityRequest() {
		return (ACLMessage) get("activity-request");
	}

	private static final long serialVersionUID = 4398092789071233362L;
}<commit_msg>datastore log-error if there is null object of required key<commit_after>package smartfactory.utility;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import jade.core.behaviours.DataStore;
import jade.lang.acl.ACLMessage;
import smartfactory.configuration.AgentConfiguration;
import smartfactory.models.Process;
import smartfactory.models.ProcessOperation;
import smartfactory.models.Product;
import smartfactory.models.Resource;
import smartfactory.platform.AgentPlatform;

public class AgentDataStore extends DataStore {

	@Override
	public Object get(Object key) {
		Object result = super.get(key);
		if (result == null) {
			logger.error("no object for key={}", key);
		}
		return result;
	}

	public AgentPlatform getAgentPlatform() {
		return (AgentPlatform) get("agentPlatform");
	}

	public void setAgentPlatform(AgentPlatform agentPlatform) {
		put("agentPlatform", agentPlatform);
	}

	public EventSubscribers getEventSubsribers() {
		return (EventSubscribers) get("eventSubscribers");
	}

	public void setEventSubscribers(EventSubscribers eventSubscribers) {
		put("eventSubscribers", eventSubscribers);
	}

	public void setSubAgentConfiguration(AgentConfiguration agentConfiguration) {
		put("subAgentConfiguration", agentConfiguration);
	}

	public AgentConfiguration getSubAgentConfiguration() {
		return (AgentConfiguration) get("subAgentConfiguration");
	}

	public void setProcess(Process process) {
		put("process", process);
	}

	public Process getProcess() {
		return (Process) get("process");
	}

	public void setProcessOperation(ProcessOperation serviceProvisioning) {
		put("process-operation", serviceProvisioning);
	}

	public ProcessOperation getProcessOperation() {
		return (ProcessOperation) get("process-operation");
	}

	public void setProduct(Product product) {
		put("product", product);
	}

	public Product getProduct() {
		return (Product) get("product");
	}

	public void setResource(Resource machine) {
		put("resource", machine);
	}

	public Resource getResource() {
		return (Resource) get("resource");
	}

	public ACLMessage getActivityResult() {
		return (ACLMessage) get("activity-result");
	}

	public void setActivityResult(ACLMessage result) {
		put("activity-result", result);
	}

	public void setActivityRequest(ACLMessage request) {
		put("activity-request", request);
	}

	public ACLMessage getActivityRequest() {
		return (ACLMessage) get("activity-request");
	}

	private static final long serialVersionUID = 4398092789071233362L;

	private final Logger logger = LoggerFactory.getLogger(this.getClass());
}
{'fraction_non_alphanumeric': 0.10338536387593757, 'fraction_numerical': 0.008108655990269612, 'mean_word_length': 6.109510086455331, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '135357', 'n_tokens_mistral': 1478, 'n_tokens_neox': 1364, 'n_words': 333}