X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-binding-util%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fmd%2Fsal%2Fbinding%2Futil%2FTypeSafeDataReader.java;h=3df33ba377376182e3485f6506af70d4a5e932aa;hb=2c146f582dee58e36dc22505b4c6bedb4641342f;hp=fd81af353ceb0d137bf9fbd527a349b6430fd20c;hpb=56af902306c727ef1db5185c101b878b5cb386a7;p=controller.git diff --git a/opendaylight/md-sal/sal-binding-util/src/main/java/org/opendaylight/controller/md/sal/binding/util/TypeSafeDataReader.java b/opendaylight/md-sal/sal-binding-util/src/main/java/org/opendaylight/controller/md/sal/binding/util/TypeSafeDataReader.java index fd81af353c..3df33ba377 100644 --- a/opendaylight/md-sal/sal-binding-util/src/main/java/org/opendaylight/controller/md/sal/binding/util/TypeSafeDataReader.java +++ b/opendaylight/md-sal/sal-binding-util/src/main/java/org/opendaylight/controller/md/sal/binding/util/TypeSafeDataReader.java @@ -1,3 +1,10 @@ +/* + * 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; @@ -6,32 +13,26 @@ import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; public final class TypeSafeDataReader { - - private final DataReader,DataObject> delegate; - - - + private final DataReader, DataObject> delegate; + public DataReader, DataObject> getDelegate() { return delegate; } - public TypeSafeDataReader(DataReader, DataObject> delegate) { this.delegate = delegate; } - @SuppressWarnings("unchecked") public D readConfigurationData(InstanceIdentifier path) { return (D) delegate.readConfigurationData(path); } - - + @SuppressWarnings("unchecked") - public D readOperationalData(InstanceIdentifier path) { + public D readOperationalData(InstanceIdentifier path) { return (D) delegate.readOperationalData(path); } - + public static TypeSafeDataReader forReader(DataReader, DataObject> delegate) { return new TypeSafeDataReader(delegate); }