(Object milliseconds)
| 1207 | // } |
| 1208 | // ----- END OF WRAPPERS ----- // |
| 1209 | public CompletableFuture<Object> sleep(Object milliseconds) { |
| 1210 | long ms; |
| 1211 | if (milliseconds instanceof Integer) { |
| 1212 | ms = ((Integer) milliseconds).longValue(); |
| 1213 | } else if (milliseconds instanceof Long) { |
| 1214 | ms = (Long) milliseconds; |
| 1215 | } else if (milliseconds instanceof String) { |
| 1216 | ms = Long.valueOf((String) milliseconds); |
| 1217 | } else if (milliseconds instanceof Double) { |
| 1218 | ms = ((Double) milliseconds).longValue(); |
| 1219 | } else { |
| 1220 | throw new IllegalArgumentException("milliseconds must be Integer, Long, Double, or String"); |
| 1221 | } |
| 1222 | return CompletableFuture.supplyAsync(() -> null, |
| 1223 | CompletableFuture.delayedExecutor(ms, java.util.concurrent.TimeUnit.MILLISECONDS)); |
| 1224 | } |
| 1225 | |
| 1226 | public HashMap<String, Object> createSafeDictionary() { |
| 1227 | return new HashMap<>(); |
no outgoing calls