- Add the Codota plugin to your IDE and get smart completions
private void myMethod () {Dictionary d =
new Hashtable()
Bundle bundle;bundle.getHeaders()
new Properties()
- Smart code suggestions by Codota
}
static public DeferredResult inParallel(final TaskWithoutResult task) { return Do.inParallel(() -> { task.perform(); return null; }); }
/** * waits until the operation is finished and return it's result on success, or throws an error on failure. * * @throws Error or {@link Failure} if operation fails */ public <T> T waitSuccess() throws Error, InterruptedException { join(); if (isSuccess()) return (T) result; if (result instanceof Exception) throw new Error((Exception) result); throw new Failure(result); }
public Binder getOrCreateBinder(String key) { checkNotFrozen(); HashMap<String, Object> x = (HashMap<String, Object>) get(key); Binder b = null; if (x == null) { b = new Binder(); put(key, b); } else b = (x instanceof Binder) ? (Binder) x : new Binder(x); return b; }
Binder connect() { if (serverNonce == null) serverNonce = Do.randomBytes(48); return Binder.fromKeysValues( "server_nonce", serverNonce, "session_id", ""+sessionId ); }
public Binder getData() { if( data == null ) data = new Binder(); return data; }
private Binder onPing(Binder params) { Binder result = Binder.fromKeysValues("ping", "pong"); result.putAll(params); return result; }
@Override public Binder serialize(Object object, BiSerializer serializer) { ItemInfo ii = (ItemInfo)object; return Binder.fromKeysValues( "item_result", ii.itemResult, "item_id", ii.itemId, "errors", ii.errors ); }
public void setExtendedType(String extendedType) { this.extendedType = extendedType; if(definition != null) definition.set("extended_type", extendedType); } public String getExtendedType() {
/** * For unit-tests. Blocks until the node is initialized. * * @throws InterruptedException for unexpected interrupt */ public void waitReady() throws InterruptedException { eventReady.await(); }
/** * Get collected report as JSON string * * @return */ public synchronized String reportJson() { return JsonTool.toJsonString(report()); }
public ResyncProcessor(HashId itemId, Consumer<ResyncingItem> onComplete) { this.itemId = itemId; if (onComplete != null) finishEvent.addConsumer(onComplete); }
/** * Get several bytes from the queue (size can be any positive). Blocks until specified number of * bytes are written. */ public byte[] get(int size) { byte[] result = new byte[size]; for (int i = 0; i < size; i++) { result[i] = (byte)get(); } return result; }
/** * Put all the bytes to the buffer. Blocks until the operation is completed. * * @param collection */ public void put(Iterable<T> collection) { for (T x : collection) { put(x); } }
/** * Outputs newline on the console only (does nothing in quiet more). */ public void newLine() { console("\n"); }
/** * Creates {@link Binder} that will be returned to client after smart contract have been approved. * @return */ public Binder getExtraResultForApprove() { return new Binder(); }
@Override public Binder serialize(BiSerializer s) { return Binder.fromKeysValues( "anonymousId", anonymousId ); }
public Binder getData() { if (data == null) data = new Binder(); return data; } }