MCPcopy Create free account
hub / github.com/FongMi/TV / put

Method put

catvod/src/main/java/com/github/catvod/utils/Prefers.java:75–91  ·  view source on GitHub ↗
(String key, Object obj)

Source from the content-addressed store, hash-verified

73 }
74
75 public static void put(String key, Object obj) {
76 if (obj == null) return;
77 if (obj instanceof String val) {
78 getPrefers().edit().putString(key, val).apply();
79 } else if (obj instanceof Boolean val) {
80 getPrefers().edit().putBoolean(key, val).apply();
81 } else if (obj instanceof Float val) {
82 getPrefers().edit().putFloat(key, val).apply();
83 } else if (obj instanceof Integer val) {
84 getPrefers().edit().putInt(key, val).apply();
85 } else if (obj instanceof Long val) {
86 getPrefers().edit().putLong(key, val).apply();
87 } else if (obj instanceof Number val) {
88 if (val.toString().contains(".")) put(key, val.floatValue());
89 else put(key, val.intValue());
90 }
91 }
92
93 public static void remove(String key) {
94 getPrefers().edit().remove(key).apply();

Callers 15

setMethod · 0.95
updateMethod · 0.95
restoreMethod · 0.95
homeContentMethod · 0.95
doResponseMethod · 0.95
setCrashMethod · 0.95
putEngineMethod · 0.95
putMpvGpuNextMethod · 0.95
putMpvVulkanMethod · 0.95
putRenderMethod · 0.95
putTunnelMethod · 0.95
putSizeMethod · 0.95

Calls 5

getPrefersMethod · 0.95
applyMethod · 0.80
editMethod · 0.45
containsMethod · 0.45
toStringMethod · 0.45

Tested by

no test coverage detected