1 /*
2 * SPDX-FileCopyrightText: Copyright (c) 2012-2025 Yegor Bugayenko
3 * SPDX-License-Identifier: MIT
4 */
5 package com.jcabi.manifests;
6
7 import java.io.IOException;
8 import java.util.Map;
9 import java.util.Set;
10
11 /**
12 * Map of manifest attributes.
13 *
14 * @see Manifests
15 * @since 1.1
16 */
17 public interface MfMap {
18
19 /**
20 * Get size of attributes map.
21 * @return Size of attributes map
22 * @since 2.0
23 */
24 int size();
25
26 /**
27 * Check if attributes map is empty.
28 * @return True if attributes map is empty and false otherwise
29 * @since 2.0
30 */
31 boolean isEmpty();
32
33 /**
34 * Check if attributes map contains the given key.
35 * @param key Attribute name
36 * @return True if attributes map contains the given key, and false otherwise
37 * @since 2.0
38 */
39 boolean containsKey(String key);
40
41 /**
42 * Check if attributes map contains the given value.
43 * @param value Attribute value
44 * @return True if attributes map contains the given value, and false otherwise
45 * @since 2.0
46 */
47 boolean containsValue(String value);
48
49 /**
50 * Get attribute value by its key.
51 * @param key Attribute name
52 * @return Value of the attribute, and null if attribute not found
53 */
54 String get(String key);
55
56 /**
57 * Get a copy of attributes map.
58 * @return Copy of attributes map
59 * @since 2.0
60 */
61 Map<String, String> getAsMap();
62
63 /**
64 * Get a copy of a set of attributes keys.
65 * @return Copy of a set of attributes keys
66 * @since 2.0
67 */
68 Set<String> keySet();
69
70 /**
71 * Append this collection of MANIFEST.MF files.
72 *
73 * This method changes the original instance.
74 *
75 * @param mfs Content to append
76 * @throws IOException If fails on I/O problem
77 * @since 2.0.0
78 */
79 void append(Mfs mfs) throws IOException;
80 }