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

com.rosetta.testconditional.model.W18_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.W18_3;
import com.rosetta.testconditional.model.W18_3.W18_3Builder;
import com.rosetta.testconditional.model.W18_3.W18_3BuilderImpl;
import com.rosetta.testconditional.model.W18_3.W18_3Impl;
import com.rosetta.testconditional.model.meta.W18_3Meta;
import java.util.Objects;

import static java.util.Optional.ofNullable;

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

	W18_3Meta metaData = new W18_3Meta();

	/*********************** Getter Methods  ***********************/
	String getXField();
	String getYField();

	/*********************** Build Methods  ***********************/
	W18_3 build();
	
	W18_3.W18_3Builder toBuilder();
	
	static W18_3.W18_3Builder builder() {
		return new W18_3.W18_3BuilderImpl();
	}

	/*********************** Utility Methods  ***********************/
	@Override
	default RosettaMetaData metaData() {
		return metaData;
	}
	
	@Override
	default Class getType() {
		return W18_3.class;
	}
	
	
	@Override
	default void process(RosettaPath path, Processor processor) {
		processor.processBasic(path.newSubPath("xField"), String.class, getXField(), this);
		processor.processBasic(path.newSubPath("yField"), String.class, getYField(), this);
	}
	

	/*********************** Builder Interface  ***********************/
	interface W18_3Builder extends W18_3, RosettaModelObjectBuilder {
		W18_3.W18_3Builder setXField(String xField);
		W18_3.W18_3Builder setYField(String yField);

		@Override
		default void process(RosettaPath path, BuilderProcessor processor) {
			processor.processBasic(path.newSubPath("xField"), String.class, getXField(), this);
			processor.processBasic(path.newSubPath("yField"), String.class, getYField(), this);
		}
		

		W18_3.W18_3Builder prune();
	}

	/*********************** Immutable Implementation of W18_3  ***********************/
	class W18_3Impl implements W18_3 {
		private final String xField;
		private final String yField;
		
		protected W18_3Impl(W18_3.W18_3Builder builder) {
			this.xField = builder.getXField();
			this.yField = builder.getYField();
		}
		
		@Override
		@RosettaAttribute("xField")
		public String getXField() {
			return xField;
		}
		
		@Override
		@RosettaAttribute("yField")
		public String getYField() {
			return yField;
		}
		
		@Override
		public W18_3 build() {
			return this;
		}
		
		@Override
		public W18_3.W18_3Builder toBuilder() {
			W18_3.W18_3Builder builder = builder();
			setBuilderFields(builder);
			return builder;
		}
		
		protected void setBuilderFields(W18_3.W18_3Builder builder) {
			ofNullable(getXField()).ifPresent(builder::setXField);
			ofNullable(getYField()).ifPresent(builder::setYField);
		}

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

	/*********************** Builder Implementation of W18_3  ***********************/
	class W18_3BuilderImpl implements W18_3.W18_3Builder {
	
		protected String xField;
		protected String yField;
	
		public W18_3BuilderImpl() {
		}
	
		@Override
		@RosettaAttribute("xField")
		public String getXField() {
			return xField;
		}
		
		@Override
		@RosettaAttribute("yField")
		public String getYField() {
			return yField;
		}
		
		@Override
		@RosettaAttribute("xField")
		public W18_3.W18_3Builder setXField(String xField) {
			this.xField = xField==null?null:xField;
			return this;
		}
		@Override
		@RosettaAttribute("yField")
		public W18_3.W18_3Builder setYField(String yField) {
			this.yField = yField==null?null:yField;
			return this;
		}
		
		@Override
		public W18_3 build() {
			return new W18_3.W18_3Impl(this);
		}
		
		@Override
		public W18_3.W18_3Builder toBuilder() {
			return this;
		}
	
		@SuppressWarnings("unchecked")
		@Override
		public W18_3.W18_3Builder prune() {
			return this;
		}
		
		@Override
		public boolean hasData() {
			if (getXField()!=null) return true;
			if (getYField()!=null) return true;
			return false;
		}
	
		@SuppressWarnings("unchecked")
		@Override
		public W18_3.W18_3Builder merge(RosettaModelObjectBuilder other, BuilderMerger merger) {
			W18_3.W18_3Builder o = (W18_3.W18_3Builder) other;
			
			
			merger.mergeBasic(getXField(), o.getXField(), this::setXField);
			merger.mergeBasic(getYField(), o.getYField(), this::setYField);
			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;
		
			W18_3 _that = getType().cast(o);
		
			if (!Objects.equals(xField, _that.getXField())) return false;
			if (!Objects.equals(yField, _that.getYField())) return false;
			return true;
		}
		
		@Override
		public int hashCode() {
			int _result = 0;
			_result = 31 * _result + (xField != null ? xField.hashCode() : 0);
			_result = 31 * _result + (yField != null ? yField.hashCode() : 0);
			return _result;
		}
		
		@Override
		public String toString() {
			return "W18_3Builder {" +
				"xField=" + this.xField + ", " +
				"yField=" + this.yField +
			'}';
		}
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy