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

com.rosetta.testconditional.model.Top23b Maven / Gradle / Ivy

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

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 com.rosetta.testconditional.model.Top23b;
import com.rosetta.testconditional.model.Top23b.Top23bBuilder;
import com.rosetta.testconditional.model.Top23b.Top23bBuilderImpl;
import com.rosetta.testconditional.model.Top23b.Top23bImpl;
import com.rosetta.testconditional.model.V23b;
import com.rosetta.testconditional.model.meta.Top23bMeta;
import java.util.Objects;

import static java.util.Optional.ofNullable;

/**
 * @version test
 */
@RosettaDataType(value="Top23b", builder=Top23b.Top23bBuilderImpl.class, version="test")
public interface Top23b extends RosettaModelObject {

	Top23bMeta metaData = new Top23bMeta();

	/*********************** Getter Methods  ***********************/
	V23b getVField();

	/*********************** Build Methods  ***********************/
	Top23b build();
	
	Top23b.Top23bBuilder toBuilder();
	
	static Top23b.Top23bBuilder builder() {
		return new Top23b.Top23bBuilderImpl();
	}

	/*********************** Utility Methods  ***********************/
	@Override
	default RosettaMetaData metaData() {
		return metaData;
	}
	
	@Override
	default Class getType() {
		return Top23b.class;
	}
	
	
	@Override
	default void process(RosettaPath path, Processor processor) {
		processRosetta(path.newSubPath("vField"), processor, V23b.class, getVField());
	}
	

	/*********************** Builder Interface  ***********************/
	interface Top23bBuilder extends Top23b, RosettaModelObjectBuilder {
		V23b.V23bBuilder getOrCreateVField();
		V23b.V23bBuilder getVField();
		Top23b.Top23bBuilder setVField(V23b vField);

		@Override
		default void process(RosettaPath path, BuilderProcessor processor) {
			processRosetta(path.newSubPath("vField"), processor, V23b.V23bBuilder.class, getVField());
		}
		

		Top23b.Top23bBuilder prune();
	}

	/*********************** Immutable Implementation of Top23b  ***********************/
	class Top23bImpl implements Top23b {
		private final V23b vField;
		
		protected Top23bImpl(Top23b.Top23bBuilder builder) {
			this.vField = ofNullable(builder.getVField()).map(f->f.build()).orElse(null);
		}
		
		@Override
		@RosettaAttribute("vField")
		public V23b getVField() {
			return vField;
		}
		
		@Override
		public Top23b build() {
			return this;
		}
		
		@Override
		public Top23b.Top23bBuilder toBuilder() {
			Top23b.Top23bBuilder builder = builder();
			setBuilderFields(builder);
			return builder;
		}
		
		protected void setBuilderFields(Top23b.Top23bBuilder builder) {
			ofNullable(getVField()).ifPresent(builder::setVField);
		}

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

	/*********************** Builder Implementation of Top23b  ***********************/
	class Top23bBuilderImpl implements Top23b.Top23bBuilder {
	
		protected V23b.V23bBuilder vField;
	
		public Top23bBuilderImpl() {
		}
	
		@Override
		@RosettaAttribute("vField")
		public V23b.V23bBuilder getVField() {
			return vField;
		}
		
		@Override
		public V23b.V23bBuilder getOrCreateVField() {
			V23b.V23bBuilder result;
			if (vField!=null) {
				result = vField;
			}
			else {
				result = vField = V23b.builder();
			}
			
			return result;
		}
		
		@Override
		@RosettaAttribute("vField")
		public Top23b.Top23bBuilder setVField(V23b vField) {
			this.vField = vField==null?null:vField.toBuilder();
			return this;
		}
		
		@Override
		public Top23b build() {
			return new Top23b.Top23bImpl(this);
		}
		
		@Override
		public Top23b.Top23bBuilder toBuilder() {
			return this;
		}
	
		@SuppressWarnings("unchecked")
		@Override
		public Top23b.Top23bBuilder prune() {
			if (vField!=null && !vField.prune().hasData()) vField = null;
			return this;
		}
		
		@Override
		public boolean hasData() {
			if (getVField()!=null && getVField().hasData()) return true;
			return false;
		}
	
		@SuppressWarnings("unchecked")
		@Override
		public Top23b.Top23bBuilder merge(RosettaModelObjectBuilder other, BuilderMerger merger) {
			Top23b.Top23bBuilder o = (Top23b.Top23bBuilder) other;
			
			merger.mergeRosetta(getVField(), o.getVField(), this::setVField);
			
			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;
		
			Top23b _that = getType().cast(o);
		
			if (!Objects.equals(vField, _that.getVField())) return false;
			return true;
		}
		
		@Override
		public int hashCode() {
			int _result = 0;
			_result = 31 * _result + (vField != null ? vField.hashCode() : 0);
			return _result;
		}
		
		@Override
		public String toString() {
			return "Top23bBuilder {" +
				"vField=" + this.vField +
			'}';
		}
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy