/** * Adds all of the dimensions in the specified collection to the dictionary. * * @param dimensions collection of dimensions to add * * @return <tt>true</tt> if the dictionary changed as a result of the call * @see Set#addAll(Collection) */ public boolean addAll(Collection<? extends Dimension> dimensions) { boolean flag = false; for (Dimension dimension : dimensions) { flag = add(dimension) || flag; } return flag; }
@Override public void loadDimensionDictionary(DimensionDictionary dimensions) { for (DimensionConfig dimensionConfig : configSource) { if (dimensionConfig.getType().equals(KeyValueStoreDimension.class)) { dimensions.add(new KeyValueStoreDimension(dimensionConfig)); } else if (dimensionConfig.getType().equals(LookupDimension.class)) { dimensions.add(new LookupDimension((LookupDimensionConfig) dimensionConfig)); } else if (dimensionConfig.getType().equals(RegisteredLookupDimension.class)) { dimensions.add(new RegisteredLookupDimension((RegisteredLookupDimensionConfig) dimensionConfig)); } else { throw new RuntimeException( DIMENSION_TYPE_INVALID.format( dimensionConfig.getType(), dimensionConfig.getApiName() ) ); } registerHealthChecks(dimensionConfig); } }