use of org.knime.core.node.ModelContent in project knime-core by knime.
the class DatabaseQueryConnectionSettings method createConnectionModel.
/**
* {@inheritDoc}
*/
@Override
public ModelContentRO createConnectionModel() {
ModelContent cont = new ModelContent("database_query_connection_model");
saveConnection(cont);
return cont;
}
use of org.knime.core.node.ModelContent in project knime-core by knime.
the class AbstractSimplePortObjectSpec method hashCode.
/**
* {@inheritDoc}
*/
@Override
public int hashCode() {
ModelContent tcont = new ModelContent("ignored");
this.save(tcont);
return tcont.hashCode();
}
use of org.knime.core.node.ModelContent in project knime-core by knime.
the class AbstractSimplePortObject method equals.
/**
* Method compares both <code>ModelContent</code> objects that first need
* to be saved by calling {@link #save(ModelContentWO, ExecutionMonitor)}.
* Override this method in order to compare both objects more efficiently.
*
* {@inheritDoc}
*/
@Override
public boolean equals(final Object oport) {
if (oport == this) {
return true;
}
if (oport == null) {
return false;
}
if (!this.getClass().equals(oport.getClass())) {
return false;
}
ModelContent tcont = new ModelContent("ignored");
ModelContent ocont = new ModelContent("ignored");
try {
this.save(tcont, new ExecutionMonitor());
((AbstractSimplePortObject) oport).save(ocont, new ExecutionMonitor());
} catch (CanceledExecutionException cee) {
// ignored, should not happen
}
return tcont.equals(ocont);
}
use of org.knime.core.node.ModelContent in project knime-core by knime.
the class DatabaseConnectionSettings method createConnectionModel.
/**
* Create connection model with all settings used to create a database
* connection.
* @return database connection model
*/
public ModelContentRO createConnectionModel() {
ModelContent cont = new ModelContent("database_connection_model");
saveConnection(cont);
return cont;
}
use of org.knime.core.node.ModelContent in project knime-core by knime.
the class FilterDefinitionHandlerPortObject method getViews.
/**
* {@inheritDoc}
*/
@Override
public JComponent[] getViews() {
ModelContent model = new ModelContent("FilterDefinition");
Config columnConfig = model.addConfig("Column");
getSpec().forEach(col -> col.getFilterHandler().ifPresent(handler -> handler.save(columnConfig.addConfig(col.getName()))));
return new JComponent[] { new ModelContentOutPortView(model) };
}
Aggregations