public static class ViewSpecification.Column.Builder extends Object implements Cloneable
ViewSpecification.Column.Builder
is used to create instances of ViewSpecification.Column
,
and also to convert them to JSON format.
The builder may have invalid state when csid
or key
is null
. Only the builder
in valid state can produce an instance of Column
, so make sure to set those two properties.
Constructor and Description |
---|
Builder()
Creates an empty builder.
|
Builder(ViewSpecification.Column column)
Creates a builder with a copy of a column properties.
|
Modifier and Type | Method and Description |
---|---|
ViewSpecification.Column |
build()
Creates an instance of
ViewSpecification.Column using the current state of the builder. |
ViewSpecification.Column.Builder |
clone() |
String |
getCsid() |
String |
getKey() |
String |
getName() |
Map<String,Object> |
getParameters() |
boolean |
isValid() |
ViewSpecification.Column.Builder |
removeParameter(String name)
Removes a parameter from parameter map.
|
void |
setCsid(String csid) |
void |
setKey(String key) |
void |
setName(String name) |
ViewSpecification.Column.Builder |
setParameter(String name,
Object value)
Sets a parameter for this column.
|
void |
setParameters(Map<String,Object> parameters)
Updates the parameter map for the column.
|
ViewSpecification.Column.Builder |
setStringListParameter(String name,
String... values)
Utility method to set a parameter of type
List with String elements. |
String |
toString() |
public Builder()
public Builder(@Nullable ViewSpecification.Column column)
column
- column to copypublic ViewSpecification.Column.Builder clone()
@Nullable public String getCsid()
public void setCsid(String csid)
@Nullable public String getKey()
public void setKey(String key)
@Nullable public String getName()
public void setName(String name)
@Nullable public Map<String,Object> getParameters()
setParameter(java.lang.String, java.lang.Object)
method.public void setParameters(@Nullable Map<String,Object> parameters)
Updates the parameter map for the column. The map is copied by this method, so the passed object can be reused by the calling method.
Passing null
will clear the parameter map.
parameters
- new parameter mappublic ViewSpecification.Column.Builder removeParameter(String name)
name
- name of the parameterpublic ViewSpecification.Column.Builder setParameter(String name, @Nullable Object value)
Sets a parameter for this column. The parameter and the value are added to the parameter map.
For the list of supported parameter types, see ViewSpecification.Column
.
name
- the name of the parametervalue
- the value of the parameterIllegalArgumentException
- if the parameter is of unsupported typepublic ViewSpecification.Column.Builder setStringListParameter(String name, String... values)
List
with String
elements.name
- parameter namevalues
- a list of values for the parameterpublic boolean isValid()
ViewSpecification.Column
- that is, it has non-empty key
and
non-empty csid
@NotNull public ViewSpecification.Column build() throws IllegalStateException
ViewSpecification.Column
using the current state of the builder. After the column is created,
the state can be reused to create another instance.IllegalStateException
- if the state is invalid - see isValid()
Copyright © 2024 Tempo Software. All Rights Reserved.