org.dmg.pmml.adapters.PositiveIntegerAdapter 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;
public class PositiveIntegerAdapter extends IntegerAdapter {
@Override
public Integer unmarshal(String value){
Integer result = super.unmarshal(value);
if(!isValid(result)){
throw new IllegalArgumentException(value);
}
return result;
}
static
public boolean isValid(Integer value){
return (value > 0);
}
}