APISonar


org.dmg.pmml.DataType.DATE

> org > dmg > pmml > DataType > DATE
org APIs dmg APIs pmml APIs DataType APIs DATE APIs

Example 1
public void parseDate(){
		LocalDate date = (LocalDate)TypeUtil.parse(DataType.DATE, DATE);

		assertEquals(DataType.DATE, TypeUtil.getDataType(date));
	}
Example 2
private LocalDate toDate(Object value){

		if(value instanceof LocalDate){
			return (LocalDate)value;
		} else

		if(value instanceof LocalDateTime){
			LocalDateTime instant = (LocalDateTime)value;

			return instant.toLocalDate();
		}

		throw new TypeCheckException(DataType.DATE, value);
	}