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

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

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

import com.rosetta.jptlegalagreement.model.AdditionalRightsEvent;
import com.rosetta.jptlegalagreement.model.AdditionalRightsEvent.AdditionalRightsEventBuilder;
import com.rosetta.jptlegalagreement.model.AdditionalRightsEvent.AdditionalRightsEventBuilderImpl;
import com.rosetta.jptlegalagreement.model.AdditionalRightsEvent.AdditionalRightsEventImpl;
import com.rosetta.jptlegalagreement.model.meta.AdditionalRightsEventMeta;
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="AdditionalRightsEvent", builder=AdditionalRightsEvent.AdditionalRightsEventBuilderImpl.class, version="test")
public interface AdditionalRightsEvent extends RosettaModelObject {

	AdditionalRightsEventMeta metaData = new AdditionalRightsEventMeta();

	/*********************** Getter Methods  ***********************/
	Boolean getIsApplicable();
	String getQualification();

	/*********************** Build Methods  ***********************/
	AdditionalRightsEvent build();
	
	AdditionalRightsEvent.AdditionalRightsEventBuilder toBuilder();
	
	static AdditionalRightsEvent.AdditionalRightsEventBuilder builder() {
		return new AdditionalRightsEvent.AdditionalRightsEventBuilderImpl();
	}

	/*********************** Utility Methods  ***********************/
	@Override
	default RosettaMetaData metaData() {
		return metaData;
	}
	
	@Override
	default Class getType() {
		return AdditionalRightsEvent.class;
	}
	
	
	@Override
	default void process(RosettaPath path, Processor processor) {
		processor.processBasic(path.newSubPath("isApplicable"), Boolean.class, getIsApplicable(), this);
		processor.processBasic(path.newSubPath("qualification"), String.class, getQualification(), this);
	}
	

	/*********************** Builder Interface  ***********************/
	interface AdditionalRightsEventBuilder extends AdditionalRightsEvent, RosettaModelObjectBuilder {
		AdditionalRightsEvent.AdditionalRightsEventBuilder setIsApplicable(Boolean isApplicable);
		AdditionalRightsEvent.AdditionalRightsEventBuilder setQualification(String qualification);

		@Override
		default void process(RosettaPath path, BuilderProcessor processor) {
			processor.processBasic(path.newSubPath("isApplicable"), Boolean.class, getIsApplicable(), this);
			processor.processBasic(path.newSubPath("qualification"), String.class, getQualification(), this);
		}
		

		AdditionalRightsEvent.AdditionalRightsEventBuilder prune();
	}

	/*********************** Immutable Implementation of AdditionalRightsEvent  ***********************/
	class AdditionalRightsEventImpl implements AdditionalRightsEvent {
		private final Boolean isApplicable;
		private final String qualification;
		
		protected AdditionalRightsEventImpl(AdditionalRightsEvent.AdditionalRightsEventBuilder builder) {
			this.isApplicable = builder.getIsApplicable();
			this.qualification = builder.getQualification();
		}
		
		@Override
		@RosettaAttribute("isApplicable")
		public Boolean getIsApplicable() {
			return isApplicable;
		}
		
		@Override
		@RosettaAttribute("qualification")
		public String getQualification() {
			return qualification;
		}
		
		@Override
		public AdditionalRightsEvent build() {
			return this;
		}
		
		@Override
		public AdditionalRightsEvent.AdditionalRightsEventBuilder toBuilder() {
			AdditionalRightsEvent.AdditionalRightsEventBuilder builder = builder();
			setBuilderFields(builder);
			return builder;
		}
		
		protected void setBuilderFields(AdditionalRightsEvent.AdditionalRightsEventBuilder builder) {
			ofNullable(getIsApplicable()).ifPresent(builder::setIsApplicable);
			ofNullable(getQualification()).ifPresent(builder::setQualification);
		}

		@Override
		public boolean equals(Object o) {
			if (this == o) return true;
			if (o == null || !(o instanceof RosettaModelObject) || !getType().equals(((RosettaModelObject)o).getType())) return false;
		
			AdditionalRightsEvent _that = getType().cast(o);
		
			if (!Objects.equals(isApplicable, _that.getIsApplicable())) return false;
			if (!Objects.equals(qualification, _that.getQualification())) return false;
			return true;
		}
		
		@Override
		public int hashCode() {
			int _result = 0;
			_result = 31 * _result + (isApplicable != null ? isApplicable.hashCode() : 0);
			_result = 31 * _result + (qualification != null ? qualification.hashCode() : 0);
			return _result;
		}
		
		@Override
		public String toString() {
			return "AdditionalRightsEvent {" +
				"isApplicable=" + this.isApplicable + ", " +
				"qualification=" + this.qualification +
			'}';
		}
	}

	/*********************** Builder Implementation of AdditionalRightsEvent  ***********************/
	class AdditionalRightsEventBuilderImpl implements AdditionalRightsEvent.AdditionalRightsEventBuilder {
	
		protected Boolean isApplicable;
		protected String qualification;
	
		public AdditionalRightsEventBuilderImpl() {
		}
	
		@Override
		@RosettaAttribute("isApplicable")
		public Boolean getIsApplicable() {
			return isApplicable;
		}
		
		@Override
		@RosettaAttribute("qualification")
		public String getQualification() {
			return qualification;
		}
		
		@Override
		@RosettaAttribute("isApplicable")
		public AdditionalRightsEvent.AdditionalRightsEventBuilder setIsApplicable(Boolean isApplicable) {
			this.isApplicable = isApplicable==null?null:isApplicable;
			return this;
		}
		@Override
		@RosettaAttribute("qualification")
		public AdditionalRightsEvent.AdditionalRightsEventBuilder setQualification(String qualification) {
			this.qualification = qualification==null?null:qualification;
			return this;
		}
		
		@Override
		public AdditionalRightsEvent build() {
			return new AdditionalRightsEvent.AdditionalRightsEventImpl(this);
		}
		
		@Override
		public AdditionalRightsEvent.AdditionalRightsEventBuilder toBuilder() {
			return this;
		}
	
		@SuppressWarnings("unchecked")
		@Override
		public AdditionalRightsEvent.AdditionalRightsEventBuilder prune() {
			return this;
		}
		
		@Override
		public boolean hasData() {
			if (getIsApplicable()!=null) return true;
			if (getQualification()!=null) return true;
			return false;
		}
	
		@SuppressWarnings("unchecked")
		@Override
		public AdditionalRightsEvent.AdditionalRightsEventBuilder merge(RosettaModelObjectBuilder other, BuilderMerger merger) {
			AdditionalRightsEvent.AdditionalRightsEventBuilder o = (AdditionalRightsEvent.AdditionalRightsEventBuilder) other;
			
			
			merger.mergeBasic(getIsApplicable(), o.getIsApplicable(), this::setIsApplicable);
			merger.mergeBasic(getQualification(), o.getQualification(), this::setQualification);
			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;
		
			AdditionalRightsEvent _that = getType().cast(o);
		
			if (!Objects.equals(isApplicable, _that.getIsApplicable())) return false;
			if (!Objects.equals(qualification, _that.getQualification())) return false;
			return true;
		}
		
		@Override
		public int hashCode() {
			int _result = 0;
			_result = 31 * _result + (isApplicable != null ? isApplicable.hashCode() : 0);
			_result = 31 * _result + (qualification != null ? qualification.hashCode() : 0);
			return _result;
		}
		
		@Override
		public String toString() {
			return "AdditionalRightsEventBuilder {" +
				"isApplicable=" + this.isApplicable + ", " +
				"qualification=" + this.qualification +
			'}';
		}
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy