2 * Copyright (c) 2020 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.yangtools.yang2sources.plugin;
10 import static com.google.common.base.Verify.verifyNotNull;
11 import static java.util.Objects.requireNonNull;
13 import com.google.common.base.MoreObjects;
14 import java.util.Collections;
15 import java.util.HashMap;
17 import org.apache.maven.plugins.annotations.Parameter;
18 import org.eclipse.jdt.annotation.NonNull;
19 import org.opendaylight.yangtools.concepts.Identifiable;
21 public final class FileGeneratorArg implements Identifiable<String> {
23 private final Map<String, String> configuration = new HashMap<>();
25 @Parameter(required = true)
26 private String identifier;
28 public FileGeneratorArg() {
32 public FileGeneratorArg(final String identifier) {
33 this.identifier = requireNonNull(identifier);
36 public FileGeneratorArg(final String identifier, final Map<String, String> configuration) {
38 this.configuration.putAll(configuration);
42 public String getIdentifier() {
43 return verifyNotNull(identifier);
46 public @NonNull Map<String, String> getConfiguration() {
47 return Collections.unmodifiableMap(configuration);
51 public String toString() {
52 return MoreObjects.toStringHelper(this).add("id", identifier).add("configuration", configuration).toString();