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

com.rosetta.jptoneofconditional.model.BranchTwo Maven / Gradle / Ivy

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

import com.rosetta.jptoneofconditional.model.BranchTwo;
import com.rosetta.jptoneofconditional.model.BranchTwo.BranchTwoBuilder;
import com.rosetta.jptoneofconditional.model.BranchTwo.BranchTwoBuilderImpl;
import com.rosetta.jptoneofconditional.model.BranchTwo.BranchTwoImpl;
import com.rosetta.jptoneofconditional.model.meta.BranchTwoMeta;
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="BranchTwo", builder=BranchTwo.BranchTwoBuilderImpl.class, version="test")
public interface BranchTwo extends RosettaModelObject {

	BranchTwoMeta metaData = new BranchTwoMeta();

	/*********************** Getter Methods  ***********************/
	Boolean getBTwoField();

	/*********************** Build Methods  ***********************/
	BranchTwo build();
	
	BranchTwo.BranchTwoBuilder toBuilder();
	
	static BranchTwo.BranchTwoBuilder builder() {
		return new BranchTwo.BranchTwoBuilderImpl();
	}

	/*********************** Utility Methods  ***********************/
	@Override
	default RosettaMetaData metaData() {
		return metaData;
	}
	
	@Override
	default Class getType() {
		return BranchTwo.class;
	}
	
	
	@Override
	default void process(RosettaPath path, Processor processor) {
		processor.processBasic(path.newSubPath("bTwoField"), Boolean.class, getBTwoField(), this);
	}
	

	/*********************** Builder Interface  ***********************/
	interface BranchTwoBuilder extends BranchTwo, RosettaModelObjectBuilder {
		BranchTwo.BranchTwoBuilder setBTwoField(Boolean bTwoField);

		@Override
		default void process(RosettaPath path, BuilderProcessor processor) {
			processor.processBasic(path.newSubPath("bTwoField"), Boolean.class, getBTwoField(), this);
		}
		

		BranchTwo.BranchTwoBuilder prune();
	}

	/*********************** Immutable Implementation of BranchTwo  ***********************/
	class BranchTwoImpl implements BranchTwo {
		private final Boolean bTwoField;
		
		protected BranchTwoImpl(BranchTwo.BranchTwoBuilder builder) {
			this.bTwoField = builder.getBTwoField();
		}
		
		@Override
		@RosettaAttribute("bTwoField")
		public Boolean getBTwoField() {
			return bTwoField;
		}
		
		@Override
		public BranchTwo build() {
			return this;
		}
		
		@Override
		public BranchTwo.BranchTwoBuilder toBuilder() {
			BranchTwo.BranchTwoBuilder builder = builder();
			setBuilderFields(builder);
			return builder;
		}
		
		protected void setBuilderFields(BranchTwo.BranchTwoBuilder builder) {
			ofNullable(getBTwoField()).ifPresent(builder::setBTwoField);
		}

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy