import java.io.IOException;
import java.util.List;
import java.util.Optional;
-import javax.annotation.Nonnull;
-import javax.annotation.Nullable;
+import org.eclipse.jdt.annotation.NonNull;
+import org.eclipse.jdt.annotation.Nullable;
import org.opendaylight.mdsal.binding.dom.codec.api.BindingNormalizedNodeCachingCodec;
import org.opendaylight.yangtools.yang.binding.BindingStreamEventWriter;
import org.opendaylight.yangtools.yang.binding.DataObject;
* @throws IllegalArgumentException If supplied argument does not represent valid child.
*/
@Override
- @Nullable
- public DataContainerCodecContext<?,?> bindingPathArgumentChild(final PathArgument arg,
+ public DataContainerCodecContext<?, ?> bindingPathArgumentChild(final PathArgument arg,
final List<YangInstanceIdentifier.PathArgument> builder) {
final DataContainerCodecContext<?,?> child = streamChild(arg.getType());
- if (child != null) {
- if (builder != null) {
- child.addYangPathArgument(arg,builder);
- }
- return child;
+ if (builder != null) {
+ child.addYangPathArgument(arg,builder);
}
- throw new IllegalArgumentException("Supplied argument is not valid child");
+ return child;
}
/**
return Class.class.cast(prototype.getBindingClass());
}
- /**
- * Returns child context as if it was walked by {@link BindingStreamEventWriter}. This means that to enter case, one
- * must issue getChild(ChoiceClass).getChild(CaseClass).
- *
- * @param childClass child class
- * @return Context of child node or null, if supplied class is not subtree child
- * @throws IllegalArgumentException If supplied child class is not valid in specified context.
- */
@Override
- public abstract @Nullable <C extends DataObject> DataContainerCodecContext<C, ?> streamChild(Class<C> childClass);
+ public abstract <C extends DataObject> DataContainerCodecContext<C, ?> streamChild(Class<C> childClass);
/**
* Returns child context as if it was walked by {@link BindingStreamEventWriter}. This means that to enter case, one
return BindingToNormalizedStreamWriter.create(this, domWriter);
}
- @Nonnull
- protected final <V> V childNonNull(@Nullable final V nullable, final YangInstanceIdentifier.PathArgument child,
- final String message, final Object... args) {
+ protected final <V> @NonNull V childNonNull(final @Nullable V nullable,
+ final YangInstanceIdentifier.PathArgument child, final String message, final Object... args) {
if (nullable != null) {
return nullable;
}
throw IncorrectNestingException.create(message, args);
}
- @Nonnull
- protected final <V> V childNonNull(@Nullable final V nullable, final QName child, final String message,
+ protected final <V> @NonNull V childNonNull(final @Nullable V nullable, final QName child, final String message,
final Object... args) {
if (nullable != null) {
return nullable;
throw IncorrectNestingException.create(message, args);
}
- @Nonnull
- protected final <V> V childNonNull(@Nullable final V nullable, final Class<?> childClass, final String message,
- final Object... args) {
+ protected final <V> @NonNull V childNonNull(final @Nullable V nullable, final Class<?> childClass,
+ final String message, final Object... args) {
if (nullable != null) {
return nullable;
}
throw new IllegalStateException("Failed to serialize Binding DTO",e);
}
}
-
}