com.rosetta.teststruct.model.RelativeDateOffset_10 Maven / Gradle / Ivy
package com.rosetta.teststruct.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.teststruct.model.Offset_10;
import com.rosetta.teststruct.model.Offset_10.Offset_10Builder;
import com.rosetta.teststruct.model.Offset_10.Offset_10BuilderImpl;
import com.rosetta.teststruct.model.Offset_10.Offset_10Impl;
import com.rosetta.teststruct.model.RelativeDateOffset_10;
import com.rosetta.teststruct.model.RelativeDateOffset_10.RelativeDateOffset_10Builder;
import com.rosetta.teststruct.model.RelativeDateOffset_10.RelativeDateOffset_10BuilderImpl;
import com.rosetta.teststruct.model.RelativeDateOffset_10.RelativeDateOffset_10Impl;
import com.rosetta.teststruct.model.meta.RelativeDateOffset_10Meta;
import java.util.Objects;
import static java.util.Optional.ofNullable;
/**
* @version test
*/
@RosettaDataType(value="RelativeDateOffset_10", builder=RelativeDateOffset_10.RelativeDateOffset_10BuilderImpl.class, version="test")
public interface RelativeDateOffset_10 extends Offset_10 {
RelativeDateOffset_10Meta metaData = new RelativeDateOffset_10Meta();
/*********************** Getter Methods ***********************/
String getBusinessDayConvention();
/*********************** Build Methods ***********************/
RelativeDateOffset_10 build();
RelativeDateOffset_10.RelativeDateOffset_10Builder toBuilder();
static RelativeDateOffset_10.RelativeDateOffset_10Builder builder() {
return new RelativeDateOffset_10.RelativeDateOffset_10BuilderImpl();
}
/*********************** Utility Methods ***********************/
@Override
default RosettaMetaData extends RelativeDateOffset_10> metaData() {
return metaData;
}
@Override
default Class extends RelativeDateOffset_10> getType() {
return RelativeDateOffset_10.class;
}
@Override
default void process(RosettaPath path, Processor processor) {
processor.processBasic(path.newSubPath("periodMultiplier"), Integer.class, getPeriodMultiplier(), this);
processor.processBasic(path.newSubPath("period"), String.class, getPeriod(), this);
processor.processBasic(path.newSubPath("dayType"), String.class, getDayType(), this);
processor.processBasic(path.newSubPath("businessDayConvention"), String.class, getBusinessDayConvention(), this);
}
/*********************** Builder Interface ***********************/
interface RelativeDateOffset_10Builder extends RelativeDateOffset_10, Offset_10.Offset_10Builder {
RelativeDateOffset_10.RelativeDateOffset_10Builder setPeriodMultiplier(Integer periodMultiplier);
RelativeDateOffset_10.RelativeDateOffset_10Builder setPeriod(String period);
RelativeDateOffset_10.RelativeDateOffset_10Builder setDayType(String dayType);
RelativeDateOffset_10.RelativeDateOffset_10Builder setBusinessDayConvention(String businessDayConvention);
@Override
default void process(RosettaPath path, BuilderProcessor processor) {
processor.processBasic(path.newSubPath("periodMultiplier"), Integer.class, getPeriodMultiplier(), this);
processor.processBasic(path.newSubPath("period"), String.class, getPeriod(), this);
processor.processBasic(path.newSubPath("dayType"), String.class, getDayType(), this);
processor.processBasic(path.newSubPath("businessDayConvention"), String.class, getBusinessDayConvention(), this);
}
RelativeDateOffset_10.RelativeDateOffset_10Builder prune();
}
/*********************** Immutable Implementation of RelativeDateOffset_10 ***********************/
class RelativeDateOffset_10Impl extends Offset_10.Offset_10Impl implements RelativeDateOffset_10 {
private final String businessDayConvention;
protected RelativeDateOffset_10Impl(RelativeDateOffset_10.RelativeDateOffset_10Builder builder) {
super(builder);
this.businessDayConvention = builder.getBusinessDayConvention();
}
@Override
@RosettaAttribute("businessDayConvention")
public String getBusinessDayConvention() {
return businessDayConvention;
}
@Override
public RelativeDateOffset_10 build() {
return this;
}
@Override
public RelativeDateOffset_10.RelativeDateOffset_10Builder toBuilder() {
RelativeDateOffset_10.RelativeDateOffset_10Builder builder = builder();
setBuilderFields(builder);
return builder;
}
protected void setBuilderFields(RelativeDateOffset_10.RelativeDateOffset_10Builder builder) {
super.setBuilderFields(builder);
ofNullable(getBusinessDayConvention()).ifPresent(builder::setBusinessDayConvention);
}
@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;
RelativeDateOffset_10 _that = getType().cast(o);
if (!Objects.equals(businessDayConvention, _that.getBusinessDayConvention())) return false;
return true;
}
@Override
public int hashCode() {
int _result = super.hashCode();
_result = 31 * _result + (businessDayConvention != null ? businessDayConvention.hashCode() : 0);
return _result;
}
@Override
public String toString() {
return "RelativeDateOffset_10 {" +
"businessDayConvention=" + this.businessDayConvention +
'}' + " " + super.toString();
}
}
/*********************** Builder Implementation of RelativeDateOffset_10 ***********************/
class RelativeDateOffset_10BuilderImpl extends Offset_10.Offset_10BuilderImpl implements RelativeDateOffset_10.RelativeDateOffset_10Builder {
protected String businessDayConvention;
public RelativeDateOffset_10BuilderImpl() {
}
@Override
@RosettaAttribute("businessDayConvention")
public String getBusinessDayConvention() {
return businessDayConvention;
}
@Override
@RosettaAttribute("periodMultiplier")
public RelativeDateOffset_10.RelativeDateOffset_10Builder setPeriodMultiplier(Integer periodMultiplier) {
this.periodMultiplier = periodMultiplier==null?null:periodMultiplier;
return this;
}
@Override
@RosettaAttribute("period")
public RelativeDateOffset_10.RelativeDateOffset_10Builder setPeriod(String period) {
this.period = period==null?null:period;
return this;
}
@Override
@RosettaAttribute("dayType")
public RelativeDateOffset_10.RelativeDateOffset_10Builder setDayType(String dayType) {
this.dayType = dayType==null?null:dayType;
return this;
}
@Override
@RosettaAttribute("businessDayConvention")
public RelativeDateOffset_10.RelativeDateOffset_10Builder setBusinessDayConvention(String businessDayConvention) {
this.businessDayConvention = businessDayConvention==null?null:businessDayConvention;
return this;
}
@Override
public RelativeDateOffset_10 build() {
return new RelativeDateOffset_10.RelativeDateOffset_10Impl(this);
}
@Override
public RelativeDateOffset_10.RelativeDateOffset_10Builder toBuilder() {
return this;
}
@SuppressWarnings("unchecked")
@Override
public RelativeDateOffset_10.RelativeDateOffset_10Builder prune() {
super.prune();
return this;
}
@Override
public boolean hasData() {
if (super.hasData()) return true;
if (getBusinessDayConvention()!=null) return true;
return false;
}
@SuppressWarnings("unchecked")
@Override
public RelativeDateOffset_10.RelativeDateOffset_10Builder merge(RosettaModelObjectBuilder other, BuilderMerger merger) {
super.merge(other, merger);
RelativeDateOffset_10.RelativeDateOffset_10Builder o = (RelativeDateOffset_10.RelativeDateOffset_10Builder) other;
merger.mergeBasic(getBusinessDayConvention(), o.getBusinessDayConvention(), this::setBusinessDayConvention);
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;
RelativeDateOffset_10 _that = getType().cast(o);
if (!Objects.equals(businessDayConvention, _that.getBusinessDayConvention())) return false;
return true;
}
@Override
public int hashCode() {
int _result = super.hashCode();
_result = 31 * _result + (businessDayConvention != null ? businessDayConvention.hashCode() : 0);
return _result;
}
@Override
public String toString() {
return "RelativeDateOffset_10Builder {" +
"businessDayConvention=" + this.businessDayConvention +
'}' + " " + super.toString();
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy