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

com.rosetta.testconditional.model.Y6 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.Y6;
import com.rosetta.testconditional.model.Y6.Y6Builder;
import com.rosetta.testconditional.model.Y6.Y6BuilderImpl;
import com.rosetta.testconditional.model.Y6.Y6Impl;
import com.rosetta.testconditional.model.meta.Y6Meta;
import java.util.Objects;

import static java.util.Optional.ofNullable;

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

	Y6Meta metaData = new Y6Meta();

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

	/*********************** Build Methods  ***********************/
	Y6 build();
	
	Y6.Y6Builder toBuilder();
	
	static Y6.Y6Builder builder() {
		return new Y6.Y6BuilderImpl();
	}

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

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

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

		Y6.Y6Builder prune();
	}

	/*********************** Immutable Implementation of Y6  ***********************/
	class Y6Impl implements Y6 {
		private final String zField;
		
		protected Y6Impl(Y6.Y6Builder builder) {
			this.zField = builder.getZField();
		}
		
		@Override
		@RosettaAttribute("zField")
		public String getZField() {
			return zField;
		}
		
		@Override
		public Y6 build() {
			return this;
		}
		
		@Override
		public Y6.Y6Builder toBuilder() {
			Y6.Y6Builder builder = builder();
			setBuilderFields(builder);
			return builder;
		}
		
		protected void setBuilderFields(Y6.Y6Builder 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;
		
			Y6 _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 "Y6 {" +
				"zField=" + this.zField +
			'}';
		}
	}

	/*********************** Builder Implementation of Y6  ***********************/
	class Y6BuilderImpl implements Y6.Y6Builder {
	
		protected String zField;
	
		public Y6BuilderImpl() {
		}
	
		@Override
		@RosettaAttribute("zField")
		public String getZField() {
			return zField;
		}
		
		@Override
		@RosettaAttribute("zField")
		public Y6.Y6Builder setZField(String zField) {
			this.zField = zField==null?null:zField;
			return this;
		}
		
		@Override
		public Y6 build() {
			return new Y6.Y6Impl(this);
		}
		
		@Override
		public Y6.Y6Builder toBuilder() {
			return this;
		}
	
		@SuppressWarnings("unchecked")
		@Override
		public Y6.Y6Builder prune() {
			return this;
		}
		
		@Override
		public boolean hasData() {
			if (getZField()!=null) return true;
			return false;
		}
	
		@SuppressWarnings("unchecked")
		@Override
		public Y6.Y6Builder merge(RosettaModelObjectBuilder other, BuilderMerger merger) {
			Y6.Y6Builder o = (Y6.Y6Builder) 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;
		
			Y6 _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 "Y6Builder {" +
				"zField=" + this.zField +
			'}';
		}
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy