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

cdm.base.staticdata.party.processor.SellerAsPayerOrReceiverMappingProcessor 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.Path;
import com.rosetta.model.lib.path.RosettaPath;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

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

import static cdm.base.staticdata.party.PayerReceiver.PayerReceiverBuilder;
import static cdm.base.staticdata.party.processor.BuyerSellerPartyHelper.isSellerAsPayer;

/**
 * FpML mapping processor.
 */
@SuppressWarnings("unused")
public class SellerAsPayerOrReceiverMappingProcessor extends PayerReceiverMappingProcessor {

	private static final Logger LOGGER = LoggerFactory.getLogger(SellerAsPayerOrReceiverMappingProcessor.class);

	public SellerAsPayerOrReceiverMappingProcessor(RosettaPath modelPath, List synonymPaths, MappingContext context) {
		super(modelPath, synonymPaths, context);
	}

	@Override
	void setCounterparty(Path synonymPath, PayerReceiverBuilder builder, PartyMappingHelper helper) {
		Consumer setter =
				isSellerAsPayer(synonymPath, getModelPath()) ? builder::setPayer : builder::setReceiver;
		helper.setCounterpartyRoleEnum(getModelPath(), synonymPath, setter);
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy