<commit_before>package org.hbird.transport.payloadcodec;

import org.hbird.transport.payloadcodec.codecparameters.IntegerCodecFactory;
import org.hbird.transport.payloadcodec.codecparameters.LongCodecFactory;
import org.hbird.transport.payloadcodec.exceptions.UnexpectedParameterTypeException;
import org.hbird.transport.payloadcodec.exceptions.UnknownParameterEncodingException;
import org.hbird.transport.payloadcodec.exceptions.UnsupportedParameterEncodingException;
import org.hbird.transport.spacesystemmodel.ParameterGroup;
import org.hbird.transport.spacesystemmodel.SpaceSystemModel;
import org.hbird.transport.spacesystemmodel.exceptions.ParameterNotInGroupException;
import org.hbird.transport.spacesystemmodel.exceptions.UnknownParameterGroupException;
import org.hbird.transport.spacesystemmodel.parameters.Parameter;

public class SpaceSystemModelCodecDecorator {

	private SpaceSystemModelCodecDecorator() {
		// No need for public constructor.
	}

	public static SpaceSystemModel decorateSpaceSystemModel(final SpaceSystemModel spaceSystemModel) throws UnsupportedParameterEncodingException, UnknownParameterEncodingException, UnexpectedParameterTypeException, UnknownParameterGroupException, ParameterNotInGroupException {

		SpaceSystemModel newModel = spaceSystemModel.deepClone(spaceSystemModel);

		// Decorate all integer parameters...
		for (Parameter<Integer> parameter : newModel.getIntegerParameters()) {
			parameter = IntegerCodecFactory.decorateParameterWithCodec(parameter);
			newModel.replaceParameterInModel(parameter);
		}

		// Decorate all long parameters...
		for (Parameter<Long> parameter : newModel.getLongParameters()) {
			parameter = LongCodecFactory.decorateParameterWithCodec(parameter);
			newModel.replaceParameterInModel(parameter);
		}

		// TODO BigDecimal, Float, Double, String, Binary



		// Decorate all parameter group parameters.
		//FIXME Find a way to link the parameters and parameter group parameters in the space system model layer.
		for(ParameterGroup pg : newModel.getAllParameterGroups()) {
			// Decorate all integer parameters...
			for (Parameter<Integer> parameter : pg.getIntegerParameters()) {
				parameter = IntegerCodecFactory.decorateParameterWithCodec(parameter);
				pg.replaceParameterInGroup(parameter);
				System.out.println();
			}

			// Decorate all long parameters...
			for (Parameter<Long> parameter : pg.getLongParameters()) {
				parameter = LongCodecFactory.decorateParameterWithCodec(parameter);
				pg.replaceParameterInGroup(parameter);
			}
		}

		return newModel;
	}
}<commit_msg>Removed syso and upgraded TODO to FIXME.<commit_after>package org.hbird.transport.payloadcodec;

import org.hbird.transport.payloadcodec.codecparameters.IntegerCodecFactory;
import org.hbird.transport.payloadcodec.codecparameters.LongCodecFactory;
import org.hbird.transport.payloadcodec.exceptions.UnexpectedParameterTypeException;
import org.hbird.transport.payloadcodec.exceptions.UnknownParameterEncodingException;
import org.hbird.transport.payloadcodec.exceptions.UnsupportedParameterEncodingException;
import org.hbird.transport.spacesystemmodel.ParameterGroup;
import org.hbird.transport.spacesystemmodel.SpaceSystemModel;
import org.hbird.transport.spacesystemmodel.exceptions.ParameterNotInGroupException;
import org.hbird.transport.spacesystemmodel.exceptions.UnknownParameterGroupException;
import org.hbird.transport.spacesystemmodel.parameters.Parameter;

public class SpaceSystemModelCodecDecorator {

	private SpaceSystemModelCodecDecorator() {
		// No need for public constructor.
	}

	public static SpaceSystemModel decorateSpaceSystemModel(final SpaceSystemModel spaceSystemModel) throws UnsupportedParameterEncodingException, UnknownParameterEncodingException, UnexpectedParameterTypeException, UnknownParameterGroupException, ParameterNotInGroupException {

		SpaceSystemModel newModel = spaceSystemModel.deepClone(spaceSystemModel);

		// Decorate all integer parameters...
		for (Parameter<Integer> parameter : newModel.getIntegerParameters()) {
			parameter = IntegerCodecFactory.decorateParameterWithCodec(parameter);
			newModel.replaceParameterInModel(parameter);
		}

		// Decorate all long parameters...
		for (Parameter<Long> parameter : newModel.getLongParameters()) {
			parameter = LongCodecFactory.decorateParameterWithCodec(parameter);
			newModel.replaceParameterInModel(parameter);
		}

		// FIXME BigDecimal, Float, Double, String, Binary



		// Decorate all parameter group parameters.
		//FIXME Find a way to link the parameters and parameter group parameters in the space system model layer.
		for(ParameterGroup pg : newModel.getAllParameterGroups()) {
			// Decorate all integer parameters...
			for (Parameter<Integer> parameter : pg.getIntegerParameters()) {
				parameter = IntegerCodecFactory.decorateParameterWithCodec(parameter);
				pg.replaceParameterInGroup(parameter);
			}

			// Decorate all long parameters...
			for (Parameter<Long> parameter : pg.getLongParameters()) {
				parameter = LongCodecFactory.decorateParameterWithCodec(parameter);
				pg.replaceParameterInGroup(parameter);
			}
		}

		return newModel;
	}
}
{'fraction_non_alphanumeric': 0.08035714285714286, 'fraction_numerical': 0.0, 'mean_word_length': 6.330014224751067, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, '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': '4675617', 'n_tokens_mistral': 1407, 'n_tokens_neox': 1293, 'n_words': 257}