* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
* 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.impl;
import com.google.common.cache.CacheBuilder;
import com.google.common.cache.CacheLoader;
import com.google.common.cache.LoadingCache;
import java.lang.reflect.Method;
package org.opendaylight.controller.md.sal.binding.impl;
import com.google.common.cache.CacheBuilder;
import com.google.common.cache.CacheLoader;
import com.google.common.cache.LoadingCache;
import java.lang.reflect.Method;
import org.opendaylight.yangtools.yang.binding.DataObject;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
import org.opendaylight.yangtools.yang.binding.annotations.RoutingContext;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.opendaylight.yangtools.yang.binding.DataObject;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
import org.opendaylight.yangtools.yang.binding.annotations.RoutingContext;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
abstract class ContextReferenceExtractor {
private static final Logger LOG = LoggerFactory.getLogger(ContextReferenceExtractor.class);
private static final ContextReferenceExtractor NULL_EXTRACTOR = new ContextReferenceExtractor() {
abstract class ContextReferenceExtractor {
private static final Logger LOG = LoggerFactory.getLogger(ContextReferenceExtractor.class);
private static final ContextReferenceExtractor NULL_EXTRACTOR = new ContextReferenceExtractor() {
if (InstanceIdentifier.class.isAssignableFrom(returnType)) {
return DirectGetterRouteContextExtractor.create(contextGetter);
}
if (InstanceIdentifier.class.isAssignableFrom(returnType)) {
return DirectGetterRouteContextExtractor.create(contextGetter);
}
if (getValueMethod != null) {
return GetValueRouteContextExtractor.create(contextGetter, getValueMethod);
} else {
if (getValueMethod != null) {
return GetValueRouteContextExtractor.create(contextGetter, getValueMethod);
} else {
- LOG.warn("Class {} can not be used to determine context, falling back to NULL_EXTRACTOR.",returnType);
+ LOG.warn("Class {} can not be used to determine context, falling back to NULL_EXTRACTOR.", returnType);
try {
final Method method = type.getMethod(GET_VALUE_NAME);
if (returnType.equals(method.getReturnType())) {
try {
final Method method = type.getMethod(GET_VALUE_NAME);
if (returnType.equals(method.getReturnType())) {