diff --git a/component/src/main/java/io/siddhi/extension/execution/map/CreateFunctionExtension.java b/component/src/main/java/io/siddhi/extension/execution/map/CreateFunctionExtension.java index 2e2d06c..4abb918 100644 --- a/component/src/main/java/io/siddhi/extension/execution/map/CreateFunctionExtension.java +++ b/component/src/main/java/io/siddhi/extension/execution/map/CreateFunctionExtension.java @@ -50,26 +50,36 @@ @Parameter(name = "key1", description = "Key 1", type = {DataType.OBJECT, DataType.INT, DataType.LONG, DataType.FLOAT, DataType.DOUBLE, - DataType.FLOAT, DataType.BOOL, DataType.STRING}, - dynamic = true + DataType.FLOAT, DataType.BOOL, DataType.STRING}, + dynamic = true, + optional = true, + defaultValue = "-" ), @Parameter(name = "value1", description = "Value 1", type = {DataType.OBJECT, DataType.INT, DataType.LONG, DataType.FLOAT, DataType.DOUBLE, DataType.FLOAT, DataType.BOOL, DataType.STRING}, - dynamic = true + dynamic = true, + optional = true, + defaultValue = "-" ), }, parameterOverloads = { + @ParameterOverload(), @ParameterOverload(parameterNames = {"key1", "value1"}), @ParameterOverload(parameterNames = {"key1", "value1", "..."}), }, returnAttributes = @ReturnAttribute(description = "Returns the created map object," + " by pairing adjacent key value pairs.", type = DataType.OBJECT), - examples = @Example( - syntax = "map:create(1, 'one', 2, 'two', 3, 'three')", - description = "This returns a map with keys `1`, `2`, `3` mapped with their corresponding values, " + - "`one`, `two`, `three`.") + examples = { + @Example( + syntax = "map:create(1, 'one', 2, 'two', 3, 'three')", + description = "This returns a map with keys `1`, `2`, `3` mapped with " + + "their corresponding values, `one`, `two`, `three`."), + @Example( + syntax = "map:create()", + description = "This returns an empty map.") + } ) public class CreateFunctionExtension extends FunctionExecutor { private Attribute.Type returnType = Attribute.Type.OBJECT; diff --git a/pom.xml b/pom.xml index b13d293..6c349d5 100755 --- a/pom.xml +++ b/pom.xml @@ -45,7 +45,7 @@ - 5.0.2 + 5.1.1 [5.0.0, 6.0.0) 1.2.17.wso2v1 2.0.0.wso2v1