import java.util.Optional;
import org.eclipse.jdt.annotation.NonNull;
import org.eclipse.jdt.annotation.Nullable;
-import org.opendaylight.yangtools.concepts.Builder;
-import org.opendaylight.yangtools.concepts.Immutable;
-import org.opendaylight.yangtools.concepts.Path;
+import org.opendaylight.yangtools.concepts.HierarchicalIdentifier;
import org.opendaylight.yangtools.util.HashCodeBuilder;
/**
* <p>
* This would be the same as using a path like so, "/nodes/node/openflow:1" to refer to the openflow:1 node
*/
-public class InstanceIdentifier<T extends DataObject> implements Path<InstanceIdentifier<? extends DataObject>>,
- Immutable, Serializable {
+public class InstanceIdentifier<T extends DataObject>
+ implements HierarchicalIdentifier<InstanceIdentifier<? extends DataObject>> {
private static final long serialVersionUID = 3L;
/*
* contains a null element.
*/
public static @NonNull InstanceIdentifier<?> create(final Iterable<? extends PathArgument> pathArguments) {
- if (pathArguments instanceof ImmutableCollection<?>) {
+ if (pathArguments instanceof ImmutableCollection) {
@SuppressWarnings("unchecked")
- final Iterable<PathArgument> immutableArguments = (Iterable<PathArgument>) pathArguments;
+ final var immutableArguments = (ImmutableCollection<PathArgument>) pathArguments;
return internalCreate(immutableArguments);
}
}
}
- public interface InstanceIdentifierBuilder<T extends DataObject> extends Builder<InstanceIdentifier<T>> {
+ public interface InstanceIdentifierBuilder<T extends DataObject> {
/**
* Append the specified container as a child of the current InstanceIdentifier referenced by the builder. This
* method should be used when you want to build an instance identifier by appending top-level elements, for
*
* @return Resulting instance identifier.
*/
- @Override
- InstanceIdentifier<T> build();
+ @NonNull InstanceIdentifier<T> build();
}
private Object writeReplace() throws ObjectStreamException {