@Internal public class AttributeSpecNormalization extends Object
Provides normalization for attribute spec parameters.
Attribute spec parameters are normalized. This means that if the value of a parameter is the default for that
parameter, it is not stored in the map. For example, int
parameters have default equal to 0
. If you try
to build an attribute spec and set an int
parameter to 0, the resulting attribute spec will not have that
value.
This is done to avoid unequal instances of AttributeSpec
to represent the same attribute. If not normalized,
multiple versions of the same attribute spec could lead to bugs.
Some parameters for some specs are known to have non-standard defaults. The normalization then works by removing the parameter only if it is set to the default value.
For example, for "aggregation-parent"
attribute if you set the "level"
parameter to -1
, it will be removed, but if you
set it to 0
, it will not be removed.
See KNOWN_NON_STANDARD_INT_DEFAULTS
.
If there's an object parameter that looks like it's an attribute parameter (has "id"
parameter itself), then it will also
be normalized.
Constructor and Description |
---|
AttributeSpecNormalization() |
Modifier and Type | Method and Description |
---|---|
static Map<String,Object> |
normalizeParams(String specId,
Map<String,Object> specParams)
Does normalization based on the rules at https://dev.almworks.com/browse/STR-1464
See also AttributeSpecNormalization.js
|
@NotNull public static Map<String,Object> normalizeParams(@NotNull String specId, @NotNull Map<String,Object> specParams)
specParams
- Copyright © 2024 Tempo Software. All Rights Reserved.