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

com.rosetta.externalsynonym.model.Y8 Maven / Gradle / Ivy

There is a newer version: 11.25.1
Show newest version
package com.rosetta.externalsynonym.model;

import com.rosetta.externalsynonym.model.Super8;
import com.rosetta.externalsynonym.model.Super8.Super8Builder;
import com.rosetta.externalsynonym.model.Super8.Super8BuilderImpl;
import com.rosetta.externalsynonym.model.Super8.Super8Impl;
import com.rosetta.externalsynonym.model.Y8;
import com.rosetta.externalsynonym.model.Y8.Y8Builder;
import com.rosetta.externalsynonym.model.Y8.Y8BuilderImpl;
import com.rosetta.externalsynonym.model.Y8.Y8Impl;
import com.rosetta.externalsynonym.model.meta.Y8Meta;
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 java.util.Objects;

import static java.util.Optional.ofNullable;

/**
 * @version test
 */
@RosettaDataType(value="Y8", builder=Y8.Y8BuilderImpl.class, version="test")
public interface Y8 extends Super8 {

	Y8Meta metaData = new Y8Meta();

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

	/*********************** Build Methods  ***********************/
	Y8 build();
	
	Y8.Y8Builder toBuilder();
	
	static Y8.Y8Builder builder() {
		return new Y8.Y8BuilderImpl();
	}

	/*********************** Utility Methods  ***********************/
	@Override
	default RosettaMetaData metaData() {
		return metaData;
	}
	
	@Override
	default Class getType() {
		return Y8.class;
	}
	
	
	@Override
	default void process(RosettaPath path, Processor processor) {
		processor.processBasic(path.newSubPath("superField"), String.class, getSuperField(), this);
		processor.processBasic(path.newSubPath("yyField"), String.class, getYyField(), this);
	}
	

	/*********************** Builder Interface  ***********************/
	interface Y8Builder extends Y8, Super8.Super8Builder {
		Y8.Y8Builder setSuperField(String superField);
		Y8.Y8Builder setYyField(String yyField);

		@Override
		default void process(RosettaPath path, BuilderProcessor processor) {
			processor.processBasic(path.newSubPath("superField"), String.class, getSuperField(), this);
			processor.processBasic(path.newSubPath("yyField"), String.class, getYyField(), this);
		}
		

		Y8.Y8Builder prune();
	}

	/*********************** Immutable Implementation of Y8  ***********************/
	class Y8Impl extends Super8.Super8Impl implements Y8 {
		private final String yyField;
		
		protected Y8Impl(Y8.Y8Builder builder) {
			super(builder);
			this.yyField = builder.getYyField();
		}
		
		@Override
		@RosettaAttribute("yyField")
		public String getYyField() {
			return yyField;
		}
		
		@Override
		public Y8 build() {
			return this;
		}
		
		@Override
		public Y8.Y8Builder toBuilder() {
			Y8.Y8Builder builder = builder();
			setBuilderFields(builder);
			return builder;
		}
		
		protected void setBuilderFields(Y8.Y8Builder builder) {
			super.setBuilderFields(builder);
			ofNullable(getYyField()).ifPresent(builder::setYyField);
		}

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

	/*********************** Builder Implementation of Y8  ***********************/
	class Y8BuilderImpl extends Super8.Super8BuilderImpl  implements Y8.Y8Builder {
	
		protected String yyField;
	
		public Y8BuilderImpl() {
		}
	
		@Override
		@RosettaAttribute("yyField")
		public String getYyField() {
			return yyField;
		}
		
		@Override
		@RosettaAttribute("superField")
		public Y8.Y8Builder setSuperField(String superField) {
			this.superField = superField==null?null:superField;
			return this;
		}
		@Override
		@RosettaAttribute("yyField")
		public Y8.Y8Builder setYyField(String yyField) {
			this.yyField = yyField==null?null:yyField;
			return this;
		}
		
		@Override
		public Y8 build() {
			return new Y8.Y8Impl(this);
		}
		
		@Override
		public Y8.Y8Builder toBuilder() {
			return this;
		}
	
		@SuppressWarnings("unchecked")
		@Override
		public Y8.Y8Builder prune() {
			super.prune();
			return this;
		}
		
		@Override
		public boolean hasData() {
			if (super.hasData()) return true;
			if (getYyField()!=null) return true;
			return false;
		}
	
		@SuppressWarnings("unchecked")
		@Override
		public Y8.Y8Builder merge(RosettaModelObjectBuilder other, BuilderMerger merger) {
			super.merge(other, merger);
			
			Y8.Y8Builder o = (Y8.Y8Builder) other;
			
			
			merger.mergeBasic(getYyField(), o.getYyField(), this::setYyField);
			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;
			if (!super.equals(o)) return false;
		
			Y8 _that = getType().cast(o);
		
			if (!Objects.equals(yyField, _that.getYyField())) return false;
			return true;
		}
		
		@Override
		public int hashCode() {
			int _result = super.hashCode();
			_result = 31 * _result + (yyField != null ? yyField.hashCode() : 0);
			return _result;
		}
		
		@Override
		public String toString() {
			return "Y8Builder {" +
				"yyField=" + this.yyField +
			'}' + " " + super.toString();
		}
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy