2 * Copyright (c) 2023 PANTHEON.tech, s.r.o. 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.binding.generator.impl.reactor;
10 import static java.util.Objects.requireNonNull;
12 import com.google.common.base.MoreObjects.ToStringHelper;
13 import org.eclipse.jdt.annotation.NonNull;
14 import org.eclipse.jdt.annotation.NonNullByDefault;
17 * A {@link ClassNamingStrategy} which considers a {@link StatementNamespace} when assigning names.
20 abstract class AbstractNamespacedNamingStrategy extends ClassNamingStrategy {
21 private final StatementNamespace namespace;
23 AbstractNamespacedNamingStrategy(final StatementNamespace namespace) {
24 this.namespace = requireNonNull(namespace);
28 final @NonNull ClassNamingStrategy fallback() {
29 return new AppendNamespaceNamingStrategy(this);
32 final StatementNamespace namespace() {
37 ToStringHelper addToStringAttributes(final ToStringHelper helper) {
38 return helper.add("namespace", namespace);