org.dmg.pmml.NormContinuous Maven / Gradle / Ivy
package org.dmg.pmml;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import com.fasterxml.jackson.annotation.JsonAutoDetect;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import org.dmg.pmml.adapters.FieldNameAdapter;
import org.dmg.pmml.adapters.NumberAdapter;
import org.jpmml.model.annotations.ValueConstructor;
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
"extensions",
"linearNorms"
})
@XmlRootElement(name = "NormContinuous", namespace = "http://www.dmg.org/PMML-4_3")
@JsonAutoDetect(fieldVisibility = JsonAutoDetect.Visibility.ANY, getterVisibility = JsonAutoDetect.Visibility.NONE, isGetterVisibility = JsonAutoDetect.Visibility.NONE, setterVisibility = JsonAutoDetect.Visibility.NONE)
@JsonInclude(JsonInclude.Include.NON_EMPTY)
@JsonPropertyOrder({
"mapMissingTo",
"field",
"outliers",
"extensions",
"linearNorms"
})
public class NormContinuous
extends Expression
implements HasExtensions , HasFieldReference , HasMapMissingTo
{
@XmlAttribute(name = "mapMissingTo")
@XmlJavaTypeAdapter(NumberAdapter.class)
@org.jpmml.model.annotations.Added((org.dmg.pmml.Version.PMML_3_2))
@JsonProperty("mapMissingTo")
private Number mapMissingTo;
@XmlAttribute(name = "field", required = true)
@XmlJavaTypeAdapter(FieldNameAdapter.class)
@JsonProperty("field")
private FieldName field;
@XmlAttribute(name = "outliers")
@org.jpmml.model.annotations.Added((org.dmg.pmml.Version.PMML_3_2))
@JsonProperty("outliers")
private OutlierTreatmentMethod outliers;
@XmlElement(name = "Extension", namespace = "http://www.dmg.org/PMML-4_3")
@JsonProperty("Extension")
private List extensions;
@XmlElement(name = "LinearNorm", namespace = "http://www.dmg.org/PMML-4_3", required = true)
@JsonProperty("LinearNorm")
private List linearNorms;
private final static long serialVersionUID = 67305489L;
public NormContinuous() {
}
@ValueConstructor
public NormContinuous(
@org.jpmml.model.annotations.Property("field")
FieldName field,
@org.jpmml.model.annotations.Property("linearNorms")
List linearNorms) {
this.field = field;
this.linearNorms = linearNorms;
}
@Override
public Number getMapMissingTo() {
return mapMissingTo;
}
@Override
public NormContinuous setMapMissingTo(
@org.jpmml.model.annotations.Property("mapMissingTo")
Number mapMissingTo) {
this.mapMissingTo = mapMissingTo;
return this;
}
@Override
public FieldName getField() {
return field;
}
@Override
public NormContinuous setField(
@org.jpmml.model.annotations.Property("field")
FieldName field) {
this.field = field;
return this;
}
public OutlierTreatmentMethod getOutliers() {
if (outliers == null) {
return OutlierTreatmentMethod.AS_IS;
} else {
return outliers;
}
}
public NormContinuous setOutliers(
@org.jpmml.model.annotations.Property("outliers")
OutlierTreatmentMethod outliers) {
this.outliers = outliers;
return this;
}
@Override
public boolean hasExtensions() {
return ((this.extensions!= null)&&(this.extensions.size()> 0));
}
@Override
public List getExtensions() {
if (extensions == null) {
extensions = new ArrayList();
}
return this.extensions;
}
@Override
public NormContinuous addExtensions(Extension... extensions) {
getExtensions().addAll(Arrays.asList(extensions));
return this;
}
public boolean hasLinearNorms() {
return ((this.linearNorms!= null)&&(this.linearNorms.size()> 0));
}
public List getLinearNorms() {
if (linearNorms == null) {
linearNorms = new ArrayList();
}
return this.linearNorms;
}
public NormContinuous addLinearNorms(LinearNorm... linearNorms) {
getLinearNorms().addAll(Arrays.asList(linearNorms));
return this;
}
@Override
public VisitorAction accept(Visitor visitor) {
VisitorAction status = visitor.visit(this);
if (status == VisitorAction.CONTINUE) {
visitor.pushParent(this);
if ((status == VisitorAction.CONTINUE)&&hasExtensions()) {
status = PMMLObject.traverse(visitor, getExtensions());
}
if ((status == VisitorAction.CONTINUE)&&hasLinearNorms()) {
status = PMMLObject.traverse(visitor, getLinearNorms());
}
visitor.popParent();
}
if (status == VisitorAction.TERMINATE) {
return VisitorAction.TERMINATE;
}
return VisitorAction.CONTINUE;
}
}