2 * Copyright (c) 2019 PANTHEON.tech, s.r.o. 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.yangtools.yang.model.util;
10 import static java.util.Objects.requireNonNull;
12 import com.google.common.annotations.Beta;
13 import com.google.common.base.MoreObjects;
14 import com.google.common.base.MoreObjects.ToStringHelper;
15 import org.eclipse.jdt.annotation.NonNullByDefault;
16 import org.opendaylight.yangtools.yang.model.api.PathExpression;
20 public abstract class AbstractPathExpression implements PathExpression {
21 private final String originalString;
23 protected AbstractPathExpression(final String originalString) {
24 this.originalString = requireNonNull(originalString);
28 public final String getOriginalString() {
29 return originalString;
33 public final String toString() {
34 return addToStringAttributes(MoreObjects.toStringHelper(this).omitNullValues()).toString();
37 protected ToStringHelper addToStringAttributes(final ToStringHelper helper) {
38 return helper.add("originalString", originalString);