Package nz.org.riskscape.jython
Interface JavaJythonHelpers
- All Known Implementing Classes:
JythonFactory,JythonRiskscapeFunctionDelegate,NestedFunction
public interface JavaJythonHelpers
-
Method Summary
Modifier and TypeMethodDescriptiondefault ObjectconvertFromPython(org.python.core.PyObject ob, nz.org.riskscape.engine.types.Type type) Performs a RiskscapeTypeaware conversion of a python object to a java object.default <X,Y> org.python.core.PyObject toPyCallable(Class<X> in, Class<Y> out, Function<X, Y> toWrap)
-
Method Details
-
convertFromPython
default Object convertFromPython(org.python.core.PyObject ob, nz.org.riskscape.engine.types.Type type) Performs a Riskscape
Typeaware conversion of a python object to a java object.- Parameters:
ob- object to convert to a plain old Java Objecttype- a RiskscapeTypethat we wish to convert to- Returns:
- a java object that conforms to
Type
-
toPyCallable
default <X,Y> org.python.core.PyObject toPyCallable(Class<X> in, Class<Y> out, Function<X, Y> toWrap) - Returns:
- a PyObject that is callable which runs the given function, applying Java <-> Python conversion as necessary.
-