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

com.rosetta.testconditional.model.Y2_3 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.Y2_3;
import com.rosetta.testconditional.model.Y2_3.Y2_3Builder;
import com.rosetta.testconditional.model.Y2_3.Y2_3BuilderImpl;
import com.rosetta.testconditional.model.Y2_3.Y2_3Impl;
import com.rosetta.testconditional.model.meta.Y2_3Meta;
import java.util.Objects;

import static java.util.Optional.ofNullable;

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

	Y2_3Meta metaData = new Y2_3Meta();

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

	/*********************** Build Methods  ***********************/
	Y2_3 build();
	
	Y2_3.Y2_3Builder toBuilder();
	
	static Y2_3.Y2_3Builder builder() {
		return new Y2_3.Y2_3BuilderImpl();
	}

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

	/*********************** Builder Interface  ***********************/
	interface Y2_3Builder extends Y2_3, RosettaModelObjectBuilder {
		Y2_3.Y2_3Builder setZField(String zField);

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

		Y2_3.Y2_3Builder prune();
	}

	/*********************** Immutable Implementation of Y2_3  ***********************/
	class Y2_3Impl implements Y2_3 {
		private final String zField;
		
		protected Y2_3Impl(Y2_3.Y2_3Builder builder) {
			this.zField = builder.getZField();
		}
		
		@Override
		@RosettaAttribute("zField")
		public String getZField() {
			return zField;
		}
		
		@Override
		public Y2_3 build() {
			return this;
		}
		
		@Override
		public Y2_3.Y2_3Builder toBuilder() {
			Y2_3.Y2_3Builder builder = builder();
			setBuilderFields(builder);
			return builder;
		}
		
		protected void setBuilderFields(Y2_3.Y2_3Builder builder) {
			ofNullable(getZField()).ifPresent(builder::setZField);
		}

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy