org.dmg.pmml.MatCell Maven / Gradle / Ivy
package org.dmg.pmml;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import com.fasterxml.jackson.annotation.JsonRootName;
import jakarta.xml.bind.annotation.XmlAttribute;
import jakarta.xml.bind.annotation.XmlRootElement;
import jakarta.xml.bind.annotation.XmlSchemaType;
import jakarta.xml.bind.annotation.XmlType;
import jakarta.xml.bind.annotation.XmlValue;
import jakarta.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import org.dmg.pmml.adapters.IntegerAdapter;
import org.dmg.pmml.adapters.ObjectAdapter;
import org.eclipse.persistence.oxm.annotations.XmlValueExtension;
import org.jpmml.model.MissingAttributeException;
import org.jpmml.model.annotations.ValueConstructor;
@XmlRootElement(name = "MatCell", namespace = "http://www.dmg.org/PMML-4_4")
@XmlType(name = "", propOrder = {
"value"
})
@JsonRootName("MatCell")
@JsonPropertyOrder({
"row",
"col",
"value"
})
public class MatCell
extends PMMLObject
{
@XmlAttribute(name = "row", required = true)
@XmlJavaTypeAdapter(IntegerAdapter.class)
@JsonProperty("row")
private Integer row;
@XmlAttribute(name = "col", required = true)
@XmlJavaTypeAdapter(IntegerAdapter.class)
@JsonProperty("col")
private Integer col;
@XmlValue
@XmlJavaTypeAdapter(ObjectAdapter.class)
@XmlSchemaType(name = "anySimpleType")
@JsonProperty("value")
@XmlValueExtension
private Object value;
private final static long serialVersionUID = 67371270L;
public MatCell() {
}
@ValueConstructor
public MatCell(
@org.jpmml.model.annotations.Property("row")
Integer row,
@org.jpmml.model.annotations.Property("col")
Integer col,
@org.jpmml.model.annotations.Property("value")
Object value) {
this.row = row;
this.col = col;
this.value = value;
}
public Integer requireRow() {
if (this.row == null) {
throw new MissingAttributeException(this, PMMLAttributes.MATCELL_ROW);
}
return this.row;
}
public Integer getRow() {
return row;
}
public MatCell setRow(
@org.jpmml.model.annotations.Property("row")
Integer row) {
this.row = row;
return this;
}
public Integer requireCol() {
if (this.col == null) {
throw new MissingAttributeException(this, PMMLAttributes.MATCELL_COL);
}
return this.col;
}
public Integer getCol() {
return col;
}
public MatCell setCol(
@org.jpmml.model.annotations.Property("col")
Integer col) {
this.col = col;
return this;
}
public Object getValue() {
return value;
}
public MatCell 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;
}
}