1   /*
2    * SPDX-FileCopyrightText: none
3    * SPDX-License-Identifier: CC0-1.0
4    */
5   
6   package gov.nist.secauto.metaschema.core.metapath.function;
7   
8   import java.util.List;
9   
10  import javax.xml.namespace.QName;
11  
12  import edu.umd.cs.findbugs.annotations.NonNull;
13  
14  abstract class AbstractFunction implements IFunction {
15    @NonNull
16    private final QName qname;
17    @NonNull
18    private final List<IArgument> arguments;
19  
20    protected AbstractFunction(
21        @NonNull String name,
22        @NonNull String namespace,
23        @NonNull List<IArgument> arguments) {
24      this(new QName(namespace, name), arguments);
25    }
26  
27    protected AbstractFunction(
28        @NonNull QName qname,
29        @NonNull List<IArgument> arguments) {
30      this.qname = qname;
31      this.arguments = arguments;
32    }
33  
34    @Override
35    public QName getQName() {
36      return qname;
37    }
38  
39    @Override
40    public int arity() {
41      return arguments.size();
42    }
43  
44    @Override
45    public List<IArgument> getArguments() {
46      return arguments;
47    }
48  }