This is a shorthand for YangInstanceIdentifier.EMPTY, hence
we can inline the definition.
Change-Id: Icb8f025feb48cbc6add7c30d1db863b19c18f546
Signed-off-by: Robert Varga <rovarga@cisco.com>
import com.google.common.base.MoreObjects;
import com.google.common.base.Preconditions;
import com.google.common.base.MoreObjects;
import com.google.common.base.Preconditions;
-import java.util.Collections;
import java.util.Objects;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
import java.util.Objects;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
-import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument;
import org.opendaylight.yangtools.yang.model.api.SchemaPath;
/**
import org.opendaylight.yangtools.yang.model.api.SchemaPath;
/**
*/
public abstract class DOMRpcIdentifier {
*/
public abstract class DOMRpcIdentifier {
- private static final YangInstanceIdentifier GLOBAL_CONTEXT = YangInstanceIdentifier.create(Collections.<PathArgument>emptySet());
-
private static final class Global extends DOMRpcIdentifier {
private Global(final @Nonnull SchemaPath type) {
super(type);
private static final class Global extends DOMRpcIdentifier {
private Global(final @Nonnull SchemaPath type) {
super(type);
@Override
public YangInstanceIdentifier getContextReference() {
@Override
public YangInstanceIdentifier getContextReference() {
+ return YangInstanceIdentifier.EMPTY;
* @return A global RPC identifier, guaranteed to be non-null.
*/
public static @Nonnull DOMRpcIdentifier create(final @Nonnull SchemaPath type, final @Nullable YangInstanceIdentifier contextReference) {
* @return A global RPC identifier, guaranteed to be non-null.
*/
public static @Nonnull DOMRpcIdentifier create(final @Nonnull SchemaPath type, final @Nullable YangInstanceIdentifier contextReference) {
- if (contextReference == null || GLOBAL_CONTEXT.equals(contextReference)) {
+ if (contextReference == null || contextReference.isEmpty()) {
- } else {
- return new Local(type, contextReference);
+ return new Local(type, contextReference);