001/* 002 * SPDX-FileCopyrightText: none 003 * SPDX-License-Identifier: CC0-1.0 004 */ 005 006package gov.nist.secauto.metaschema.cli.processor.command.impl; 007 008import gov.nist.secauto.metaschema.cli.processor.command.ExtraArgument; 009 010import edu.umd.cs.findbugs.annotations.NonNull; 011 012/** 013 * A default implementation of the {@link ExtraArgument} interface that 014 * represents a named command-line argument which can be marked as required or 015 * optional. 016 * <p> 017 * This implementation is used by the command processor to handle additional 018 * arguments that are not covered by specific command options. 019 */ 020public class DefaultExtraArgument implements ExtraArgument { 021 private final String name; 022 private final boolean required; 023 024 /** 025 * Construct a new instance. 026 * 027 * @param name 028 * the argument name 029 * @param required 030 * {@code true} if the argument is required, or {@code false} otherwise 031 */ 032 public DefaultExtraArgument(@NonNull String name, boolean required) { 033 this.name = name; 034 this.required = required; 035 } 036 037 @Override 038 public String getName() { 039 return name; 040 } 041 042 @Override 043 public boolean isRequired() { 044 return required; 045 } 046}