Java Code Examples for org.dmg.pmml.DataType#DATE_TIME

The following examples show how to use org.dmg.pmml.DataType#DATE_TIME . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: TransformerUtil.java    From jpmml-sklearn with GNU Affero General Public License v3.0 5 votes vote down vote up
static
public DataType parseDataType(String dtype){

	switch(dtype){
		case "datetime64[D]":
			return DataType.DATE;
		case "datetime64[s]":
			return DataType.DATE_TIME;
		default:
			throw new IllegalArgumentException(dtype);
	}
}
 
Example 2
Source File: TypeUtil.java    From jpmml-evaluator with GNU Affero General Public License v3.0 5 votes vote down vote up
/**
 * @see DataType#DATE_TIME
 */
static
private LocalDateTime toDateTime(Object value){

	if(value instanceof LocalDateTime){
		return (LocalDateTime)value;
	}

	throw new TypeCheckException(DataType.DATE_TIME, value);
}
 
Example 3
Source File: DateTimeDomain.java    From jpmml-sklearn with GNU Affero General Public License v3.0 4 votes vote down vote up
@Override
public DataType getDataType(){
	return DataType.DATE_TIME;
}