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.archiver;
20
21 import java.util.LinkedHashMap;
22 import java.util.Map;
23
24 /**
25 * <p>ManifestSection class.</p>
26 */
27 public class ManifestSection {
28
29 private String name = null;
30
31 private final Map<String, String> manifestEntries = new LinkedHashMap<>();
32
33 /**
34 * <p>addManifestEntry.</p>
35 *
36 * @param key The key of the manifest entry.
37 * @param value The appropriate value.
38 */
39 public void addManifestEntry(String key, String value) {
40 manifestEntries.put(key, value);
41 }
42
43 /**
44 * <p>Getter for the field <code>manifestEntries</code>.</p>
45 *
46 * @return The entries.
47 */
48 public Map<String, String> getManifestEntries() {
49 return manifestEntries;
50 }
51
52 /**
53 * <p>Getter for the field <code>name</code>.</p>
54 *
55 * @return The name.
56 */
57 public String getName() {
58 return name;
59 }
60
61 /**
62 * <p>Setter for the field <code>name</code>.</p>
63 *
64 * @param name the name.
65 */
66 public void setName(String name) {
67 this.name = name;
68 }
69
70 /**
71 * <p>addManifestEntries.</p>
72 *
73 * @param map The map to add.
74 */
75 public void addManifestEntries(Map<String, String> map) {
76 manifestEntries.putAll(map);
77 }
78
79 /**
80 * <p>isManifestEntriesEmpty.</p>
81 *
82 * @return true if empty false otherwise.
83 */
84 public boolean isManifestEntriesEmpty() {
85 return manifestEntries.isEmpty();
86 }
87 }