Class ValueBuilder
java.lang.Object
org.mule.runtime.extension.api.values.ValueBuilder
An implementation of the builder design pattern to create a new
ValueBuilder instance.- Since:
- 1.0
-
Method Summary
Modifier and TypeMethodDescriptionorg.mule.runtime.api.value.Valuebuild()Create anValuebased in the information given to the Builder, included all their children.static Set<org.mule.runtime.api.value.Value>getValuesFor(String... values) Utility to create single levelvaluesfrom an array of Strings.static Set<org.mule.runtime.api.value.Value>getValuesFor(List<String> values) Utility to create single levelvaluesfrom anListof Strings.static Set<org.mule.runtime.api.value.Value>getValuesFor(Map<String, String> values) Utility to create single levelvaluesfrom anMapof Strings to Strings.static Set<org.mule.runtime.api.value.Value>getValuesFor(Stream<String> values) Utility to create single levelvaluesfrom anStreamof Strings.static ValueBuilderCreates and returns new instance of aValueBuilder, to help building a newValuerepresented by the givenstatic ValueBuilderCreates and returns new instance of aValueBuilder, to help building a newValuerepresented by the givenprotected voidsetPartName(String partName) withChild(ValueBuilder valueBuilder) Adds a newValueBuilderchild to theValuethat is being built.withDisplayName(String displayName) Adds a display name to theValuethat is being built
-
Method Details
-
newValue
Creates and returns new instance of aValueBuilder, to help building a newValuerepresented by the given- Parameters:
id- of theValueto be created- Returns:
- an initialized instance of
ValueBuilder
-
newValue
Creates and returns new instance of aValueBuilder, to help building a newValuerepresented by the given- Parameters:
id- of theValueto be createdpartName- the name of the part- Returns:
- an initialized instance of
ValueBuilder
-
getValuesFor
Utility to create single levelvaluesfrom an array of Strings. -
getValuesFor
Utility to create single levelvaluesfrom anListof Strings. -
getValuesFor
Utility to create single levelvaluesfrom anStreamof Strings. -
getValuesFor
Utility to create single levelvaluesfrom anMapof Strings to Strings. The key of the Map will be considered as theidand the value asdisplay name -
withDisplayName
Adds a display name to theValuethat is being built- Parameters:
displayName- of theValueto be created- Returns:
thisbuilder with the configured display name
-
withChild
Adds a newValueBuilderchild to theValuethat is being built.- Parameters:
valueBuilder- theValueBuilderthat is used to create the instance of the new child.- Returns:
thisbuilder with a new child.
-
setPartName
-
build
public org.mule.runtime.api.value.Value build()Create anValuebased in the information given to the Builder, included all their children.- Returns:
- the built
Value
-