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

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

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

import com.rosetta.jptlegalagreement.model.AdditionalRegime;
import com.rosetta.jptlegalagreement.model.AdditionalRegime.AdditionalRegimeBuilder;
import com.rosetta.jptlegalagreement.model.AdditionalRegime.AdditionalRegimeBuilderImpl;
import com.rosetta.jptlegalagreement.model.AdditionalRegime.AdditionalRegimeImpl;
import com.rosetta.jptlegalagreement.model.AdditionalTypeEnum;
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.SimmException;
import com.rosetta.jptlegalagreement.model.meta.AdditionalRegimeMeta;
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="AdditionalRegime", builder=AdditionalRegime.AdditionalRegimeBuilderImpl.class, version="test")
public interface AdditionalRegime extends RegimeTerms {

	AdditionalRegimeMeta metaData = new AdditionalRegimeMeta();

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

	/*********************** Build Methods  ***********************/
	AdditionalRegime build();
	
	AdditionalRegime.AdditionalRegimeBuilder toBuilder();
	
	static AdditionalRegime.AdditionalRegimeBuilder builder() {
		return new AdditionalRegime.AdditionalRegimeBuilderImpl();
	}

	/*********************** Utility Methods  ***********************/
	@Override
	default RosettaMetaData metaData() {
		return metaData;
	}
	
	@Override
	default Class getType() {
		return AdditionalRegime.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"), String.class, getRegime(), this);
	}
	

	/*********************** Builder Interface  ***********************/
	interface AdditionalRegimeBuilder extends AdditionalRegime, RegimeTerms.RegimeTermsBuilder {
		AdditionalRegime.AdditionalRegimeBuilder setIsApplicable(Boolean isApplicable);
		AdditionalRegime.AdditionalRegimeBuilder setSimmException(SimmException simmException);
		AdditionalRegime.AdditionalRegimeBuilder setRetrospectiveEffect(Boolean retrospectiveEffect);
		AdditionalRegime.AdditionalRegimeBuilder setAdditionalType(AdditionalTypeEnum additionalType);
		AdditionalRegime.AdditionalRegimeBuilder setRegime(String 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"), String.class, getRegime(), this);
		}
		

		AdditionalRegime.AdditionalRegimeBuilder prune();
	}

	/*********************** Immutable Implementation of AdditionalRegime  ***********************/
	class AdditionalRegimeImpl extends RegimeTerms.RegimeTermsImpl implements AdditionalRegime {
		private final String regime;
		
		protected AdditionalRegimeImpl(AdditionalRegime.AdditionalRegimeBuilder builder) {
			super(builder);
			this.regime = builder.getRegime();
		}
		
		@Override
		@RosettaAttribute("regime")
		public String getRegime() {
			return regime;
		}
		
		@Override
		public AdditionalRegime build() {
			return this;
		}
		
		@Override
		public AdditionalRegime.AdditionalRegimeBuilder toBuilder() {
			AdditionalRegime.AdditionalRegimeBuilder builder = builder();
			setBuilderFields(builder);
			return builder;
		}
		
		protected void setBuilderFields(AdditionalRegime.AdditionalRegimeBuilder 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;
		
			AdditionalRegime _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.hashCode() : 0);
			return _result;
		}
		
		@Override
		public String toString() {
			return "AdditionalRegime {" +
				"regime=" + this.regime +
			'}' + " " + super.toString();
		}
	}

	/*********************** Builder Implementation of AdditionalRegime  ***********************/
	class AdditionalRegimeBuilderImpl extends RegimeTerms.RegimeTermsBuilderImpl  implements AdditionalRegime.AdditionalRegimeBuilder {
	
		protected String regime;
	
		public AdditionalRegimeBuilderImpl() {
		}
	
		@Override
		@RosettaAttribute("regime")
		public String getRegime() {
			return regime;
		}
		
		@Override
		@RosettaAttribute("isApplicable")
		public AdditionalRegime.AdditionalRegimeBuilder setIsApplicable(Boolean isApplicable) {
			this.isApplicable = isApplicable==null?null:isApplicable;
			return this;
		}
		@Override
		@RosettaAttribute("simmException")
		public AdditionalRegime.AdditionalRegimeBuilder setSimmException(SimmException simmException) {
			this.simmException = simmException==null?null:simmException.toBuilder();
			return this;
		}
		@Override
		@RosettaAttribute("retrospectiveEffect")
		public AdditionalRegime.AdditionalRegimeBuilder setRetrospectiveEffect(Boolean retrospectiveEffect) {
			this.retrospectiveEffect = retrospectiveEffect==null?null:retrospectiveEffect;
			return this;
		}
		@Override
		@RosettaAttribute("additionalType")
		public AdditionalRegime.AdditionalRegimeBuilder setAdditionalType(AdditionalTypeEnum additionalType) {
			this.additionalType = additionalType==null?null:additionalType;
			return this;
		}
		@Override
		@RosettaAttribute("regime")
		public AdditionalRegime.AdditionalRegimeBuilder setRegime(String regime) {
			this.regime = regime==null?null:regime;
			return this;
		}
		
		@Override
		public AdditionalRegime build() {
			return new AdditionalRegime.AdditionalRegimeImpl(this);
		}
		
		@Override
		public AdditionalRegime.AdditionalRegimeBuilder toBuilder() {
			return this;
		}
	
		@SuppressWarnings("unchecked")
		@Override
		public AdditionalRegime.AdditionalRegimeBuilder 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 AdditionalRegime.AdditionalRegimeBuilder merge(RosettaModelObjectBuilder other, BuilderMerger merger) {
			super.merge(other, merger);
			
			AdditionalRegime.AdditionalRegimeBuilder o = (AdditionalRegime.AdditionalRegimeBuilder) 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;
		
			AdditionalRegime _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.hashCode() : 0);
			return _result;
		}
		
		@Override
		public String toString() {
			return "AdditionalRegimeBuilder {" +
				"regime=" + this.regime +
			'}' + " " + super.toString();
		}
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy