static DataSource rpcSourceFromTypedData()

in src/main/java/com/microsoft/azure/functions/worker/binding/BindingDataStore.java [81:97]


    static DataSource<?> rpcSourceFromTypedData(String name, TypedData data) {
        switch (data.getDataCase()) {
            case INT:    return new RpcIntegerDataSource(name, data.getInt());
            case DOUBLE: return new RpcRealNumberDataSource(name, data.getDouble());
            case STRING: return new RpcStringDataSource(name, data.getString());
            case BYTES:  return new RpcByteArrayDataSource(name, data.getBytes());
            case JSON:   return new RpcJsonDataSource(name, data.getJson());
            case HTTP:   return new RpcHttpRequestDataSource(name, data.getHttp());
            case COLLECTION_STRING: return new RpcCollectionStringDataSource(name, data.getCollectionString());
            case COLLECTION_DOUBLE: return new RpcCollectionDoubleDataSource(name, data.getCollectionDouble());
            case COLLECTION_BYTES: return new RpcCollectionByteArrayDataSource(name, data.getCollectionBytes());
            case COLLECTION_SINT64: return new RpcCollectionLongDataSource(name, data.getCollectionSint64());
            case DATA_NOT_SET: return new RpcEmptyDataSource(name);
            case MODEL_BINDING_DATA: return new RpcModelBindingDataSource(name, data.getModelBindingData());
            default:     throw new UnsupportedOperationException("Input data type \"" + data.getDataCase() + "\" is not supported");
        }
    }