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

com.rosetta.jptcadditionalterminationevent.model.AdditionalTerminationEvent Maven / Gradle / Ivy

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

import com.rosetta.jptcadditionalterminationevent.model.AdditionalTerminationEvent;
import com.rosetta.jptcadditionalterminationevent.model.AdditionalTerminationEvent.AdditionalTerminationEventBuilder;
import com.rosetta.jptcadditionalterminationevent.model.AdditionalTerminationEvent.AdditionalTerminationEventBuilderImpl;
import com.rosetta.jptcadditionalterminationevent.model.AdditionalTerminationEvent.AdditionalTerminationEventImpl;
import com.rosetta.jptcadditionalterminationevent.model.meta.AdditionalTerminationEventMeta;
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="AdditionalTerminationEvent", builder=AdditionalTerminationEvent.AdditionalTerminationEventBuilderImpl.class, version="test")
public interface AdditionalTerminationEvent extends RosettaModelObject {

	AdditionalTerminationEventMeta metaData = new AdditionalTerminationEventMeta();

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

	/*********************** Build Methods  ***********************/
	AdditionalTerminationEvent build();
	
	AdditionalTerminationEvent.AdditionalTerminationEventBuilder toBuilder();
	
	static AdditionalTerminationEvent.AdditionalTerminationEventBuilder builder() {
		return new AdditionalTerminationEvent.AdditionalTerminationEventBuilderImpl();
	}

	/*********************** Utility Methods  ***********************/
	@Override
	default RosettaMetaData metaData() {
		return metaData;
	}
	
	@Override
	default Class getType() {
		return AdditionalTerminationEvent.class;
	}
	
	
	@Override
	default void process(RosettaPath path, Processor processor) {
		processor.processBasic(path.newSubPath("name"), String.class, getName(), this);
	}
	

	/*********************** Builder Interface  ***********************/
	interface AdditionalTerminationEventBuilder extends AdditionalTerminationEvent, RosettaModelObjectBuilder {
		AdditionalTerminationEvent.AdditionalTerminationEventBuilder setName(String name);

		@Override
		default void process(RosettaPath path, BuilderProcessor processor) {
			processor.processBasic(path.newSubPath("name"), String.class, getName(), this);
		}
		

		AdditionalTerminationEvent.AdditionalTerminationEventBuilder prune();
	}

	/*********************** Immutable Implementation of AdditionalTerminationEvent  ***********************/
	class AdditionalTerminationEventImpl implements AdditionalTerminationEvent {
		private final String name;
		
		protected AdditionalTerminationEventImpl(AdditionalTerminationEvent.AdditionalTerminationEventBuilder builder) {
			this.name = builder.getName();
		}
		
		@Override
		@RosettaAttribute("name")
		public String getName() {
			return name;
		}
		
		@Override
		public AdditionalTerminationEvent build() {
			return this;
		}
		
		@Override
		public AdditionalTerminationEvent.AdditionalTerminationEventBuilder toBuilder() {
			AdditionalTerminationEvent.AdditionalTerminationEventBuilder builder = builder();
			setBuilderFields(builder);
			return builder;
		}
		
		protected void setBuilderFields(AdditionalTerminationEvent.AdditionalTerminationEventBuilder builder) {
			ofNullable(getName()).ifPresent(builder::setName);
		}

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

	/*********************** Builder Implementation of AdditionalTerminationEvent  ***********************/
	class AdditionalTerminationEventBuilderImpl implements AdditionalTerminationEvent.AdditionalTerminationEventBuilder {
	
		protected String name;
	
		public AdditionalTerminationEventBuilderImpl() {
		}
	
		@Override
		@RosettaAttribute("name")
		public String getName() {
			return name;
		}
		
		@Override
		@RosettaAttribute("name")
		public AdditionalTerminationEvent.AdditionalTerminationEventBuilder setName(String name) {
			this.name = name==null?null:name;
			return this;
		}
		
		@Override
		public AdditionalTerminationEvent build() {
			return new AdditionalTerminationEvent.AdditionalTerminationEventImpl(this);
		}
		
		@Override
		public AdditionalTerminationEvent.AdditionalTerminationEventBuilder toBuilder() {
			return this;
		}
	
		@SuppressWarnings("unchecked")
		@Override
		public AdditionalTerminationEvent.AdditionalTerminationEventBuilder prune() {
			return this;
		}
		
		@Override
		public boolean hasData() {
			if (getName()!=null) return true;
			return false;
		}
	
		@SuppressWarnings("unchecked")
		@Override
		public AdditionalTerminationEvent.AdditionalTerminationEventBuilder merge(RosettaModelObjectBuilder other, BuilderMerger merger) {
			AdditionalTerminationEvent.AdditionalTerminationEventBuilder o = (AdditionalTerminationEvent.AdditionalTerminationEventBuilder) other;
			
			
			merger.mergeBasic(getName(), o.getName(), this::setName);
			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;
		
			AdditionalTerminationEvent _that = getType().cast(o);
		
			if (!Objects.equals(name, _that.getName())) return false;
			return true;
		}
		
		@Override
		public int hashCode() {
			int _result = 0;
			_result = 31 * _result + (name != null ? name.hashCode() : 0);
			return _result;
		}
		
		@Override
		public String toString() {
			return "AdditionalTerminationEventBuilder {" +
				"name=" + this.name +
			'}';
		}
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy