#pragma once #include #include "../../conversion/conversion.hpp" #include "../../conversion/constant.hpp" #include "types.hpp" #include "function.hpp" namespace mbgl { namespace android { namespace conversion { template struct Converter> { Result operator()(jni::JNIEnv& env, const mbgl::style::PropertyValue& value) const { if(value.isUndefined()) { //Return a nullptr representing a Java null value return {nullptr}; } else if (value.isConstant()) { //Time to convert the constant value Result result = convert(env, value.asConstant()); return {*result}; //return converted; } else if (value.isFunction()) { //Must be a function than return convert>(env, value.asFunction()); } else { throw std::runtime_error("Unknown property value type"); } } }; } // namespace conversion } // namespace android } // namespace mbgl