use of org.opendaylight.mdsal.binding.generator.impl.reactor.TypeReference.ResolvedLeafref in project mdsal by opendaylight.
the class AbstractTypeObjectGenerator method addAsGetterMethodOverride.
@Override
final void addAsGetterMethodOverride(final GeneratedTypeBuilderBase<?> builder, final TypeBuilderFactory builderFactory) {
if (!(refType instanceof ResolvedLeafref)) {
// We are not dealing with a leafref or have nothing to add
return;
}
final AbstractTypeObjectGenerator<?, ?> prev = (AbstractTypeObjectGenerator<?, ?>) verifyNotNull(previous(), "Missing previous link in %s", this);
if (prev.refType instanceof ResolvedLeafref) {
// We should be already inheriting the correct type
return;
}
// Note: this may we wrapped for leaf-list, hence we need to deal with that
final Type myType = methodReturnType(builderFactory);
LOG.trace("Override of {} to {}", this, myType);
final MethodSignatureBuilder getter = constructGetter(builder, myType);
getter.addAnnotation(OVERRIDE_ANNOTATION);
annotateDeprecatedIfNecessary(getter);
}
Aggregations