org.dmg.pmml.adapters.ObjectUtil Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pmml-model-gwt Show documentation
Show all versions of pmml-model-gwt Show documentation
JPMML GWT compatible class model
/*
* Copyright (c) 2019 Villu Ruusmann
*/
package org.dmg.pmml.adapters;
import org.dmg.pmml.ComplexValue;
import org.dmg.pmml.Entity;
public class ObjectUtil {
private ObjectUtil(){
}
static
public Object toSimpleValue(Object value){
if(value instanceof Entity){
Entity> entity = (Entity>)value;
return entity.getId();
} // End if
if(value instanceof ComplexValue){
ComplexValue complexValue = (ComplexValue)value;
return complexValue.toSimpleValue();
}
return value;
}
}