All Downloads are FREE. Search and download functionalities are using the official Maven repository.

cdm.base.staticdata.party.processor.BuyerSellerMappingProcessor Maven / Gradle / Ivy

There is a newer version: 6.0.0-dev.89
Show newest version
package cdm.base.staticdata.party.processor;

import cdm.base.staticdata.party.CounterpartyRoleEnum;
import cdm.legaldocumentation.contract.processor.PartyMappingHelper;
import com.regnosys.rosetta.common.translation.MappingContext;
import com.regnosys.rosetta.common.translation.MappingProcessor;
import com.regnosys.rosetta.common.translation.Path;
import com.rosetta.model.lib.RosettaModelObjectBuilder;
import com.rosetta.model.lib.path.RosettaPath;

import java.util.List;
import java.util.Optional;
import java.util.function.Consumer;

/**
 * FpML mapping processor.
 */
@SuppressWarnings("unused")
public abstract class BuyerSellerMappingProcessor extends MappingProcessor {

	public BuyerSellerMappingProcessor(RosettaPath modelPath, List synonymPaths, MappingContext mappingContext) {
		super(modelPath, synonymPaths, mappingContext);
	}

	@Override
	public  void mapBasic(Path synonymPath, Optional instance, RosettaModelObjectBuilder parent) {
		PartyMappingHelper.getInstance(getContext())
				.ifPresent(helper -> getSetter(parent)
						.ifPresent(setter -> helper.setCounterpartyRoleEnum(getModelPath(), synonymPath, setter)));
	}

	protected abstract Optional> getSetter(RosettaModelObjectBuilder builder);
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy