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

com.rosetta.jptlegalagreement.model.ConditionsElections Maven / Gradle / Ivy

There is a newer version: 11.25.1
Show newest version
package com.rosetta.jptlegalagreement.model;

import com.rosetta.jptlegalagreement.model.ConditionsElections;
import com.rosetta.jptlegalagreement.model.ConditionsElections.ConditionsElectionsBuilder;
import com.rosetta.jptlegalagreement.model.ConditionsElections.ConditionsElectionsBuilderImpl;
import com.rosetta.jptlegalagreement.model.ConditionsElections.ConditionsElectionsImpl;
import com.rosetta.jptlegalagreement.model.Party;
import com.rosetta.jptlegalagreement.model.meta.ConditionsElectionsMeta;
import com.rosetta.jptlegalagreement.model.metafields.ReferenceWithMetaParty;
import com.rosetta.jptlegalagreement.model.metafields.ReferenceWithMetaParty.ReferenceWithMetaPartyBuilder;
import com.rosetta.model.lib.RosettaModelObject;
import com.rosetta.model.lib.RosettaModelObjectBuilder;
import com.rosetta.model.lib.annotations.RosettaAttribute;
import com.rosetta.model.lib.annotations.RosettaDataType;
import com.rosetta.model.lib.meta.RosettaMetaData;
import com.rosetta.model.lib.path.RosettaPath;
import com.rosetta.model.lib.process.BuilderMerger;
import com.rosetta.model.lib.process.BuilderProcessor;
import com.rosetta.model.lib.process.Processor;
import java.util.Objects;

import static java.util.Optional.ofNullable;

/**
 * @version test
 */
@RosettaDataType(value="ConditionsElections", builder=ConditionsElections.ConditionsElectionsBuilderImpl.class, version="test")
public interface ConditionsElections extends RosettaModelObject {

	ConditionsElectionsMeta metaData = new ConditionsElectionsMeta();

	/*********************** Getter Methods  ***********************/
	ReferenceWithMetaParty getParty();
	Boolean getIllegality();
	Boolean getForceMajeure();
	Boolean getTaxEvent();
	Boolean getTaxEventUponMerger();
	Boolean getCreditEventUponMerger();
	Boolean getAdditionalTerminationEvent();
	String getAdditionalLanguage();

	/*********************** Build Methods  ***********************/
	ConditionsElections build();
	
	ConditionsElections.ConditionsElectionsBuilder toBuilder();
	
	static ConditionsElections.ConditionsElectionsBuilder builder() {
		return new ConditionsElections.ConditionsElectionsBuilderImpl();
	}

	/*********************** Utility Methods  ***********************/
	@Override
	default RosettaMetaData metaData() {
		return metaData;
	}
	
	@Override
	default Class getType() {
		return ConditionsElections.class;
	}
	
	
	@Override
	default void process(RosettaPath path, Processor processor) {
		processRosetta(path.newSubPath("party"), processor, ReferenceWithMetaParty.class, getParty());
		processor.processBasic(path.newSubPath("illegality"), Boolean.class, getIllegality(), this);
		processor.processBasic(path.newSubPath("forceMajeure"), Boolean.class, getForceMajeure(), this);
		processor.processBasic(path.newSubPath("taxEvent"), Boolean.class, getTaxEvent(), this);
		processor.processBasic(path.newSubPath("taxEventUponMerger"), Boolean.class, getTaxEventUponMerger(), this);
		processor.processBasic(path.newSubPath("creditEventUponMerger"), Boolean.class, getCreditEventUponMerger(), this);
		processor.processBasic(path.newSubPath("additionalTerminationEvent"), Boolean.class, getAdditionalTerminationEvent(), this);
		processor.processBasic(path.newSubPath("additionalLanguage"), String.class, getAdditionalLanguage(), this);
	}
	

	/*********************** Builder Interface  ***********************/
	interface ConditionsElectionsBuilder extends ConditionsElections, RosettaModelObjectBuilder {
		ReferenceWithMetaParty.ReferenceWithMetaPartyBuilder getOrCreateParty();
		ReferenceWithMetaParty.ReferenceWithMetaPartyBuilder getParty();
		ConditionsElections.ConditionsElectionsBuilder setParty(ReferenceWithMetaParty party0);
		ConditionsElections.ConditionsElectionsBuilder setPartyValue(Party party1);
		ConditionsElections.ConditionsElectionsBuilder setIllegality(Boolean illegality);
		ConditionsElections.ConditionsElectionsBuilder setForceMajeure(Boolean forceMajeure);
		ConditionsElections.ConditionsElectionsBuilder setTaxEvent(Boolean taxEvent);
		ConditionsElections.ConditionsElectionsBuilder setTaxEventUponMerger(Boolean taxEventUponMerger);
		ConditionsElections.ConditionsElectionsBuilder setCreditEventUponMerger(Boolean creditEventUponMerger);
		ConditionsElections.ConditionsElectionsBuilder setAdditionalTerminationEvent(Boolean additionalTerminationEvent);
		ConditionsElections.ConditionsElectionsBuilder setAdditionalLanguage(String additionalLanguage);

		@Override
		default void process(RosettaPath path, BuilderProcessor processor) {
			processRosetta(path.newSubPath("party"), processor, ReferenceWithMetaParty.ReferenceWithMetaPartyBuilder.class, getParty());
			processor.processBasic(path.newSubPath("illegality"), Boolean.class, getIllegality(), this);
			processor.processBasic(path.newSubPath("forceMajeure"), Boolean.class, getForceMajeure(), this);
			processor.processBasic(path.newSubPath("taxEvent"), Boolean.class, getTaxEvent(), this);
			processor.processBasic(path.newSubPath("taxEventUponMerger"), Boolean.class, getTaxEventUponMerger(), this);
			processor.processBasic(path.newSubPath("creditEventUponMerger"), Boolean.class, getCreditEventUponMerger(), this);
			processor.processBasic(path.newSubPath("additionalTerminationEvent"), Boolean.class, getAdditionalTerminationEvent(), this);
			processor.processBasic(path.newSubPath("additionalLanguage"), String.class, getAdditionalLanguage(), this);
		}
		

		ConditionsElections.ConditionsElectionsBuilder prune();
	}

	/*********************** Immutable Implementation of ConditionsElections  ***********************/
	class ConditionsElectionsImpl implements ConditionsElections {
		private final ReferenceWithMetaParty party;
		private final Boolean illegality;
		private final Boolean forceMajeure;
		private final Boolean taxEvent;
		private final Boolean taxEventUponMerger;
		private final Boolean creditEventUponMerger;
		private final Boolean additionalTerminationEvent;
		private final String additionalLanguage;
		
		protected ConditionsElectionsImpl(ConditionsElections.ConditionsElectionsBuilder builder) {
			this.party = ofNullable(builder.getParty()).map(f->f.build()).orElse(null);
			this.illegality = builder.getIllegality();
			this.forceMajeure = builder.getForceMajeure();
			this.taxEvent = builder.getTaxEvent();
			this.taxEventUponMerger = builder.getTaxEventUponMerger();
			this.creditEventUponMerger = builder.getCreditEventUponMerger();
			this.additionalTerminationEvent = builder.getAdditionalTerminationEvent();
			this.additionalLanguage = builder.getAdditionalLanguage();
		}
		
		@Override
		@RosettaAttribute("party")
		public ReferenceWithMetaParty getParty() {
			return party;
		}
		
		@Override
		@RosettaAttribute("illegality")
		public Boolean getIllegality() {
			return illegality;
		}
		
		@Override
		@RosettaAttribute("forceMajeure")
		public Boolean getForceMajeure() {
			return forceMajeure;
		}
		
		@Override
		@RosettaAttribute("taxEvent")
		public Boolean getTaxEvent() {
			return taxEvent;
		}
		
		@Override
		@RosettaAttribute("taxEventUponMerger")
		public Boolean getTaxEventUponMerger() {
			return taxEventUponMerger;
		}
		
		@Override
		@RosettaAttribute("creditEventUponMerger")
		public Boolean getCreditEventUponMerger() {
			return creditEventUponMerger;
		}
		
		@Override
		@RosettaAttribute("additionalTerminationEvent")
		public Boolean getAdditionalTerminationEvent() {
			return additionalTerminationEvent;
		}
		
		@Override
		@RosettaAttribute("additionalLanguage")
		public String getAdditionalLanguage() {
			return additionalLanguage;
		}
		
		@Override
		public ConditionsElections build() {
			return this;
		}
		
		@Override
		public ConditionsElections.ConditionsElectionsBuilder toBuilder() {
			ConditionsElections.ConditionsElectionsBuilder builder = builder();
			setBuilderFields(builder);
			return builder;
		}
		
		protected void setBuilderFields(ConditionsElections.ConditionsElectionsBuilder builder) {
			ofNullable(getParty()).ifPresent(builder::setParty);
			ofNullable(getIllegality()).ifPresent(builder::setIllegality);
			ofNullable(getForceMajeure()).ifPresent(builder::setForceMajeure);
			ofNullable(getTaxEvent()).ifPresent(builder::setTaxEvent);
			ofNullable(getTaxEventUponMerger()).ifPresent(builder::setTaxEventUponMerger);
			ofNullable(getCreditEventUponMerger()).ifPresent(builder::setCreditEventUponMerger);
			ofNullable(getAdditionalTerminationEvent()).ifPresent(builder::setAdditionalTerminationEvent);
			ofNullable(getAdditionalLanguage()).ifPresent(builder::setAdditionalLanguage);
		}

		@Override
		public boolean equals(Object o) {
			if (this == o) return true;
			if (o == null || !(o instanceof RosettaModelObject) || !getType().equals(((RosettaModelObject)o).getType())) return false;
		
			ConditionsElections _that = getType().cast(o);
		
			if (!Objects.equals(party, _that.getParty())) return false;
			if (!Objects.equals(illegality, _that.getIllegality())) return false;
			if (!Objects.equals(forceMajeure, _that.getForceMajeure())) return false;
			if (!Objects.equals(taxEvent, _that.getTaxEvent())) return false;
			if (!Objects.equals(taxEventUponMerger, _that.getTaxEventUponMerger())) return false;
			if (!Objects.equals(creditEventUponMerger, _that.getCreditEventUponMerger())) return false;
			if (!Objects.equals(additionalTerminationEvent, _that.getAdditionalTerminationEvent())) return false;
			if (!Objects.equals(additionalLanguage, _that.getAdditionalLanguage())) return false;
			return true;
		}
		
		@Override
		public int hashCode() {
			int _result = 0;
			_result = 31 * _result + (party != null ? party.hashCode() : 0);
			_result = 31 * _result + (illegality != null ? illegality.hashCode() : 0);
			_result = 31 * _result + (forceMajeure != null ? forceMajeure.hashCode() : 0);
			_result = 31 * _result + (taxEvent != null ? taxEvent.hashCode() : 0);
			_result = 31 * _result + (taxEventUponMerger != null ? taxEventUponMerger.hashCode() : 0);
			_result = 31 * _result + (creditEventUponMerger != null ? creditEventUponMerger.hashCode() : 0);
			_result = 31 * _result + (additionalTerminationEvent != null ? additionalTerminationEvent.hashCode() : 0);
			_result = 31 * _result + (additionalLanguage != null ? additionalLanguage.hashCode() : 0);
			return _result;
		}
		
		@Override
		public String toString() {
			return "ConditionsElections {" +
				"party=" + this.party + ", " +
				"illegality=" + this.illegality + ", " +
				"forceMajeure=" + this.forceMajeure + ", " +
				"taxEvent=" + this.taxEvent + ", " +
				"taxEventUponMerger=" + this.taxEventUponMerger + ", " +
				"creditEventUponMerger=" + this.creditEventUponMerger + ", " +
				"additionalTerminationEvent=" + this.additionalTerminationEvent + ", " +
				"additionalLanguage=" + this.additionalLanguage +
			'}';
		}
	}

	/*********************** Builder Implementation of ConditionsElections  ***********************/
	class ConditionsElectionsBuilderImpl implements ConditionsElections.ConditionsElectionsBuilder {
	
		protected ReferenceWithMetaParty.ReferenceWithMetaPartyBuilder party;
		protected Boolean illegality;
		protected Boolean forceMajeure;
		protected Boolean taxEvent;
		protected Boolean taxEventUponMerger;
		protected Boolean creditEventUponMerger;
		protected Boolean additionalTerminationEvent;
		protected String additionalLanguage;
	
		public ConditionsElectionsBuilderImpl() {
		}
	
		@Override
		@RosettaAttribute("party")
		public ReferenceWithMetaParty.ReferenceWithMetaPartyBuilder getParty() {
			return party;
		}
		
		@Override
		public ReferenceWithMetaParty.ReferenceWithMetaPartyBuilder getOrCreateParty() {
			ReferenceWithMetaParty.ReferenceWithMetaPartyBuilder result;
			if (party!=null) {
				result = party;
			}
			else {
				result = party = ReferenceWithMetaParty.builder();
			}
			
			return result;
		}
		
		@Override
		@RosettaAttribute("illegality")
		public Boolean getIllegality() {
			return illegality;
		}
		
		@Override
		@RosettaAttribute("forceMajeure")
		public Boolean getForceMajeure() {
			return forceMajeure;
		}
		
		@Override
		@RosettaAttribute("taxEvent")
		public Boolean getTaxEvent() {
			return taxEvent;
		}
		
		@Override
		@RosettaAttribute("taxEventUponMerger")
		public Boolean getTaxEventUponMerger() {
			return taxEventUponMerger;
		}
		
		@Override
		@RosettaAttribute("creditEventUponMerger")
		public Boolean getCreditEventUponMerger() {
			return creditEventUponMerger;
		}
		
		@Override
		@RosettaAttribute("additionalTerminationEvent")
		public Boolean getAdditionalTerminationEvent() {
			return additionalTerminationEvent;
		}
		
		@Override
		@RosettaAttribute("additionalLanguage")
		public String getAdditionalLanguage() {
			return additionalLanguage;
		}
		
		@Override
		@RosettaAttribute("party")
		public ConditionsElections.ConditionsElectionsBuilder setParty(ReferenceWithMetaParty party) {
			this.party = party==null?null:party.toBuilder();
			return this;
		}
		@Override
		public ConditionsElections.ConditionsElectionsBuilder setPartyValue(Party party) {
			this.getOrCreateParty().setValue(party);
			return this;
		}
		@Override
		@RosettaAttribute("illegality")
		public ConditionsElections.ConditionsElectionsBuilder setIllegality(Boolean illegality) {
			this.illegality = illegality==null?null:illegality;
			return this;
		}
		@Override
		@RosettaAttribute("forceMajeure")
		public ConditionsElections.ConditionsElectionsBuilder setForceMajeure(Boolean forceMajeure) {
			this.forceMajeure = forceMajeure==null?null:forceMajeure;
			return this;
		}
		@Override
		@RosettaAttribute("taxEvent")
		public ConditionsElections.ConditionsElectionsBuilder setTaxEvent(Boolean taxEvent) {
			this.taxEvent = taxEvent==null?null:taxEvent;
			return this;
		}
		@Override
		@RosettaAttribute("taxEventUponMerger")
		public ConditionsElections.ConditionsElectionsBuilder setTaxEventUponMerger(Boolean taxEventUponMerger) {
			this.taxEventUponMerger = taxEventUponMerger==null?null:taxEventUponMerger;
			return this;
		}
		@Override
		@RosettaAttribute("creditEventUponMerger")
		public ConditionsElections.ConditionsElectionsBuilder setCreditEventUponMerger(Boolean creditEventUponMerger) {
			this.creditEventUponMerger = creditEventUponMerger==null?null:creditEventUponMerger;
			return this;
		}
		@Override
		@RosettaAttribute("additionalTerminationEvent")
		public ConditionsElections.ConditionsElectionsBuilder setAdditionalTerminationEvent(Boolean additionalTerminationEvent) {
			this.additionalTerminationEvent = additionalTerminationEvent==null?null:additionalTerminationEvent;
			return this;
		}
		@Override
		@RosettaAttribute("additionalLanguage")
		public ConditionsElections.ConditionsElectionsBuilder setAdditionalLanguage(String additionalLanguage) {
			this.additionalLanguage = additionalLanguage==null?null:additionalLanguage;
			return this;
		}
		
		@Override
		public ConditionsElections build() {
			return new ConditionsElections.ConditionsElectionsImpl(this);
		}
		
		@Override
		public ConditionsElections.ConditionsElectionsBuilder toBuilder() {
			return this;
		}
	
		@SuppressWarnings("unchecked")
		@Override
		public ConditionsElections.ConditionsElectionsBuilder prune() {
			if (party!=null && !party.prune().hasData()) party = null;
			return this;
		}
		
		@Override
		public boolean hasData() {
			if (getParty()!=null && getParty().hasData()) return true;
			if (getIllegality()!=null) return true;
			if (getForceMajeure()!=null) return true;
			if (getTaxEvent()!=null) return true;
			if (getTaxEventUponMerger()!=null) return true;
			if (getCreditEventUponMerger()!=null) return true;
			if (getAdditionalTerminationEvent()!=null) return true;
			if (getAdditionalLanguage()!=null) return true;
			return false;
		}
	
		@SuppressWarnings("unchecked")
		@Override
		public ConditionsElections.ConditionsElectionsBuilder merge(RosettaModelObjectBuilder other, BuilderMerger merger) {
			ConditionsElections.ConditionsElectionsBuilder o = (ConditionsElections.ConditionsElectionsBuilder) other;
			
			merger.mergeRosetta(getParty(), o.getParty(), this::setParty);
			
			merger.mergeBasic(getIllegality(), o.getIllegality(), this::setIllegality);
			merger.mergeBasic(getForceMajeure(), o.getForceMajeure(), this::setForceMajeure);
			merger.mergeBasic(getTaxEvent(), o.getTaxEvent(), this::setTaxEvent);
			merger.mergeBasic(getTaxEventUponMerger(), o.getTaxEventUponMerger(), this::setTaxEventUponMerger);
			merger.mergeBasic(getCreditEventUponMerger(), o.getCreditEventUponMerger(), this::setCreditEventUponMerger);
			merger.mergeBasic(getAdditionalTerminationEvent(), o.getAdditionalTerminationEvent(), this::setAdditionalTerminationEvent);
			merger.mergeBasic(getAdditionalLanguage(), o.getAdditionalLanguage(), this::setAdditionalLanguage);
			return this;
		}
	
		@Override
		public boolean equals(Object o) {
			if (this == o) return true;
			if (o == null || !(o instanceof RosettaModelObject) || !getType().equals(((RosettaModelObject)o).getType())) return false;
		
			ConditionsElections _that = getType().cast(o);
		
			if (!Objects.equals(party, _that.getParty())) return false;
			if (!Objects.equals(illegality, _that.getIllegality())) return false;
			if (!Objects.equals(forceMajeure, _that.getForceMajeure())) return false;
			if (!Objects.equals(taxEvent, _that.getTaxEvent())) return false;
			if (!Objects.equals(taxEventUponMerger, _that.getTaxEventUponMerger())) return false;
			if (!Objects.equals(creditEventUponMerger, _that.getCreditEventUponMerger())) return false;
			if (!Objects.equals(additionalTerminationEvent, _that.getAdditionalTerminationEvent())) return false;
			if (!Objects.equals(additionalLanguage, _that.getAdditionalLanguage())) return false;
			return true;
		}
		
		@Override
		public int hashCode() {
			int _result = 0;
			_result = 31 * _result + (party != null ? party.hashCode() : 0);
			_result = 31 * _result + (illegality != null ? illegality.hashCode() : 0);
			_result = 31 * _result + (forceMajeure != null ? forceMajeure.hashCode() : 0);
			_result = 31 * _result + (taxEvent != null ? taxEvent.hashCode() : 0);
			_result = 31 * _result + (taxEventUponMerger != null ? taxEventUponMerger.hashCode() : 0);
			_result = 31 * _result + (creditEventUponMerger != null ? creditEventUponMerger.hashCode() : 0);
			_result = 31 * _result + (additionalTerminationEvent != null ? additionalTerminationEvent.hashCode() : 0);
			_result = 31 * _result + (additionalLanguage != null ? additionalLanguage.hashCode() : 0);
			return _result;
		}
		
		@Override
		public String toString() {
			return "ConditionsElectionsBuilder {" +
				"party=" + this.party + ", " +
				"illegality=" + this.illegality + ", " +
				"forceMajeure=" + this.forceMajeure + ", " +
				"taxEvent=" + this.taxEvent + ", " +
				"taxEventUponMerger=" + this.taxEventUponMerger + ", " +
				"creditEventUponMerger=" + this.creditEventUponMerger + ", " +
				"additionalTerminationEvent=" + this.additionalTerminationEvent + ", " +
				"additionalLanguage=" + this.additionalLanguage +
			'}';
		}
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy