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

com.rosetta.testconditional.model.V23 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.V23;
import com.rosetta.testconditional.model.V23.V23Builder;
import com.rosetta.testconditional.model.V23.V23BuilderImpl;
import com.rosetta.testconditional.model.V23.V23Impl;
import com.rosetta.testconditional.model.meta.V23Meta;
import java.util.Objects;

import static java.util.Optional.ofNullable;

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

	V23Meta metaData = new V23Meta();

	/*********************** Getter Methods  ***********************/
	String getWField1();
	String getWField2();
	String getWField3();

	/*********************** Build Methods  ***********************/
	V23 build();
	
	V23.V23Builder toBuilder();
	
	static V23.V23Builder builder() {
		return new V23.V23BuilderImpl();
	}

	/*********************** Utility Methods  ***********************/
	@Override
	default RosettaMetaData metaData() {
		return metaData;
	}
	
	@Override
	default Class getType() {
		return V23.class;
	}
	
	
	@Override
	default void process(RosettaPath path, Processor processor) {
		processor.processBasic(path.newSubPath("wField1"), String.class, getWField1(), this);
		processor.processBasic(path.newSubPath("wField2"), String.class, getWField2(), this);
		processor.processBasic(path.newSubPath("wField3"), String.class, getWField3(), this);
	}
	

	/*********************** Builder Interface  ***********************/
	interface V23Builder extends V23, RosettaModelObjectBuilder {
		V23.V23Builder setWField1(String wField1);
		V23.V23Builder setWField2(String wField2);
		V23.V23Builder setWField3(String wField3);

		@Override
		default void process(RosettaPath path, BuilderProcessor processor) {
			processor.processBasic(path.newSubPath("wField1"), String.class, getWField1(), this);
			processor.processBasic(path.newSubPath("wField2"), String.class, getWField2(), this);
			processor.processBasic(path.newSubPath("wField3"), String.class, getWField3(), this);
		}
		

		V23.V23Builder prune();
	}

	/*********************** Immutable Implementation of V23  ***********************/
	class V23Impl implements V23 {
		private final String wField1;
		private final String wField2;
		private final String wField3;
		
		protected V23Impl(V23.V23Builder builder) {
			this.wField1 = builder.getWField1();
			this.wField2 = builder.getWField2();
			this.wField3 = builder.getWField3();
		}
		
		@Override
		@RosettaAttribute("wField1")
		public String getWField1() {
			return wField1;
		}
		
		@Override
		@RosettaAttribute("wField2")
		public String getWField2() {
			return wField2;
		}
		
		@Override
		@RosettaAttribute("wField3")
		public String getWField3() {
			return wField3;
		}
		
		@Override
		public V23 build() {
			return this;
		}
		
		@Override
		public V23.V23Builder toBuilder() {
			V23.V23Builder builder = builder();
			setBuilderFields(builder);
			return builder;
		}
		
		protected void setBuilderFields(V23.V23Builder builder) {
			ofNullable(getWField1()).ifPresent(builder::setWField1);
			ofNullable(getWField2()).ifPresent(builder::setWField2);
			ofNullable(getWField3()).ifPresent(builder::setWField3);
		}

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

	/*********************** Builder Implementation of V23  ***********************/
	class V23BuilderImpl implements V23.V23Builder {
	
		protected String wField1;
		protected String wField2;
		protected String wField3;
	
		public V23BuilderImpl() {
		}
	
		@Override
		@RosettaAttribute("wField1")
		public String getWField1() {
			return wField1;
		}
		
		@Override
		@RosettaAttribute("wField2")
		public String getWField2() {
			return wField2;
		}
		
		@Override
		@RosettaAttribute("wField3")
		public String getWField3() {
			return wField3;
		}
		
		@Override
		@RosettaAttribute("wField1")
		public V23.V23Builder setWField1(String wField1) {
			this.wField1 = wField1==null?null:wField1;
			return this;
		}
		@Override
		@RosettaAttribute("wField2")
		public V23.V23Builder setWField2(String wField2) {
			this.wField2 = wField2==null?null:wField2;
			return this;
		}
		@Override
		@RosettaAttribute("wField3")
		public V23.V23Builder setWField3(String wField3) {
			this.wField3 = wField3==null?null:wField3;
			return this;
		}
		
		@Override
		public V23 build() {
			return new V23.V23Impl(this);
		}
		
		@Override
		public V23.V23Builder toBuilder() {
			return this;
		}
	
		@SuppressWarnings("unchecked")
		@Override
		public V23.V23Builder prune() {
			return this;
		}
		
		@Override
		public boolean hasData() {
			if (getWField1()!=null) return true;
			if (getWField2()!=null) return true;
			if (getWField3()!=null) return true;
			return false;
		}
	
		@SuppressWarnings("unchecked")
		@Override
		public V23.V23Builder merge(RosettaModelObjectBuilder other, BuilderMerger merger) {
			V23.V23Builder o = (V23.V23Builder) other;
			
			
			merger.mergeBasic(getWField1(), o.getWField1(), this::setWField1);
			merger.mergeBasic(getWField2(), o.getWField2(), this::setWField2);
			merger.mergeBasic(getWField3(), o.getWField3(), this::setWField3);
			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;
		
			V23 _that = getType().cast(o);
		
			if (!Objects.equals(wField1, _that.getWField1())) return false;
			if (!Objects.equals(wField2, _that.getWField2())) return false;
			if (!Objects.equals(wField3, _that.getWField3())) return false;
			return true;
		}
		
		@Override
		public int hashCode() {
			int _result = 0;
			_result = 31 * _result + (wField1 != null ? wField1.hashCode() : 0);
			_result = 31 * _result + (wField2 != null ? wField2.hashCode() : 0);
			_result = 31 * _result + (wField3 != null ? wField3.hashCode() : 0);
			return _result;
		}
		
		@Override
		public String toString() {
			return "V23Builder {" +
				"wField1=" + this.wField1 + ", " +
				"wField2=" + this.wField2 + ", " +
				"wField3=" + this.wField3 +
			'}';
		}
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy