View Javadoc
1   package org.apache.maven.archiver;
2   
3   /*
4    * Licensed to the Apache Software Foundation (ASF) under one
5    * or more contributor license agreements.  See the NOTICE file
6    * distributed with this work for additional information
7    * regarding copyright ownership.  The ASF licenses this file
8    * to you under the Apache License, Version 2.0 (the
9    * "License"); you may not use this file except in compliance
10   * with the License.  You may obtain a copy of the License at
11   *
12   *   http://www.apache.org/licenses/LICENSE-2.0
13   *
14   * Unless required by applicable law or agreed to in writing,
15   * software distributed under the License is distributed on an
16   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17   * KIND, either express or implied.  See the License for the
18   * specific language governing permissions and limitations
19   * under the License.
20   */
21  
22  import java.util.LinkedHashMap;
23  import java.util.Map;
24  
25  /**
26   * @version $Id: ManifestSection.java 1738422 2016-04-10 11:51:15Z khmarbaise $
27   */
28  public class ManifestSection
29  {
30  
31      private String name = null;
32  
33      private Map<String, String> manifestEntries = new LinkedHashMap<String, String>();
34  
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      {
41          manifestEntries.put( key, value );
42      }
43  
44      /**
45       * @return The entries.
46       */
47      public Map<String, String> getManifestEntries()
48      {
49          return manifestEntries;
50      }
51  
52      /**
53       * @return The name.
54       */
55      public String getName()
56      {
57          return name;
58      }
59  
60      /**
61       * @param name the name.
62       */
63      public void setName( String name )
64      {
65          this.name = name;
66      }
67  
68      /**
69       * @param map The map to add.
70       */
71      public void addManifestEntries( Map<String, String> map )
72      {
73          manifestEntries.putAll( map );
74      }
75  
76      /**
77       * @return true if empty false otherwise.
78       */
79      public boolean isManifestEntriesEmpty()
80      {
81          return manifestEntries.isEmpty();
82      }
83  }