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

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

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

import com.rosetta.jptlegalagreement.model.AdditionalTypeEnum;
import com.rosetta.jptlegalagreement.model.ApplicableRegime;
import com.rosetta.jptlegalagreement.model.ApplicableRegime.ApplicableRegimeBuilder;
import com.rosetta.jptlegalagreement.model.ApplicableRegime.ApplicableRegimeBuilderImpl;
import com.rosetta.jptlegalagreement.model.ApplicableRegime.ApplicableRegimeImpl;
import com.rosetta.jptlegalagreement.model.RegimeTerms;
import com.rosetta.jptlegalagreement.model.RegimeTerms.RegimeTermsBuilder;
import com.rosetta.jptlegalagreement.model.RegimeTerms.RegimeTermsBuilderImpl;
import com.rosetta.jptlegalagreement.model.RegimeTerms.RegimeTermsImpl;
import com.rosetta.jptlegalagreement.model.RegulatoryRegimeEnum;
import com.rosetta.jptlegalagreement.model.SimmException;
import com.rosetta.jptlegalagreement.model.meta.ApplicableRegimeMeta;
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="ApplicableRegime", builder=ApplicableRegime.ApplicableRegimeBuilderImpl.class, version="test")
public interface ApplicableRegime extends RegimeTerms {

	ApplicableRegimeMeta metaData = new ApplicableRegimeMeta();

	/*********************** Getter Methods  ***********************/
	RegulatoryRegimeEnum getRegime();

	/*********************** Build Methods  ***********************/
	ApplicableRegime build();
	
	ApplicableRegime.ApplicableRegimeBuilder toBuilder();
	
	static ApplicableRegime.ApplicableRegimeBuilder builder() {
		return new ApplicableRegime.ApplicableRegimeBuilderImpl();
	}

	/*********************** Utility Methods  ***********************/
	@Override
	default RosettaMetaData metaData() {
		return metaData;
	}
	
	@Override
	default Class getType() {
		return ApplicableRegime.class;
	}
	
	
	@Override
	default void process(RosettaPath path, Processor processor) {
		processor.processBasic(path.newSubPath("isApplicable"), Boolean.class, getIsApplicable(), this);
		processRosetta(path.newSubPath("simmException"), processor, SimmException.class, getSimmException());
		processor.processBasic(path.newSubPath("retrospectiveEffect"), Boolean.class, getRetrospectiveEffect(), this);
		processor.processBasic(path.newSubPath("additionalType"), AdditionalTypeEnum.class, getAdditionalType(), this);
		processor.processBasic(path.newSubPath("regime"), RegulatoryRegimeEnum.class, getRegime(), this);
	}
	

	/*********************** Builder Interface  ***********************/
	interface ApplicableRegimeBuilder extends ApplicableRegime, RegimeTerms.RegimeTermsBuilder {
		ApplicableRegime.ApplicableRegimeBuilder setIsApplicable(Boolean isApplicable);
		ApplicableRegime.ApplicableRegimeBuilder setSimmException(SimmException simmException);
		ApplicableRegime.ApplicableRegimeBuilder setRetrospectiveEffect(Boolean retrospectiveEffect);
		ApplicableRegime.ApplicableRegimeBuilder setAdditionalType(AdditionalTypeEnum additionalType);
		ApplicableRegime.ApplicableRegimeBuilder setRegime(RegulatoryRegimeEnum regime);

		@Override
		default void process(RosettaPath path, BuilderProcessor processor) {
			processor.processBasic(path.newSubPath("isApplicable"), Boolean.class, getIsApplicable(), this);
			processRosetta(path.newSubPath("simmException"), processor, SimmException.SimmExceptionBuilder.class, getSimmException());
			processor.processBasic(path.newSubPath("retrospectiveEffect"), Boolean.class, getRetrospectiveEffect(), this);
			processor.processBasic(path.newSubPath("additionalType"), AdditionalTypeEnum.class, getAdditionalType(), this);
			processor.processBasic(path.newSubPath("regime"), RegulatoryRegimeEnum.class, getRegime(), this);
		}
		

		ApplicableRegime.ApplicableRegimeBuilder prune();
	}

	/*********************** Immutable Implementation of ApplicableRegime  ***********************/
	class ApplicableRegimeImpl extends RegimeTerms.RegimeTermsImpl implements ApplicableRegime {
		private final RegulatoryRegimeEnum regime;
		
		protected ApplicableRegimeImpl(ApplicableRegime.ApplicableRegimeBuilder builder) {
			super(builder);
			this.regime = builder.getRegime();
		}
		
		@Override
		@RosettaAttribute("regime")
		public RegulatoryRegimeEnum getRegime() {
			return regime;
		}
		
		@Override
		public ApplicableRegime build() {
			return this;
		}
		
		@Override
		public ApplicableRegime.ApplicableRegimeBuilder toBuilder() {
			ApplicableRegime.ApplicableRegimeBuilder builder = builder();
			setBuilderFields(builder);
			return builder;
		}
		
		protected void setBuilderFields(ApplicableRegime.ApplicableRegimeBuilder builder) {
			super.setBuilderFields(builder);
			ofNullable(getRegime()).ifPresent(builder::setRegime);
		}

		@Override
		public boolean equals(Object o) {
			if (this == o) return true;
			if (o == null || !(o instanceof RosettaModelObject) || !getType().equals(((RosettaModelObject)o).getType())) return false;
			if (!super.equals(o)) return false;
		
			ApplicableRegime _that = getType().cast(o);
		
			if (!Objects.equals(regime, _that.getRegime())) return false;
			return true;
		}
		
		@Override
		public int hashCode() {
			int _result = super.hashCode();
			_result = 31 * _result + (regime != null ? regime.getClass().getName().hashCode() : 0);
			return _result;
		}
		
		@Override
		public String toString() {
			return "ApplicableRegime {" +
				"regime=" + this.regime +
			'}' + " " + super.toString();
		}
	}

	/*********************** Builder Implementation of ApplicableRegime  ***********************/
	class ApplicableRegimeBuilderImpl extends RegimeTerms.RegimeTermsBuilderImpl  implements ApplicableRegime.ApplicableRegimeBuilder {
	
		protected RegulatoryRegimeEnum regime;
	
		public ApplicableRegimeBuilderImpl() {
		}
	
		@Override
		@RosettaAttribute("regime")
		public RegulatoryRegimeEnum getRegime() {
			return regime;
		}
		
		@Override
		@RosettaAttribute("isApplicable")
		public ApplicableRegime.ApplicableRegimeBuilder setIsApplicable(Boolean isApplicable) {
			this.isApplicable = isApplicable==null?null:isApplicable;
			return this;
		}
		@Override
		@RosettaAttribute("simmException")
		public ApplicableRegime.ApplicableRegimeBuilder setSimmException(SimmException simmException) {
			this.simmException = simmException==null?null:simmException.toBuilder();
			return this;
		}
		@Override
		@RosettaAttribute("retrospectiveEffect")
		public ApplicableRegime.ApplicableRegimeBuilder setRetrospectiveEffect(Boolean retrospectiveEffect) {
			this.retrospectiveEffect = retrospectiveEffect==null?null:retrospectiveEffect;
			return this;
		}
		@Override
		@RosettaAttribute("additionalType")
		public ApplicableRegime.ApplicableRegimeBuilder setAdditionalType(AdditionalTypeEnum additionalType) {
			this.additionalType = additionalType==null?null:additionalType;
			return this;
		}
		@Override
		@RosettaAttribute("regime")
		public ApplicableRegime.ApplicableRegimeBuilder setRegime(RegulatoryRegimeEnum regime) {
			this.regime = regime==null?null:regime;
			return this;
		}
		
		@Override
		public ApplicableRegime build() {
			return new ApplicableRegime.ApplicableRegimeImpl(this);
		}
		
		@Override
		public ApplicableRegime.ApplicableRegimeBuilder toBuilder() {
			return this;
		}
	
		@SuppressWarnings("unchecked")
		@Override
		public ApplicableRegime.ApplicableRegimeBuilder prune() {
			super.prune();
			return this;
		}
		
		@Override
		public boolean hasData() {
			if (super.hasData()) return true;
			if (getRegime()!=null) return true;
			return false;
		}
	
		@SuppressWarnings("unchecked")
		@Override
		public ApplicableRegime.ApplicableRegimeBuilder merge(RosettaModelObjectBuilder other, BuilderMerger merger) {
			super.merge(other, merger);
			
			ApplicableRegime.ApplicableRegimeBuilder o = (ApplicableRegime.ApplicableRegimeBuilder) other;
			
			
			merger.mergeBasic(getRegime(), o.getRegime(), this::setRegime);
			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;
			if (!super.equals(o)) return false;
		
			ApplicableRegime _that = getType().cast(o);
		
			if (!Objects.equals(regime, _that.getRegime())) return false;
			return true;
		}
		
		@Override
		public int hashCode() {
			int _result = super.hashCode();
			_result = 31 * _result + (regime != null ? regime.getClass().getName().hashCode() : 0);
			return _result;
		}
		
		@Override
		public String toString() {
			return "ApplicableRegimeBuilder {" +
				"regime=" + this.regime +
			'}' + " " + super.toString();
		}
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy