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

org.dmg.pmml.adapters.PositiveIntegerAdapter Maven / Gradle / Ivy

There is a newer version: 1.6.6
Show newest version
/*
 * 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);
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy