mirror of
https://github.com/VibedByKaKi/alexandroid.git
synced 2026-11-18 20:07:19 +01:00
33 lines
1.2 KiB
Java
33 lines
1.2 KiB
Java
package org.json;
|
|
|
|
import java.util.Enumeration;
|
|
import java.util.Properties;
|
|
|
|
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
|
|
/* loaded from: classes11.dex */
|
|
public class Property {
|
|
public static JSONObject toJSONObject(Properties properties) throws JSONException {
|
|
JSONObject jSONObject = new JSONObject();
|
|
if (properties != null && !properties.isEmpty()) {
|
|
Enumeration<?> propertyNames = properties.propertyNames();
|
|
while (propertyNames.hasMoreElements()) {
|
|
String str = (String) propertyNames.nextElement();
|
|
jSONObject.put(str, properties.getProperty(str));
|
|
}
|
|
}
|
|
return jSONObject;
|
|
}
|
|
|
|
public static Properties toProperties(JSONObject jSONObject) throws JSONException {
|
|
Properties properties = new Properties();
|
|
if (jSONObject != null) {
|
|
for (String str : jSONObject.keySet()) {
|
|
Object opt = jSONObject.opt(str);
|
|
if (!JSONObject.NULL.equals(opt)) {
|
|
properties.put(str, opt.toString());
|
|
}
|
|
}
|
|
}
|
|
return properties;
|
|
}
|
|
}
|