|
2 | 2 | import SwiftJava |
3 | 3 | import CSwiftJavaJNI |
4 | 4 |
|
| 5 | +/// A mapping from String keys to values of various types. The only types currently supported |
| 6 | +/// are: Boolean, Int, Long, Double, String, and arrays of each of these types. |
| 7 | +/// |
| 8 | +/// This is the base class for `Bundle` and `PersistableBundle`. |
| 9 | +/// |
| 10 | +/// See also: [android.os.BaseBundle](https://developer.android.com/reference/android/os/BaseBundle) |
| 11 | +@available(Android 21, *) |
5 | 12 | @JavaClass("android.os.BaseBundle") |
6 | 13 | open class BaseBundle: JavaObject { |
| 14 | + /// Inserts a String value into the mapping, replacing any existing value for the given key. |
7 | 15 | @JavaMethod |
8 | 16 | open func putString(_ arg0: String, _ arg1: String) |
9 | 17 |
|
| 18 | + /// Inserts a boolean array value into the mapping. |
10 | 19 | @JavaMethod |
11 | 20 | open func putBooleanArray(_ arg0: String, _ arg1: [Bool]) |
12 | 21 |
|
| 22 | + /// Inserts an int array value into the mapping. |
13 | 23 | @JavaMethod |
14 | 24 | open func putIntArray(_ arg0: String, _ arg1: [Int32]) |
15 | 25 |
|
| 26 | + /// Inserts a long array value into the mapping. |
16 | 27 | @JavaMethod |
17 | 28 | open func putLongArray(_ arg0: String, _ arg1: [Int64]) |
18 | 29 |
|
| 30 | + /// Inserts a double array value into the mapping. |
19 | 31 | @JavaMethod |
20 | 32 | open func putDoubleArray(_ arg0: String, _ arg1: [Double]) |
21 | 33 |
|
| 34 | + /// Inserts a String array value into the mapping. |
22 | 35 | @JavaMethod |
23 | 36 | open func putStringArray(_ arg0: String, _ arg1: [String]) |
24 | 37 |
|
| 38 | + /// Returns the value associated with the given key, or nil if no mapping of the desired type |
| 39 | + /// exists for the given key. |
25 | 40 | @JavaMethod |
26 | 41 | open func getBooleanArray(_ arg0: String) -> [Bool] |
27 | 42 |
|
| 43 | + /// Returns the value associated with the given key, or nil if no mapping of the desired type |
| 44 | + /// exists for the given key. |
28 | 45 | @JavaMethod |
29 | 46 | open func getIntArray(_ arg0: String) -> [Int32] |
30 | 47 |
|
| 48 | + /// Returns the value associated with the given key, or nil if no mapping of the desired type |
| 49 | + /// exists for the given key. |
31 | 50 | @JavaMethod |
32 | 51 | open func getLongArray(_ arg0: String) -> [Int64] |
33 | 52 |
|
| 53 | + /// Returns the value associated with the given key, or nil if no mapping of the desired type |
| 54 | + /// exists for the given key. |
34 | 55 | @JavaMethod |
35 | 56 | open func getDoubleArray(_ arg0: String) -> [Double] |
36 | 57 |
|
| 58 | + /// Removes any entry with the given key from the mapping. |
37 | 59 | @JavaMethod |
38 | 60 | open func remove(_ arg0: String) |
39 | 61 |
|
| 62 | + /// Returns the number of mappings contained in this Bundle. |
40 | 63 | @JavaMethod |
41 | 64 | open func size() -> Int32 |
42 | 65 |
|
| 66 | + /// Returns the entry with the given key as an object. |
43 | 67 | @JavaMethod |
44 | 68 | open func get(_ arg0: String) -> JavaObject! |
45 | 69 |
|
| 70 | + /// Returns the value associated with the given key, or `false` if no mapping of the desired type |
| 71 | + /// exists for the given key. |
46 | 72 | @JavaMethod |
47 | 73 | open func getBoolean(_ arg0: String) -> Bool |
48 | 74 |
|
| 75 | + /// Returns the value associated with the given key, or `arg1` if no mapping of the desired type |
| 76 | + /// exists for the given key. |
49 | 77 | @JavaMethod |
50 | 78 | open func getBoolean(_ arg0: String, _ arg1: Bool) -> Bool |
51 | 79 |
|
| 80 | + /// Inserts a Boolean value into the mapping. |
52 | 81 | @JavaMethod |
53 | 82 | open func putBoolean(_ arg0: String, _ arg1: Bool) |
54 | 83 |
|
| 84 | + /// Returns the value associated with the given key, or `0` if no mapping of the desired type |
| 85 | + /// exists for the given key. |
55 | 86 | @JavaMethod |
56 | 87 | open func getInt(_ arg0: String) -> Int32 |
57 | 88 |
|
| 89 | + /// Returns the value associated with the given key, or `arg1` if no mapping of the desired type |
| 90 | + /// exists for the given key. |
58 | 91 | @JavaMethod |
59 | 92 | open func getInt(_ arg0: String, _ arg1: Int32) -> Int32 |
60 | 93 |
|
| 94 | + /// Inserts an int value into the mapping. |
61 | 95 | @JavaMethod |
62 | 96 | open func putInt(_ arg0: String, _ arg1: Int32) |
63 | 97 |
|
| 98 | + /// Returns the value associated with the given key, or `arg1` if no mapping of the desired type |
| 99 | + /// exists for the given key. |
64 | 100 | @JavaMethod |
65 | 101 | open func getLong(_ arg0: String, _ arg1: Int64) -> Int64 |
66 | 102 |
|
| 103 | + /// Returns the value associated with the given key, or `0L` if no mapping of the desired type |
| 104 | + /// exists for the given key. |
67 | 105 | @JavaMethod |
68 | 106 | open func getLong(_ arg0: String) -> Int64 |
69 | 107 |
|
| 108 | + /// Inserts a long value into the mapping. |
70 | 109 | @JavaMethod |
71 | 110 | open func putLong(_ arg0: String, _ arg1: Int64) |
72 | 111 |
|
| 112 | + /// Returns the value associated with the given key, or `arg1` if no mapping of the desired type |
| 113 | + /// exists for the given key. |
73 | 114 | @JavaMethod |
74 | 115 | open func getDouble(_ arg0: String, _ arg1: Double) -> Double |
75 | 116 |
|
| 117 | + /// Returns the value associated with the given key, or `0.0` if no mapping of the desired type |
| 118 | + /// exists for the given key. |
76 | 119 | @JavaMethod |
77 | 120 | open func getDouble(_ arg0: String) -> Double |
78 | 121 |
|
| 122 | + /// Inserts a double value into the mapping. |
79 | 123 | @JavaMethod |
80 | 124 | open func putDouble(_ arg0: String, _ arg1: Double) |
81 | 125 |
|
| 126 | + /// Removes all elements from the mapping. |
82 | 127 | @JavaMethod |
83 | 128 | open func clear() |
84 | 129 |
|
| 130 | + /// Returns true if the mapping is empty, false otherwise. |
85 | 131 | @JavaMethod |
86 | 132 | open func isEmpty() -> Bool |
87 | 133 |
|
| 134 | + /// Inserts all mappings from the given `PersistableBundle` into this Bundle. |
88 | 135 | @JavaMethod |
89 | 136 | open func putAll(_ arg0: PersistableBundle?) |
90 | 137 |
|
| 138 | + /// Returns a Set containing the Strings used as keys in this Bundle. |
91 | 139 | @JavaMethod |
92 | 140 | open func keySet() -> JavaSet<JavaString>! |
93 | 141 |
|
| 142 | + /// Returns true if the given key is contained in the mapping. |
94 | 143 | @JavaMethod |
95 | 144 | open func containsKey(_ arg0: String) -> Bool |
96 | 145 |
|
| 146 | + /// Returns the value associated with the given key, or nil if no mapping exists. |
97 | 147 | @JavaMethod |
98 | 148 | open func getStringArray(_ arg0: String) -> [String] |
99 | 149 |
|
| 150 | + /// Returns the value associated with the given key, or nil if no mapping of the desired type |
| 151 | + /// exists for the given key. |
100 | 152 | @JavaMethod |
101 | 153 | open func getString(_ arg0: String) -> String |
102 | 154 |
|
| 155 | + /// Returns the value associated with the given key, or `arg1` if no mapping of the desired type |
| 156 | + /// exists for the given key. |
103 | 157 | @JavaMethod |
104 | 158 | open func getString(_ arg0: String, _ arg1: String) -> String |
105 | 159 | } |
0 commit comments