Package org.geotools.data.duckdb
Class ParamBuilder
- Object
- 
- ParamBuilder
 
- 
 public class ParamBuilder extends Object Builder forDataAccessFactory#Paraminstances.Provides a fluent API for creating DataAccessFactory.Param objects, making parameter definition more readable and maintainable. This builder helps with consistent parameter creation and reduces boilerplate code. Example usage: DataAccessFactory.Param param = new ParamBuilder("uri") .type(String.class) .description("URI to the data source") .required(true) .metadata(Parameter.LEVEL, "advanced") .build();
- 
- 
Constructor SummaryConstructors Constructor Description ParamBuilder(String key)Creates a new ParamBuilder with the specified key.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description ParamBuilderadvancedLevel()Marks this parameter as an advanced-level parameter.DataAccessFactory.Parambuild()Builds and returns a DataAccessFactory.Param with the configured properties.ParamBuilderdefaultValue(Object defaultValue)Sets the default value for the parameter.ParamBuilderdescription(String description)Sets the parameter description.ParamBuilderdescription(InternationalString description)Sets the parameter description using an InternationalString.ParamBuilderlevel(String level)Sets this parameter as part of the UI interface level.ParamBuildermaxOccurs(int maxOccurs)Sets the maximum number of occurrences for this parameter.ParamBuildermetadata(String key, Object value)Adds a metadata entry to the parameter.ParamBuildermetadata(Map<String,Object> metadata)Sets the metadata map for the parameter, replacing any existing metadata.ParamBuilderminOccurs(int minOccurs)Sets the minimum number of occurrences for this parameter.ParamBuilderprogramLevel()Marks this parameter as a program-level parameter.ParamBuilderrequired(boolean required)Sets whether the parameter is required.ParamBuildertitle(String title)Sets the parameter title.ParamBuildertitle(InternationalString title)Sets the parameter title using an InternationalString.ParamBuildertype(Class<?> type)Sets the parameter type.ParamBuilderuserLevel()Marks this parameter as a user-level parameter.
 
- 
- 
- 
Constructor Detail- 
ParamBuilderpublic ParamBuilder(String key) Creates a new ParamBuilder with the specified key.- Parameters:
- key- the parameter key (used in parameter maps)
 
 
- 
 - 
Method Detail- 
typepublic ParamBuilder type(Class<?> type) Sets the parameter type.- Parameters:
- type- the class representing the parameter type
- Returns:
- this builder for method chaining
 
 - 
descriptionpublic ParamBuilder description(String description) Sets the parameter description.- Parameters:
- description- the description text
- Returns:
- this builder for method chaining
 
 - 
descriptionpublic ParamBuilder description(InternationalString description) Sets the parameter description using an InternationalString.- Parameters:
- description- the internationalized description
- Returns:
- this builder for method chaining
 
 - 
titlepublic ParamBuilder title(String title) Sets the parameter title.- Parameters:
- title- the title text
- Returns:
- this builder for method chaining
 
 - 
titlepublic ParamBuilder title(InternationalString title) Sets the parameter title using an InternationalString.- Parameters:
- title- the internationalized title
- Returns:
- this builder for method chaining
 
 - 
requiredpublic ParamBuilder required(boolean required) Sets whether the parameter is required.- Parameters:
- required- true if the parameter is required, false otherwise
- Returns:
- this builder for method chaining
 
 - 
defaultValuepublic ParamBuilder defaultValue(Object defaultValue) Sets the default value for the parameter.- Parameters:
- defaultValue- the default value
- Returns:
- this builder for method chaining
 
 - 
metadatapublic ParamBuilder metadata(String key, Object value) Adds a metadata entry to the parameter.- Parameters:
- key- the metadata key
- value- the metadata value
- Returns:
- this builder for method chaining
 
 - 
metadatapublic ParamBuilder metadata(Map<String,Object> metadata) Sets the metadata map for the parameter, replacing any existing metadata.- Parameters:
- metadata- the complete metadata map
- Returns:
- this builder for method chaining
 
 - 
minOccurspublic ParamBuilder minOccurs(int minOccurs) Sets the minimum number of occurrences for this parameter.- Parameters:
- minOccurs- the minimum number of occurrences
- Returns:
- this builder for method chaining
- Throws:
- IllegalArgumentException- if minOccurs is negative
 
 - 
maxOccurspublic ParamBuilder maxOccurs(int maxOccurs) Sets the maximum number of occurrences for this parameter.- Parameters:
- maxOccurs- the maximum number of occurrences
- Returns:
- this builder for method chaining
- Throws:
- IllegalArgumentException- if maxOccurs is less than minOccurs
 
 - 
levelpublic ParamBuilder level(String level) Sets this parameter as part of the UI interface level.- Parameters:
- level- the UI level (e.g., "user", "advanced", "program")
- Returns:
- this builder for method chaining
 
 - 
userLevelpublic ParamBuilder userLevel() Marks this parameter as a user-level parameter.- Returns:
- this builder for method chaining
 
 - 
advancedLevelpublic ParamBuilder advancedLevel() Marks this parameter as an advanced-level parameter.- Returns:
- this builder for method chaining
 
 - 
programLevelpublic ParamBuilder programLevel() Marks this parameter as a program-level parameter.- Returns:
- this builder for method chaining
 
 - 
buildpublic DataAccessFactory.Param build() Builds and returns a DataAccessFactory.Param with the configured properties.- Returns:
- a new DataAccessFactory.Param instance
- Throws:
- IllegalStateException- if required properties are not set
 
 
- 
 
-