/* * Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v1.0 which accompanies this distribution, * and is available at http://www.eclipse.org/legal/epl-v10.html */ package org.opendaylight.controller.md.sal.binding.util; import org.opendaylight.controller.md.sal.common.api.data.DataReader; import org.opendaylight.yangtools.yang.binding.DataObject; import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; /** * Deprecated. * * @deprecated Use {@link org.opendaylight.controller.md.sal.binding.api.ReadTransaction#read( * org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType, InstanceIdentifier)} instead. */ @Deprecated public final class TypeSafeDataReader { private final DataReader, DataObject> delegate; public DataReader, DataObject> getDelegate() { return delegate; } public TypeSafeDataReader( final DataReader, DataObject> delegate) { this.delegate = delegate; } @SuppressWarnings("unchecked") public D readConfigurationData( final InstanceIdentifier path) { return (D) delegate.readConfigurationData(path); } @SuppressWarnings("unchecked") public D readOperationalData( final InstanceIdentifier path) { return (D) delegate.readOperationalData(path); } public static TypeSafeDataReader forReader( final DataReader, DataObject> delegate) { return new TypeSafeDataReader(delegate); } }