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

org.dmg.pmml.HasModel Maven / Gradle / Ivy

There is a newer version: 1.6.11
Show newest version
/*
 * Copyright (c) 2022 Villu Ruusmann
 */
package org.dmg.pmml;

import org.jpmml.model.UnsupportedElementException;

public interface HasModel> {

	/**
	 * @throws UnsupportedElementException If the {@link Model} child element is not assignment-compatible with the assumed type.
	 */
	default
	 M requireModel(Class clazz){
		Model model = requireModel();

		if(!clazz.isInstance(model)){
			throw new UnsupportedElementException(model);
		}

		return clazz.cast(model);
	}

	Model requireModel();

	Model getModel();

	E setModel(Model model);
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy