1 /*
2 * Licensed to the Apache Software Foundation (ASF) under one
3 * or more contributor license agreements. See the NOTICE file
4 * distributed with this work for additional information
5 * regarding copyright ownership. The ASF licenses this file
6 * to you under the Apache License, Version 2.0 (the
7 * "License"); you may not use this file except in compliance
8 * with the License. You may obtain a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing,
13 * software distributed under the License is distributed on an
14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 * KIND, either express or implied. See the License for the
16 * specific language governing permissions and limitations
17 * under the License.
18 */
19 package org.apache.maven.api.cli.mvnenc;
20
21 import java.util.Collection;
22 import java.util.List;
23 import java.util.Map;
24 import java.util.Optional;
25
26 import org.apache.maven.api.annotations.Experimental;
27 import org.apache.maven.api.annotations.Nonnull;
28 import org.apache.maven.api.cli.Options;
29
30 /**
31 * Defines the options specific to the Maven encryption tool.
32 * This interface extends the general {@link Options} interface, adding encryption-specific configuration options.
33 *
34 * @since 4.0.0
35 */
36 @Experimental
37 public interface EncryptOptions extends Options {
38 /**
39 * Should the operation be forced (ie overwrite existing config, if any).
40 *
41 * @return an {@link Optional} containing the boolean value {@code true} if specified, or empty
42 */
43 Optional<Boolean> force();
44
45 /**
46 * Should imply "yes" to all questions.
47 *
48 * @return an {@link Optional} containing the boolean value {@code true} if specified, or empty
49 */
50 Optional<Boolean> yes();
51
52 /**
53 * Returns the list of encryption goals to be executed.
54 * These goals can include operations like "init", "add-server", "delete-server", etc.
55 *
56 * @return an {@link Optional} containing the list of goals, or empty if not specified
57 */
58 @Nonnull
59 Optional<List<String>> goals();
60
61 /**
62 * Returns a new instance of EncryptOptions with values interpolated using the given properties.
63 *
64 * @param properties a collection of property maps to use for interpolation
65 * @return a new EncryptOptions instance with interpolated values
66 */
67 @Nonnull
68 EncryptOptions interpolate(Collection<Map<String, String>> properties);
69 }