private static GeoServerTileLayerInfoImpl load(final MetadataMap metadataMap) { GeoServerTileLayerInfoImpl info = new GeoServerTileLayerInfoImpl(); // whether the config needs to be saved final boolean enabled = metadataMap.get(CONFIG_KEY_ENABLED, Boolean.class).booleanValue(); info.setEnabled(enabled); int gutter = metadataMap.get(CONFIG_KEY_GUTTER, Integer.class).intValue(); info.setGutter(gutter); String gridsets = metadataMap.get(CONFIG_KEY_GRIDSETS, String.class); Set<XMLGridSubset> gridSetIds = unmarshalGridSubsets(gridsets); info.getGridSubsets().addAll(gridSetIds); int metaTilingX = metadataMap.get(CONFIG_KEY_METATILING_X, Integer.class).intValue(); info.setMetaTilingX(metaTilingX); int metaTilingY = metadataMap.get(CONFIG_KEY_METATILING_Y, Integer.class).intValue(); info.setMetaTilingY(metaTilingY); if (metadataMap.containsKey(CONFIG_KEY_FORMATS)) { String mimeFormatsStr = metadataMap.get(CONFIG_KEY_FORMATS, String.class); Set<String> mimeFormats = unmarshalSet(mimeFormatsStr); info.getMimeFormats().addAll(mimeFormats); } if (metadataMap.containsKey(CONFIG_KEY_AUTO_CACHE_STYLES)) { boolean autoCacheStyles = metadataMap.get(CONFIG_KEY_AUTO_CACHE_STYLES, Boolean.class) .booleanValue(); info.setAutoCacheStyles(autoCacheStyles); } return info; }
private static GeoServerTileLayerInfoImpl load(final MetadataMap metadataMap) { GeoServerTileLayerInfoImpl info = new GeoServerTileLayerInfoImpl(); // whether the config needs to be saved final boolean enabled = metadataMap.get(CONFIG_KEY_ENABLED, Boolean.class).booleanValue(); info.setEnabled(enabled); int gutter = metadataMap.get(CONFIG_KEY_GUTTER, Integer.class).intValue(); info.setGutter(gutter); String gridsets = metadataMap.get(CONFIG_KEY_GRIDSETS, String.class); Set<XMLGridSubset> gridSetIds = unmarshalGridSubsets(gridsets); info.getGridSubsets().addAll(gridSetIds); int metaTilingX = metadataMap.get(CONFIG_KEY_METATILING_X, Integer.class).intValue(); info.setMetaTilingX(metaTilingX); int metaTilingY = metadataMap.get(CONFIG_KEY_METATILING_Y, Integer.class).intValue(); info.setMetaTilingY(metaTilingY); if (metadataMap.containsKey(CONFIG_KEY_FORMATS)) { String mimeFormatsStr = metadataMap.get(CONFIG_KEY_FORMATS, String.class); Set<String> mimeFormats = unmarshalSet(mimeFormatsStr); info.getMimeFormats().addAll(mimeFormats); } if (metadataMap.containsKey(CONFIG_KEY_AUTO_CACHE_STYLES)) { boolean autoCacheStyles = metadataMap.get(CONFIG_KEY_AUTO_CACHE_STYLES, Boolean.class).booleanValue(); info.setAutoCacheStyles(autoCacheStyles); } if (metadataMap.containsKey(CONFIG_KEY_IN_MEMORY_CACHED)) { boolean inMemoryCached = metadataMap.get(CONFIG_KEY_IN_MEMORY_CACHED, Boolean.class); info.setInMemoryCached(inMemoryCached); } return info; }