All Downloads are FREE. Search and download functionalities are using the official Maven repository.
Please wait. This can take some minutes ...
Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance.
Project price only 1 $
You can buy this project and download/modify it how often you want.
com.rosetta.jptlegalagreement.model.metafields.FieldWithMetaCustodianEvent Maven / Gradle / Ivy
package com.rosetta.jptlegalagreement.model.metafields;
import com.rosetta.jptlegalagreement.model.CustodianEvent;
import com.rosetta.model.lib.GlobalKey;
import com.rosetta.model.lib.GlobalKey.GlobalKeyBuilder;
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.BasicRosettaMetaData;
import com.rosetta.model.lib.meta.FieldWithMeta;
import com.rosetta.model.lib.meta.FieldWithMeta.FieldWithMetaBuilder;
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.model.metafields.MetaFields;
import java.util.Objects;
import static java.util.Optional.ofNullable;
/**
* @version 1
*/
@RosettaDataType(value="FieldWithMetaCustodianEvent", builder=FieldWithMetaCustodianEvent.FieldWithMetaCustodianEventBuilderImpl.class, version="0.0.0")
public interface FieldWithMetaCustodianEvent extends RosettaModelObject, FieldWithMeta, GlobalKey {
FieldWithMetaCustodianEventMeta metaData = new FieldWithMetaCustodianEventMeta();
/*********************** Getter Methods ***********************/
CustodianEvent getValue();
MetaFields getMeta();
/*********************** Build Methods ***********************/
FieldWithMetaCustodianEvent build();
FieldWithMetaCustodianEvent.FieldWithMetaCustodianEventBuilder toBuilder();
static FieldWithMetaCustodianEvent.FieldWithMetaCustodianEventBuilder builder() {
return new FieldWithMetaCustodianEvent.FieldWithMetaCustodianEventBuilderImpl();
}
/*********************** Utility Methods ***********************/
@Override
default RosettaMetaData extends FieldWithMetaCustodianEvent> metaData() {
return metaData;
}
@Override
default Class extends FieldWithMetaCustodianEvent> getType() {
return FieldWithMetaCustodianEvent.class;
}
@Override
default Class getValueType() {
return CustodianEvent.class;
}
@Override
default void process(RosettaPath path, Processor processor) {
processRosetta(path.newSubPath("value"), processor, CustodianEvent.class, getValue());
processRosetta(path.newSubPath("meta"), processor, MetaFields.class, getMeta());
}
/*********************** Builder Interface ***********************/
interface FieldWithMetaCustodianEventBuilder extends FieldWithMetaCustodianEvent, RosettaModelObjectBuilder, GlobalKey.GlobalKeyBuilder, FieldWithMeta.FieldWithMetaBuilder {
CustodianEvent.CustodianEventBuilder getOrCreateValue();
CustodianEvent.CustodianEventBuilder getValue();
MetaFields.MetaFieldsBuilder getOrCreateMeta();
MetaFields.MetaFieldsBuilder getMeta();
FieldWithMetaCustodianEvent.FieldWithMetaCustodianEventBuilder setValue(CustodianEvent value);
FieldWithMetaCustodianEvent.FieldWithMetaCustodianEventBuilder setMeta(MetaFields meta);
@Override
default void process(RosettaPath path, BuilderProcessor processor) {
processRosetta(path.newSubPath("value"), processor, CustodianEvent.CustodianEventBuilder.class, getValue());
processRosetta(path.newSubPath("meta"), processor, MetaFields.MetaFieldsBuilder.class, getMeta());
}
FieldWithMetaCustodianEvent.FieldWithMetaCustodianEventBuilder prune();
}
/*********************** Immutable Implementation of FieldWithMetaCustodianEvent ***********************/
class FieldWithMetaCustodianEventImpl implements FieldWithMetaCustodianEvent {
private final CustodianEvent value;
private final MetaFields meta;
protected FieldWithMetaCustodianEventImpl(FieldWithMetaCustodianEvent.FieldWithMetaCustodianEventBuilder builder) {
this.value = ofNullable(builder.getValue()).map(f->f.build()).orElse(null);
this.meta = ofNullable(builder.getMeta()).map(f->f.build()).orElse(null);
}
@Override
@RosettaAttribute("value")
public CustodianEvent getValue() {
return value;
}
@Override
@RosettaAttribute("meta")
public MetaFields getMeta() {
return meta;
}
@Override
public FieldWithMetaCustodianEvent build() {
return this;
}
@Override
public FieldWithMetaCustodianEvent.FieldWithMetaCustodianEventBuilder toBuilder() {
FieldWithMetaCustodianEvent.FieldWithMetaCustodianEventBuilder builder = builder();
setBuilderFields(builder);
return builder;
}
protected void setBuilderFields(FieldWithMetaCustodianEvent.FieldWithMetaCustodianEventBuilder builder) {
ofNullable(getValue()).ifPresent(builder::setValue);
ofNullable(getMeta()).ifPresent(builder::setMeta);
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || !(o instanceof RosettaModelObject) || !getType().equals(((RosettaModelObject)o).getType())) return false;
FieldWithMetaCustodianEvent _that = getType().cast(o);
if (!Objects.equals(value, _that.getValue())) return false;
if (!Objects.equals(meta, _that.getMeta())) return false;
return true;
}
@Override
public int hashCode() {
int _result = 0;
_result = 31 * _result + (value != null ? value.hashCode() : 0);
_result = 31 * _result + (meta != null ? meta.hashCode() : 0);
return _result;
}
@Override
public String toString() {
return "FieldWithMetaCustodianEvent {" +
"value=" + this.value + ", " +
"meta=" + this.meta +
'}';
}
}
/*********************** Builder Implementation of FieldWithMetaCustodianEvent ***********************/
class FieldWithMetaCustodianEventBuilderImpl implements FieldWithMetaCustodianEvent.FieldWithMetaCustodianEventBuilder {
protected CustodianEvent.CustodianEventBuilder value;
protected MetaFields.MetaFieldsBuilder meta;
public FieldWithMetaCustodianEventBuilderImpl() {
}
@Override
@RosettaAttribute("value")
public CustodianEvent.CustodianEventBuilder getValue() {
return value;
}
@Override
public CustodianEvent.CustodianEventBuilder getOrCreateValue() {
CustodianEvent.CustodianEventBuilder result;
if (value!=null) {
result = value;
}
else {
result = value = CustodianEvent.builder();
}
return result;
}
@Override
@RosettaAttribute("meta")
public MetaFields.MetaFieldsBuilder getMeta() {
return meta;
}
@Override
public MetaFields.MetaFieldsBuilder getOrCreateMeta() {
MetaFields.MetaFieldsBuilder result;
if (meta!=null) {
result = meta;
}
else {
result = meta = MetaFields.builder();
}
return result;
}
@Override
@RosettaAttribute("value")
public FieldWithMetaCustodianEvent.FieldWithMetaCustodianEventBuilder setValue(CustodianEvent value) {
this.value = value==null?null:value.toBuilder();
return this;
}
@Override
@RosettaAttribute("meta")
public FieldWithMetaCustodianEvent.FieldWithMetaCustodianEventBuilder setMeta(MetaFields meta) {
this.meta = meta==null?null:meta.toBuilder();
return this;
}
@Override
public FieldWithMetaCustodianEvent build() {
return new FieldWithMetaCustodianEvent.FieldWithMetaCustodianEventImpl(this);
}
@Override
public FieldWithMetaCustodianEvent.FieldWithMetaCustodianEventBuilder toBuilder() {
return this;
}
@SuppressWarnings("unchecked")
@Override
public FieldWithMetaCustodianEvent.FieldWithMetaCustodianEventBuilder prune() {
if (value!=null && !value.prune().hasData()) value = null;
if (meta!=null && !meta.prune().hasData()) meta = null;
return this;
}
@Override
public boolean hasData() {
if (getValue()!=null && getValue().hasData()) return true;
return false;
}
@SuppressWarnings("unchecked")
@Override
public FieldWithMetaCustodianEvent.FieldWithMetaCustodianEventBuilder merge(RosettaModelObjectBuilder other, BuilderMerger merger) {
FieldWithMetaCustodianEvent.FieldWithMetaCustodianEventBuilder o = (FieldWithMetaCustodianEvent.FieldWithMetaCustodianEventBuilder) other;
merger.mergeRosetta(getValue(), o.getValue(), this::setValue);
merger.mergeRosetta(getMeta(), o.getMeta(), this::setMeta);
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;
FieldWithMetaCustodianEvent _that = getType().cast(o);
if (!Objects.equals(value, _that.getValue())) return false;
if (!Objects.equals(meta, _that.getMeta())) return false;
return true;
}
@Override
public int hashCode() {
int _result = 0;
_result = 31 * _result + (value != null ? value.hashCode() : 0);
_result = 31 * _result + (meta != null ? meta.hashCode() : 0);
return _result;
}
@Override
public String toString() {
return "FieldWithMetaCustodianEventBuilder {" +
"value=" + this.value + ", " +
"meta=" + this.meta +
'}';
}
}
}
class FieldWithMetaCustodianEventMeta extends BasicRosettaMetaData{
}