2 * Copyright (c) 2016 Cisco Systems, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.mdsal.singleton.dom.impl.util;
10 import com.google.common.base.Preconditions;
11 import com.google.common.collect.ImmutableList;
12 import java.io.Serial;
13 import java.util.LinkedList;
14 import java.util.List;
15 import org.opendaylight.yangtools.concepts.HierarchicalIdentifier;
18 * Test helper class. {@link HierarchicalIdentifier} for testing only.
20 public class TestInstanceIdentifier implements HierarchicalIdentifier<TestInstanceIdentifier> {
22 private static final long serialVersionUID = 1L;
24 private final ImmutableList<String> path;
26 public TestInstanceIdentifier(final Iterable<? extends TestInstanceIdentifier> path) {
27 Preconditions.checkArgument(path != null);
28 final List<String> tiis = new LinkedList<>();
29 for (final TestInstanceIdentifier t : path) {
30 tiis.add(t.toString());
32 this.path = ImmutableList.copyOf(tiis);
35 TestInstanceIdentifier(final String path) {
36 this.path = ImmutableList.of(path);
40 public boolean contains(final TestInstanceIdentifier other) {
41 throw new UnsupportedOperationException();