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

com.rosetta.testconditional.model.V12 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.V12;
import com.rosetta.testconditional.model.V12.V12Builder;
import com.rosetta.testconditional.model.V12.V12BuilderImpl;
import com.rosetta.testconditional.model.V12.V12Impl;
import com.rosetta.testconditional.model.meta.V12Meta;
import java.util.Objects;

import static java.util.Optional.ofNullable;

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

	V12Meta metaData = new V12Meta();

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

	/*********************** Build Methods  ***********************/
	V12 build();
	
	V12.V12Builder toBuilder();
	
	static V12.V12Builder builder() {
		return new V12.V12BuilderImpl();
	}

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

	/*********************** Builder Interface  ***********************/
	interface V12Builder extends V12, RosettaModelObjectBuilder {
		V12.V12Builder setXField(String xField);

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

		V12.V12Builder prune();
	}

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

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy