2 * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.controller.config.persist.impl;
10 import org.opendaylight.controller.config.persist.api.PropertiesProvider;
12 public class PropertiesProviderAdapterImpl implements PropertiesProvider {
13 private final PropertiesProvider inner;
14 private final String index;
16 public PropertiesProviderAdapterImpl(final PropertiesProvider inner, final String index) {
22 public String getProperty(final String key) {
23 String fullKey = getFullKeyForReporting(key);
24 return inner.getPropertyWithoutPrefix(fullKey);
27 public String getPrefix() {
28 return inner.getPrefix() + "." + index + ".properties";
32 public String getPropertyWithoutPrefix(final String fullKey) {
33 return inner.getPropertyWithoutPrefix(fullKey);
38 public String getFullKeyForReporting(final String key) {
39 return getPrefix() + "." + key;