Package nz.org.riskscape.jython
Interface JavaJythonHelpers
- All Known Implementing Classes:
JythonFactory
,JythonRiskscapeFunctionDelegate
,NestedFunction
public interface JavaJythonHelpers
-
Method Summary
Modifier and TypeMethodDescriptiondefault Object
convertFromPython
(org.python.core.PyObject ob, nz.org.riskscape.engine.types.Type type) Performs a RiskscapeType
aware 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
Type
aware conversion of a python object to a java object.- Parameters:
ob
- object to convert to a plain old Java Objecttype
- a RiskscapeType
that 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.
-