erconnect-maven-plugin.1.6.source-code.ivoObjectTemplate.vm Maven / Gradle / Ivy
package ${ivod.pkgName}.requests;
#foreach ( $imp in $mmh.getImports() )
import $imp;
#end
import ${ivod.pkgName}.${mmh.getIVOClazzName()};
import de.taimos.dvalin.interconnect.model.ivo.AbstractIVO;
/**
* $ivod.comment
*
* @author $ivod.author
*/
@SuppressWarnings("all")
#if ($mmh.isDeprecated())
@Deprecated
@ToBeRemoved(date="$ivod.removalDate")
#end
@JsonDeserialize(builder = ${mmh.getModIVOClazzName()}.${mmh.getModIVOClazzName()}Builder.class)
public class $mmh.getModIVOClazzName() extends $mmh.getParent() implements I$mmh.getModIVOClazzName() {
private static final long serialVersionUID = ${ivod.version}L;
/**
* Builder for the read-only ivo
*
*/
#if ($mmh.isDeprecated())
@Deprecated
@ToBeRemoved(date="$ivod.removalDate")
#end
@JsonPOJOBuilder()
public static class ${mmh.getModIVOClazzName()}Builder extends Abstract${mmh.getModIVOClazzName()}Builder<${mmh.getModIVOClazzName()}Builder> implements IVOBuilder {
// nothing to do here, really
}
/**
* Abstract Builder for the read-only ivo
*
* @param type of builder
*/
public abstract static class Abstract${mmh.getModIVOClazzName()}Builder> $mmh.getParentBuilder() $mmh.getBuilderImplements() {
private ${mmh.getIVOClazzName()} value;
/**
* This field is required.
* the object
*
* @param obj the value to set
* @return the builder
*
**/
@Nonnull
@SuppressWarnings("unchecked")
public E withValue(${mmh.getIVOClazzName()} obj) {
this.value = obj;
return (E) this;
}
protected void internalFillFromIVO(${mmh.getModIVOClazzName()} ivo) {
this.withValue(ivo.value);
}
/**
* @return the entry
**/
public ${mmh.getModIVOClazzName()} build() {
if (this.value == null) {
throw new IllegalStateException("The attribute value must not be null!");
}
${mmh.getModIVOClazzName()} result = new ${mmh.getModIVOClazzName()}(this);
return result;
}
}
private final ${mmh.getIVOClazzName()} value;
protected ${mmh.getModIVOClazzName()}(Abstract${mmh.getModIVOClazzName()}Builder> builder) {
this.value = builder.value;
}
public ${mmh.getIVOClazzName()} getValue() {
return this.value;
}
@SuppressWarnings("unchecked")
@Override
public T createBuilder() {
${mmh.getModIVOClazzName()}Builder builder = new ${mmh.getModIVOClazzName()}Builder();
builder.internalFillFromIVO(this);
return (T) builder;
}
@Override
public ${mmh.getModIVOClazzName()} clone() {
return (${mmh.getModIVOClazzName()}) super.clone();
}
#if ( $ivod.identity && !$ivod.parentName )
@Override
public String toString() {
return this.getClass().getName() + " " + this.value;
}
@Override
public boolean equals(Object obj) {
if(obj instanceof $mmh.getModIVOClazzName()) {
return this.value.equals((($mmh.getModIVOClazzName())obj).value);
}
return false;
}
#end
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy