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

org.dmg.pmml.Constant Maven / Gradle / Ivy


package org.dmg.pmml;

import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlSchemaType;
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.XmlValue;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import com.fasterxml.jackson.annotation.JsonRootName;
import org.dmg.pmml.adapters.ObjectAdapter;
import org.eclipse.persistence.oxm.annotations.XmlValueExtension;
import org.jpmml.model.annotations.ValueConstructor;

@XmlRootElement(name = "Constant", namespace = "http://www.dmg.org/PMML-4_4")
@XmlType(name = "", propOrder = {
    "value"
})
@JsonRootName("Constant")
@JsonPropertyOrder({
    "dataType",
    "missing",
    "value"
})
public class Constant
    extends Expression
    implements HasDataType
{

    @XmlAttribute(name = "dataType")
    @org.jpmml.model.annotations.Added((org.dmg.pmml.Version.PMML_3_1))
    @JsonProperty("dataType")
    private DataType dataType;
    @XmlAttribute(name = "missing")
    @org.jpmml.model.annotations.Added((org.dmg.pmml.Version.PMML_4_4))
    @JsonProperty("missing")
    private Boolean missing;
    @XmlValue
    @XmlJavaTypeAdapter(ObjectAdapter.class)
    @XmlSchemaType(name = "anySimpleType")
    @JsonProperty("value")
    @XmlValueExtension
    private Object value;
    private final static Boolean DEFAULT_MISSING = false;
    private final static long serialVersionUID = 67371009L;

    public Constant() {
    }

    @ValueConstructor
    public Constant(
        @org.jpmml.model.annotations.Property("value")
        Object value) {
        this.value = value;
    }

    @Override
    public DataType getDataType() {
        return dataType;
    }

    @Override
    public Constant setDataType(
        @org.jpmml.model.annotations.Property("dataType")
        DataType dataType) {
        this.dataType = dataType;
        return this;
    }

    public boolean isMissing() {
        if (missing == null) {
            return DEFAULT_MISSING;
        } else {
            return missing;
        }
    }

    public Constant setMissing(
        @org.jpmml.model.annotations.Property("missing")
        Boolean missing) {
        this.missing = missing;
        return this;
    }

    public Object getValue() {
        return value;
    }

    public Constant setValue(
        @org.jpmml.model.annotations.Property("value")
        Object value) {
        this.value = value;
        return this;
    }

    @Override
    public VisitorAction accept(Visitor visitor) {
        VisitorAction status = visitor.visit(this);
        if (status == VisitorAction.CONTINUE) {
            visitor.pushParent(this);
            visitor.popParent();
        }
        if (status == VisitorAction.TERMINATE) {
            return VisitorAction.TERMINATE;
        }
        return VisitorAction.CONTINUE;
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy