id
int32
0
165k
repo
stringlengths
7
58
path
stringlengths
12
218
func_name
stringlengths
3
140
original_string
stringlengths
73
34.1k
language
stringclasses
1 value
code
stringlengths
73
34.1k
code_tokens
list
docstring
stringlengths
3
16k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
105
339
42,500
di2e/Argo
ProbeSender/src/main/java/ws/argo/probe/ProbeSenderFactory.java
ProbeSenderFactory.createMulticastProbeSender
public static ProbeSender createMulticastProbeSender(String niName) throws TransportConfigException { Transport mcastTransport = new MulticastTransport(niName); ProbeSender gen = new ProbeSender(mcastTransport); return gen; }
java
public static ProbeSender createMulticastProbeSender(String niName) throws TransportConfigException { Transport mcastTransport = new MulticastTransport(niName); ProbeSender gen = new ProbeSender(mcastTransport); return gen; }
[ "public", "static", "ProbeSender", "createMulticastProbeSender", "(", "String", "niName", ")", "throws", "TransportConfigException", "{", "Transport", "mcastTransport", "=", "new", "MulticastTransport", "(", "niName", ")", ";", "ProbeSender", "gen", "=", "new", "Probe...
Create a Multicast ProbeSender specifying the Network Interface to send on. @param niName network interface name @return configured ProbeSender instance @throws TransportConfigException if something went wrong
[ "Create", "a", "Multicast", "ProbeSender", "specifying", "the", "Network", "Interface", "to", "send", "on", "." ]
f537a03d2d25fdfecda7999ec10e1da67dc3b8f3
https://github.com/di2e/Argo/blob/f537a03d2d25fdfecda7999ec10e1da67dc3b8f3/ProbeSender/src/main/java/ws/argo/probe/ProbeSenderFactory.java#L63-L67
42,501
di2e/Argo
ProbeSender/src/main/java/ws/argo/probe/ProbeSenderFactory.java
ProbeSenderFactory.createSNSProbeSender
public static ProbeSender createSNSProbeSender(String ak, String sk) throws ProbeSenderException { Transport snsTransport = new AmazonSNSTransport(ak, sk); ProbeSender gen = new ProbeSender(snsTransport); return gen; }
java
public static ProbeSender createSNSProbeSender(String ak, String sk) throws ProbeSenderException { Transport snsTransport = new AmazonSNSTransport(ak, sk); ProbeSender gen = new ProbeSender(snsTransport); return gen; }
[ "public", "static", "ProbeSender", "createSNSProbeSender", "(", "String", "ak", ",", "String", "sk", ")", "throws", "ProbeSenderException", "{", "Transport", "snsTransport", "=", "new", "AmazonSNSTransport", "(", "ak", ",", "sk", ")", ";", "ProbeSender", "gen", ...
Create a AmazonSNS transport ProbeSender using the default values. @param ak the amazon access key @param sk the amazon secret key @return configured ProbeSender instance @throws ProbeSenderException if something went wrong
[ "Create", "a", "AmazonSNS", "transport", "ProbeSender", "using", "the", "default", "values", "." ]
f537a03d2d25fdfecda7999ec10e1da67dc3b8f3
https://github.com/di2e/Argo/blob/f537a03d2d25fdfecda7999ec10e1da67dc3b8f3/ProbeSender/src/main/java/ws/argo/probe/ProbeSenderFactory.java#L108-L112
42,502
di2e/Argo
Responder/ResponderDaemon/src/main/java/ws/argo/responder/Responder.java
Responder.initializeHTTPClient
private void initializeHTTPClient() { if (_config.isHTTPSConfigured()) { try { KeyStore trustKeystore = getClientTruststore(); SSLContext sslContext = SSLContexts.custom() .loadTrustMaterial(trustKeystore, new TrustSelfSignedStrategy()) .build(); SSLConnection...
java
private void initializeHTTPClient() { if (_config.isHTTPSConfigured()) { try { KeyStore trustKeystore = getClientTruststore(); SSLContext sslContext = SSLContexts.custom() .loadTrustMaterial(trustKeystore, new TrustSelfSignedStrategy()) .build(); SSLConnection...
[ "private", "void", "initializeHTTPClient", "(", ")", "{", "if", "(", "_config", ".", "isHTTPSConfigured", "(", ")", ")", "{", "try", "{", "KeyStore", "trustKeystore", "=", "getClientTruststore", "(", ")", ";", "SSLContext", "sslContext", "=", "SSLContexts", "....
Create HTTP Client.
[ "Create", "HTTP", "Client", "." ]
f537a03d2d25fdfecda7999ec10e1da67dc3b8f3
https://github.com/di2e/Argo/blob/f537a03d2d25fdfecda7999ec10e1da67dc3b8f3/Responder/ResponderDaemon/src/main/java/ws/argo/responder/Responder.java#L153-L184
42,503
di2e/Argo
Responder/ResponderDaemon/src/main/java/ws/argo/responder/Responder.java
Responder.getClientTruststore
private KeyStore getClientTruststore() throws KeyStoreException, NoSuchAlgorithmException, CertificateException, IOException { KeyStore ks = null; if (_config.getTruststoreType() != null && !_config.getTruststoreType().isEmpty()) { try { ks = KeyStore.getInstance(_config.getTruststoreType())...
java
private KeyStore getClientTruststore() throws KeyStoreException, NoSuchAlgorithmException, CertificateException, IOException { KeyStore ks = null; if (_config.getTruststoreType() != null && !_config.getTruststoreType().isEmpty()) { try { ks = KeyStore.getInstance(_config.getTruststoreType())...
[ "private", "KeyStore", "getClientTruststore", "(", ")", "throws", "KeyStoreException", ",", "NoSuchAlgorithmException", ",", "CertificateException", ",", "IOException", "{", "KeyStore", "ks", "=", "null", ";", "if", "(", "_config", ".", "getTruststoreType", "(", ")"...
Read the KeyStore information supplied from the responder configuration file. @return the KeyStore object @throws KeyStoreException if there is an issue reading the keystore @throws NoSuchAlgorithmException if the truststore type is incorrect @throws CertificateException if there is some issues reading in the certs @t...
[ "Read", "the", "KeyStore", "information", "supplied", "from", "the", "responder", "configuration", "file", "." ]
f537a03d2d25fdfecda7999ec10e1da67dc3b8f3
https://github.com/di2e/Argo/blob/f537a03d2d25fdfecda7999ec10e1da67dc3b8f3/Responder/ResponderDaemon/src/main/java/ws/argo/responder/Responder.java#L195-L224
42,504
di2e/Argo
Responder/ResponderDaemon/src/main/java/ws/argo/responder/Responder.java
Responder.stopResponder
public void stopResponder() { LOGGER.info("Force shutdown of Responder [" + _runtimeId + "]"); _shutdownHook.start(); Runtime.getRuntime().removeShutdownHook(_shutdownHook); }
java
public void stopResponder() { LOGGER.info("Force shutdown of Responder [" + _runtimeId + "]"); _shutdownHook.start(); Runtime.getRuntime().removeShutdownHook(_shutdownHook); }
[ "public", "void", "stopResponder", "(", ")", "{", "LOGGER", ".", "info", "(", "\"Force shutdown of Responder [\"", "+", "_runtimeId", "+", "\"]\"", ")", ";", "_shutdownHook", ".", "start", "(", ")", ";", "Runtime", ".", "getRuntime", "(", ")", ".", "removeSh...
Close the socket and tell the processing loop to terminate. This is a forced shutdown rather then a natural shutdown. A natural shutdown happens when the shutdown hook fires when the VM exists. This method forces all that to happen. This is done to allow multiple Responders to be created and destroyed during a single V...
[ "Close", "the", "socket", "and", "tell", "the", "processing", "loop", "to", "terminate", ".", "This", "is", "a", "forced", "shutdown", "rather", "then", "a", "natural", "shutdown", ".", "A", "natural", "shutdown", "happens", "when", "the", "shutdown", "hook"...
f537a03d2d25fdfecda7999ec10e1da67dc3b8f3
https://github.com/di2e/Argo/blob/f537a03d2d25fdfecda7999ec10e1da67dc3b8f3/Responder/ResponderDaemon/src/main/java/ws/argo/responder/Responder.java#L333-L337
42,505
di2e/Argo
Responder/ResponderDaemon/src/main/java/ws/argo/responder/Responder.java
Responder.shutdown
public void shutdown() { LOGGER.info("Responder shutting down: [" + _runtimeId + "]"); for (Transport t : _transports) { try { t.shutdown(); } catch (TransportException e) { LOGGER.warn( "Error shutting down transport: [" + t.transportName() + "]", e); } } }
java
public void shutdown() { LOGGER.info("Responder shutting down: [" + _runtimeId + "]"); for (Transport t : _transports) { try { t.shutdown(); } catch (TransportException e) { LOGGER.warn( "Error shutting down transport: [" + t.transportName() + "]", e); } } }
[ "public", "void", "shutdown", "(", ")", "{", "LOGGER", ".", "info", "(", "\"Responder shutting down: [\"", "+", "_runtimeId", "+", "\"]\"", ")", ";", "for", "(", "Transport", "t", ":", "_transports", ")", "{", "try", "{", "t", ".", "shutdown", "(", ")", ...
This will shutdown the listening socket and remove the responder from the multicast group. Part of the natural life cycle. It also will end the run loop of the responder automatically - it will interrupt any read operation going on and exit the run loop.
[ "This", "will", "shutdown", "the", "listening", "socket", "and", "remove", "the", "responder", "from", "the", "multicast", "group", ".", "Part", "of", "the", "natural", "life", "cycle", ".", "It", "also", "will", "end", "the", "run", "loop", "of", "the", ...
f537a03d2d25fdfecda7999ec10e1da67dc3b8f3
https://github.com/di2e/Argo/blob/f537a03d2d25fdfecda7999ec10e1da67dc3b8f3/Responder/ResponderDaemon/src/main/java/ws/argo/responder/Responder.java#L345-L354
42,506
di2e/Argo
Responder/ResponderDaemon/src/main/java/ws/argo/responder/Responder.java
Responder.run
public void run() { // I hope that this hits you over the head with its simplicity. // That's the idea. The instances of the transports are supposed to be self // contained. Thread transportThread; for (Transport t : _transports) { transportThread = new Thread(t); transportThread.setN...
java
public void run() { // I hope that this hits you over the head with its simplicity. // That's the idea. The instances of the transports are supposed to be self // contained. Thread transportThread; for (Transport t : _transports) { transportThread = new Thread(t); transportThread.setN...
[ "public", "void", "run", "(", ")", "{", "// I hope that this hits you over the head with its simplicity.", "// That's the idea. The instances of the transports are supposed to be self", "// contained.", "Thread", "transportThread", ";", "for", "(", "Transport", "t", ":", "_transpor...
This is the main run method for the Argo Responder. It starts up all the configured transports in their own thread and starts their receive loops. <p> Transports run in their own thread. Thus, when all the transports are running, this method will exit. You can shutdown the Responder by calling the {@linkplain #shutdow...
[ "This", "is", "the", "main", "run", "method", "for", "the", "Argo", "Responder", ".", "It", "starts", "up", "all", "the", "configured", "transports", "in", "their", "own", "thread", "and", "starts", "their", "receive", "loops", "." ]
f537a03d2d25fdfecda7999ec10e1da67dc3b8f3
https://github.com/di2e/Argo/blob/f537a03d2d25fdfecda7999ec10e1da67dc3b8f3/Responder/ResponderDaemon/src/main/java/ws/argo/responder/Responder.java#L372-L387
42,507
di2e/Argo
Responder/ResponderDaemon/src/main/java/ws/argo/responder/Responder.java
Responder.probesPerSecond
public synchronized float probesPerSecond() { Instant now = new Instant(); Instant event = null; int events = 0; boolean done = false; long timeWindow = 0; long oldestTime = 0; do { event = messages.poll(); if (event != null) { events++; if (events == 1) ...
java
public synchronized float probesPerSecond() { Instant now = new Instant(); Instant event = null; int events = 0; boolean done = false; long timeWindow = 0; long oldestTime = 0; do { event = messages.poll(); if (event != null) { events++; if (events == 1) ...
[ "public", "synchronized", "float", "probesPerSecond", "(", ")", "{", "Instant", "now", "=", "new", "Instant", "(", ")", ";", "Instant", "event", "=", "null", ";", "int", "events", "=", "0", ";", "boolean", "done", "=", "false", ";", "long", "timeWindow",...
Calculates the number of probes per second over the last 1000 probes. @return probes per second
[ "Calculates", "the", "number", "of", "probes", "per", "second", "over", "the", "last", "1000", "probes", "." ]
f537a03d2d25fdfecda7999ec10e1da67dc3b8f3
https://github.com/di2e/Argo/blob/f537a03d2d25fdfecda7999ec10e1da67dc3b8f3/Responder/ResponderDaemon/src/main/java/ws/argo/responder/Responder.java#L402-L431
42,508
di2e/Argo
Responder/ResponderDaemon/src/main/java/ws/argo/responder/Responder.java
Responder.main
public static void main(String[] args) throws ResponderConfigException { Responder responder = initialize(args); if (responder != null) { responder.run(); } }
java
public static void main(String[] args) throws ResponderConfigException { Responder responder = initialize(args); if (responder != null) { responder.run(); } }
[ "public", "static", "void", "main", "(", "String", "[", "]", "args", ")", "throws", "ResponderConfigException", "{", "Responder", "responder", "=", "initialize", "(", "args", ")", ";", "if", "(", "responder", "!=", "null", ")", "{", "responder", ".", "run"...
Main entry point for Argo Responder. @param args command line arguments @throws ResponderConfigException if bad things happen with the configuration files
[ "Main", "entry", "point", "for", "Argo", "Responder", "." ]
f537a03d2d25fdfecda7999ec10e1da67dc3b8f3
https://github.com/di2e/Argo/blob/f537a03d2d25fdfecda7999ec10e1da67dc3b8f3/Responder/ResponderDaemon/src/main/java/ws/argo/responder/Responder.java#L491-L498
42,509
di2e/Argo
Responder/ResponderDaemon/src/main/java/ws/argo/responder/Responder.java
Responder.initialize
public static Responder initialize(String[] args) throws ResponderConfigException { readVersionProperties(); LOGGER.info("Starting Argo Responder daemon process. Version " + ARGO_VERSION); ResponderConfiguration config = parseCommandLine(args); if (config == null) { LOGGER.error( "Invalid Respo...
java
public static Responder initialize(String[] args) throws ResponderConfigException { readVersionProperties(); LOGGER.info("Starting Argo Responder daemon process. Version " + ARGO_VERSION); ResponderConfiguration config = parseCommandLine(args); if (config == null) { LOGGER.error( "Invalid Respo...
[ "public", "static", "Responder", "initialize", "(", "String", "[", "]", "args", ")", "throws", "ResponderConfigException", "{", "readVersionProperties", "(", ")", ";", "LOGGER", ".", "info", "(", "\"Starting Argo Responder daemon process. Version \"", "+", "ARGO_VERSION...
Create a new Responder given the command line arguments. @param args - command line arguments @return the new Responder instance or null if something wonky happened @throws ResponderConfigException if bad things happen with the configuration files and the content of the files. For example if the classnames for the pro...
[ "Create", "a", "new", "Responder", "given", "the", "command", "line", "arguments", "." ]
f537a03d2d25fdfecda7999ec10e1da67dc3b8f3
https://github.com/di2e/Argo/blob/f537a03d2d25fdfecda7999ec10e1da67dc3b8f3/Responder/ResponderDaemon/src/main/java/ws/argo/responder/Responder.java#L510-L543
42,510
di2e/Argo
clui/src/main/java/net/dharwin/common/tools/cli/api/CLIContext.java
CLIContext.loadProperties
private void loadProperties(String propFileName) { if (propFileName != null) { loadProperties(getClass().getResourceAsStream(propFileName), propFileName); } }
java
private void loadProperties(String propFileName) { if (propFileName != null) { loadProperties(getClass().getResourceAsStream(propFileName), propFileName); } }
[ "private", "void", "loadProperties", "(", "String", "propFileName", ")", "{", "if", "(", "propFileName", "!=", "null", ")", "{", "loadProperties", "(", "getClass", "(", ")", ".", "getResourceAsStream", "(", "propFileName", ")", ",", "propFileName", ")", ";", ...
Load properties from a resource stream. @param propFileName The resource name.
[ "Load", "properties", "from", "a", "resource", "stream", "." ]
f537a03d2d25fdfecda7999ec10e1da67dc3b8f3
https://github.com/di2e/Argo/blob/f537a03d2d25fdfecda7999ec10e1da67dc3b8f3/clui/src/main/java/net/dharwin/common/tools/cli/api/CLIContext.java#L54-L58
42,511
di2e/Argo
clui/src/main/java/net/dharwin/common/tools/cli/api/CLIContext.java
CLIContext.loadProperties
private void loadProperties(InputStream stream, String path) { if (stream == null) { return; } try { Properties props = new Properties(); props.load(stream); Iterator<Object> keyIt = props.keySet().iterator(); while (keyIt.hasNext()) { String key = keyIt.next().toString(); ...
java
private void loadProperties(InputStream stream, String path) { if (stream == null) { return; } try { Properties props = new Properties(); props.load(stream); Iterator<Object> keyIt = props.keySet().iterator(); while (keyIt.hasNext()) { String key = keyIt.next().toString(); ...
[ "private", "void", "loadProperties", "(", "InputStream", "stream", ",", "String", "path", ")", "{", "if", "(", "stream", "==", "null", ")", "{", "return", ";", "}", "try", "{", "Properties", "props", "=", "new", "Properties", "(", ")", ";", "props", "....
Loads properties from the given stream. This will close the stream. @param stream The stream to load from. @param path The path represented by the stream.
[ "Loads", "properties", "from", "the", "given", "stream", ".", "This", "will", "close", "the", "stream", "." ]
f537a03d2d25fdfecda7999ec10e1da67dc3b8f3
https://github.com/di2e/Argo/blob/f537a03d2d25fdfecda7999ec10e1da67dc3b8f3/clui/src/main/java/net/dharwin/common/tools/cli/api/CLIContext.java#L82-L110
42,512
di2e/Argo
clui/src/main/java/net/dharwin/common/tools/cli/api/CLIContext.java
CLIContext.put
public Object put(String key, Object o) { return _properties.put(key, o); }
java
public Object put(String key, Object o) { return _properties.put(key, o); }
[ "public", "Object", "put", "(", "String", "key", ",", "Object", "o", ")", "{", "return", "_properties", ".", "put", "(", "key", ",", "o", ")", ";", "}" ]
Add an object to the context. @param key The key to add. @param o The object to add. @return The previous object associated with this key, or null if there was none.
[ "Add", "an", "object", "to", "the", "context", "." ]
f537a03d2d25fdfecda7999ec10e1da67dc3b8f3
https://github.com/di2e/Argo/blob/f537a03d2d25fdfecda7999ec10e1da67dc3b8f3/clui/src/main/java/net/dharwin/common/tools/cli/api/CLIContext.java#L134-L136
42,513
di2e/Argo
clui/src/main/java/net/dharwin/common/tools/cli/api/CLIContext.java
CLIContext.getString
public String getString(String key, String defaultValue) { Object o = getObject(key); if (o == null) { return defaultValue; } if (!(o instanceof String)) { throw new IllegalArgumentException("Object ["+o+"] associated with key ["+key+"] is not of type String."); } return (String)o; }
java
public String getString(String key, String defaultValue) { Object o = getObject(key); if (o == null) { return defaultValue; } if (!(o instanceof String)) { throw new IllegalArgumentException("Object ["+o+"] associated with key ["+key+"] is not of type String."); } return (String)o; }
[ "public", "String", "getString", "(", "String", "key", ",", "String", "defaultValue", ")", "{", "Object", "o", "=", "getObject", "(", "key", ")", ";", "if", "(", "o", "==", "null", ")", "{", "return", "defaultValue", ";", "}", "if", "(", "!", "(", ...
Get the string value, or the defaultValue if not found. @param key The key to search for. @return The value, or defaultValue if not found.
[ "Get", "the", "string", "value", "or", "the", "defaultValue", "if", "not", "found", "." ]
f537a03d2d25fdfecda7999ec10e1da67dc3b8f3
https://github.com/di2e/Argo/blob/f537a03d2d25fdfecda7999ec10e1da67dc3b8f3/clui/src/main/java/net/dharwin/common/tools/cli/api/CLIContext.java#L156-L165
42,514
di2e/Argo
clui/src/main/java/net/dharwin/common/tools/cli/api/CLIContext.java
CLIContext.getBoolean
public boolean getBoolean(String key, boolean defaultValue) { Object o = getObject(key); if (o == null) { return defaultValue; } boolean b = defaultValue; try { b = Boolean.parseBoolean(o.toString()); } catch (Exception e) { throw new IllegalArgumentException("Object ["+o+"] associated ...
java
public boolean getBoolean(String key, boolean defaultValue) { Object o = getObject(key); if (o == null) { return defaultValue; } boolean b = defaultValue; try { b = Boolean.parseBoolean(o.toString()); } catch (Exception e) { throw new IllegalArgumentException("Object ["+o+"] associated ...
[ "public", "boolean", "getBoolean", "(", "String", "key", ",", "boolean", "defaultValue", ")", "{", "Object", "o", "=", "getObject", "(", "key", ")", ";", "if", "(", "o", "==", "null", ")", "{", "return", "defaultValue", ";", "}", "boolean", "b", "=", ...
Get the boolean value, or the defaultValue if not found. @param key The key to search for. @param defaultValue the default value @return The value, or defaultValue if not found.
[ "Get", "the", "boolean", "value", "or", "the", "defaultValue", "if", "not", "found", "." ]
f537a03d2d25fdfecda7999ec10e1da67dc3b8f3
https://github.com/di2e/Argo/blob/f537a03d2d25fdfecda7999ec10e1da67dc3b8f3/clui/src/main/java/net/dharwin/common/tools/cli/api/CLIContext.java#L182-L195
42,515
di2e/Argo
clui/src/main/java/net/dharwin/common/tools/cli/api/CLIContext.java
CLIContext.getInteger
public int getInteger(String key, int defaultValue) { Object o = getObject(key); if (o == null) { return defaultValue; } int val = defaultValue; try { val = Integer.parseInt(o.toString()); } catch (Exception e) { throw new IllegalArgumentException("Object ["+o+"] associated with key ["+...
java
public int getInteger(String key, int defaultValue) { Object o = getObject(key); if (o == null) { return defaultValue; } int val = defaultValue; try { val = Integer.parseInt(o.toString()); } catch (Exception e) { throw new IllegalArgumentException("Object ["+o+"] associated with key ["+...
[ "public", "int", "getInteger", "(", "String", "key", ",", "int", "defaultValue", ")", "{", "Object", "o", "=", "getObject", "(", "key", ")", ";", "if", "(", "o", "==", "null", ")", "{", "return", "defaultValue", ";", "}", "int", "val", "=", "defaultV...
Get the integer value, or the defaultValue if not found. @param key The key to search for. @param defaultValue the default value @return The value, or defaultValue if not found.
[ "Get", "the", "integer", "value", "or", "the", "defaultValue", "if", "not", "found", "." ]
f537a03d2d25fdfecda7999ec10e1da67dc3b8f3
https://github.com/di2e/Argo/blob/f537a03d2d25fdfecda7999ec10e1da67dc3b8f3/clui/src/main/java/net/dharwin/common/tools/cli/api/CLIContext.java#L212-L225
42,516
mcdiae/kludje
kludje-experimental/src/main/java/uk/kludje/experimental/proxy/InvocationHandlers.java
InvocationHandlers.defaultMethodHandler
public static InvocationHandler defaultMethodHandler() { return (proxy, method, args) -> { if (method.isDefault()) { return MethodHandles.lookup() .in(method.getDeclaringClass()) .unreflectSpecial(method, method.getDeclaringClass()) .bindTo(proxy) .invok...
java
public static InvocationHandler defaultMethodHandler() { return (proxy, method, args) -> { if (method.isDefault()) { return MethodHandles.lookup() .in(method.getDeclaringClass()) .unreflectSpecial(method, method.getDeclaringClass()) .bindTo(proxy) .invok...
[ "public", "static", "InvocationHandler", "defaultMethodHandler", "(", ")", "{", "return", "(", "proxy", ",", "method", ",", "args", ")", "->", "{", "if", "(", "method", ".", "isDefault", "(", ")", ")", "{", "return", "MethodHandles", ".", "lookup", "(", ...
Handler for invoking interface default methods. This handler will throw an exception if the method is not a default method. @return handler for invoking interface default methods @see java.lang.reflect.Method#isDefault()
[ "Handler", "for", "invoking", "interface", "default", "methods", ".", "This", "handler", "will", "throw", "an", "exception", "if", "the", "method", "is", "not", "a", "default", "method", "." ]
9ed80cd183ebf162708d5922d784f79ac3841dfc
https://github.com/mcdiae/kludje/blob/9ed80cd183ebf162708d5922d784f79ac3841dfc/kludje-experimental/src/main/java/uk/kludje/experimental/proxy/InvocationHandlers.java#L51-L63
42,517
mcdiae/kludje
kludje-core/src/main/java/uk/kludje/ArrayMapper.java
ArrayMapper.concat
@SuppressWarnings("unchecked") public <E extends T> T[] concat(T[] oldArray, E newElement) { T[] arr = (T[]) Array.newInstance(type, oldArray.length + 1); System.arraycopy(oldArray, 0, arr, 0, oldArray.length); arr[oldArray.length] = newElement; return arr; }
java
@SuppressWarnings("unchecked") public <E extends T> T[] concat(T[] oldArray, E newElement) { T[] arr = (T[]) Array.newInstance(type, oldArray.length + 1); System.arraycopy(oldArray, 0, arr, 0, oldArray.length); arr[oldArray.length] = newElement; return arr; }
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "public", "<", "E", "extends", "T", ">", "T", "[", "]", "concat", "(", "T", "[", "]", "oldArray", ",", "E", "newElement", ")", "{", "T", "[", "]", "arr", "=", "(", "T", "[", "]", ")", "Array", ...
Returns a new instance with the given element at the end. @param oldArray the old array @param newElement the element to contatenate @param <E> the element type @return a new array
[ "Returns", "a", "new", "instance", "with", "the", "given", "element", "at", "the", "end", "." ]
9ed80cd183ebf162708d5922d784f79ac3841dfc
https://github.com/mcdiae/kludje/blob/9ed80cd183ebf162708d5922d784f79ac3841dfc/kludje-core/src/main/java/uk/kludje/ArrayMapper.java#L59-L65
42,518
stickfigure/batchfb
src/main/java/com/googlecode/batchfb/impl/MapperWrapper.java
MapperWrapper.convert
@Override @SuppressWarnings("unchecked") protected T convert(JsonNode data) { // The (T) cast prevents the commandline javac from choking "no unique maximal instance" return (T)this.mapper.convertValue(data, this.resultType); }
java
@Override @SuppressWarnings("unchecked") protected T convert(JsonNode data) { // The (T) cast prevents the commandline javac from choking "no unique maximal instance" return (T)this.mapper.convertValue(data, this.resultType); }
[ "@", "Override", "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "protected", "T", "convert", "(", "JsonNode", "data", ")", "{", "// The (T) cast prevents the commandline javac from choking \"no unique maximal instance\"", "return", "(", "T", ")", "this", ".", "mapper...
Use Jackson to map from JsonNode to the type
[ "Use", "Jackson", "to", "map", "from", "JsonNode", "to", "the", "type" ]
ceeda78aa6d8397eec032ab1d8997adb7378e9e2
https://github.com/stickfigure/batchfb/blob/ceeda78aa6d8397eec032ab1d8997adb7378e9e2/src/main/java/com/googlecode/batchfb/impl/MapperWrapper.java#L48-L53
42,519
jspringbot/jspringbot
src/main/java/org/jspringbot/spring/SpringRobotLibrary.java
SpringRobotLibrary.runKeyword
@SuppressWarnings("unchecked") public Object runKeyword(String keyword, final Object[] params) { Map attributes = new HashMap(); attributes.put("args", params); try { ApplicationContextHolder.set(context); startJSpringBotKeyword(keyword, attributes); Obj...
java
@SuppressWarnings("unchecked") public Object runKeyword(String keyword, final Object[] params) { Map attributes = new HashMap(); attributes.put("args", params); try { ApplicationContextHolder.set(context); startJSpringBotKeyword(keyword, attributes); Obj...
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "public", "Object", "runKeyword", "(", "String", "keyword", ",", "final", "Object", "[", "]", "params", ")", "{", "Map", "attributes", "=", "new", "HashMap", "(", ")", ";", "attributes", ".", "put", "(", ...
Implements the Robot Framework interface method 'run_keyword' required for dynamic libraries. @param keyword name of keyword to be executed @param params parameters passed by Robot Framework @return result of the keyword execution
[ "Implements", "the", "Robot", "Framework", "interface", "method", "run_keyword", "required", "for", "dynamic", "libraries", "." ]
03285a7013492fb793cb0c38a4625a5f5c5750e0
https://github.com/jspringbot/jspringbot/blob/03285a7013492fb793cb0c38a4625a5f5c5750e0/src/main/java/org/jspringbot/spring/SpringRobotLibrary.java#L108-L139
42,520
stickfigure/batchfb
src/main/java/com/googlecode/batchfb/FacebookBatcher.java
FacebookBatcher.getAppAccessToken
public static String getAppAccessToken(String clientId, String clientSecret) { return getAccessToken(clientId, clientSecret, null, null); }
java
public static String getAppAccessToken(String clientId, String clientSecret) { return getAccessToken(clientId, clientSecret, null, null); }
[ "public", "static", "String", "getAppAccessToken", "(", "String", "clientId", ",", "String", "clientSecret", ")", "{", "return", "getAccessToken", "(", "clientId", ",", "clientSecret", ",", "null", ",", "null", ")", ";", "}" ]
Get the app access token from Facebook. see https://developers.facebook.com/docs/authentication/
[ "Get", "the", "app", "access", "token", "from", "Facebook", "." ]
ceeda78aa6d8397eec032ab1d8997adb7378e9e2
https://github.com/stickfigure/batchfb/blob/ceeda78aa6d8397eec032ab1d8997adb7378e9e2/src/main/java/com/googlecode/batchfb/FacebookBatcher.java#L69-L71
42,521
stickfigure/batchfb
src/main/java/com/googlecode/batchfb/FacebookBatcher.java
FacebookBatcher.execute
@Override public void execute() { if (this.batches.isEmpty()) return; // Reset the collection before making the call to eliminate callback chatter when // the batches call back to the master. List<Batch> old = this.batches; // Reset our batches this.batches = new ArrayList<Batch>(); t...
java
@Override public void execute() { if (this.batches.isEmpty()) return; // Reset the collection before making the call to eliminate callback chatter when // the batches call back to the master. List<Batch> old = this.batches; // Reset our batches this.batches = new ArrayList<Batch>(); t...
[ "@", "Override", "public", "void", "execute", "(", ")", "{", "if", "(", "this", ".", "batches", ".", "isEmpty", "(", ")", ")", "return", ";", "// Reset the collection before making the call to eliminate callback chatter when\r", "// the batches call back to the master.\r", ...
Executes all existing batches and removes them from consideration for further batching.
[ "Executes", "all", "existing", "batches", "and", "removes", "them", "from", "consideration", "for", "further", "batching", "." ]
ceeda78aa6d8397eec032ab1d8997adb7378e9e2
https://github.com/stickfigure/batchfb/blob/ceeda78aa6d8397eec032ab1d8997adb7378e9e2/src/main/java/com/googlecode/batchfb/FacebookBatcher.java#L368-L384
42,522
stickfigure/batchfb
src/main/java/com/googlecode/batchfb/FacebookBatcher.java
FacebookBatcher.getBatchForGraph
private Batch getBatchForGraph() { Batch lastValidBatch = this.batches.isEmpty() ? null : this.batches.get(this.batches.size()-1); if (lastValidBatch != null && lastValidBatch.graphSize() < this.maxBatchSize) return lastValidBatch; else { Batch next = new Batch(this, this.mapper, this.accessToken, ...
java
private Batch getBatchForGraph() { Batch lastValidBatch = this.batches.isEmpty() ? null : this.batches.get(this.batches.size()-1); if (lastValidBatch != null && lastValidBatch.graphSize() < this.maxBatchSize) return lastValidBatch; else { Batch next = new Batch(this, this.mapper, this.accessToken, ...
[ "private", "Batch", "getBatchForGraph", "(", ")", "{", "Batch", "lastValidBatch", "=", "this", ".", "batches", ".", "isEmpty", "(", ")", "?", "null", ":", "this", ".", "batches", ".", "get", "(", "this", ".", "batches", ".", "size", "(", ")", "-", "1...
Get an appropriate Batch for issuing a new graph call. Will construct a new one if all existing batches are full.
[ "Get", "an", "appropriate", "Batch", "for", "issuing", "a", "new", "graph", "call", ".", "Will", "construct", "a", "new", "one", "if", "all", "existing", "batches", "are", "full", "." ]
ceeda78aa6d8397eec032ab1d8997adb7378e9e2
https://github.com/stickfigure/batchfb/blob/ceeda78aa6d8397eec032ab1d8997adb7378e9e2/src/main/java/com/googlecode/batchfb/FacebookBatcher.java#L390-L400
42,523
headius/invokebinder
src/main/java/com/headius/invokebinder/SmartBinder.java
SmartBinder.from
public static SmartBinder from(Signature inbound) { return new SmartBinder(inbound, Binder.from(inbound.type())); }
java
public static SmartBinder from(Signature inbound) { return new SmartBinder(inbound, Binder.from(inbound.type())); }
[ "public", "static", "SmartBinder", "from", "(", "Signature", "inbound", ")", "{", "return", "new", "SmartBinder", "(", "inbound", ",", "Binder", ".", "from", "(", "inbound", ".", "type", "(", ")", ")", ")", ";", "}" ]
Create a new SmartBinder from the given Signature. @param inbound the Signature to start from @return a new SmartBinder
[ "Create", "a", "new", "SmartBinder", "from", "the", "given", "Signature", "." ]
ce6bfeb8e33265480daa7b797989dd915d51238d
https://github.com/headius/invokebinder/blob/ce6bfeb8e33265480daa7b797989dd915d51238d/src/main/java/com/headius/invokebinder/SmartBinder.java#L88-L90
42,524
headius/invokebinder
src/main/java/com/headius/invokebinder/SmartBinder.java
SmartBinder.from
public static SmartBinder from(Class<?> retType, String[] names, Class<?>... types) { return from(Signature.returning(retType).appendArgs(names, types)); }
java
public static SmartBinder from(Class<?> retType, String[] names, Class<?>... types) { return from(Signature.returning(retType).appendArgs(names, types)); }
[ "public", "static", "SmartBinder", "from", "(", "Class", "<", "?", ">", "retType", ",", "String", "[", "]", "names", ",", "Class", "<", "?", ">", "...", "types", ")", "{", "return", "from", "(", "Signature", ".", "returning", "(", "retType", ")", "."...
Create a new SmartBinder from the given types and argument names. @param retType the type of the return value to start with @param names the names of arguments @param types the argument types @return a new SmartBinder
[ "Create", "a", "new", "SmartBinder", "from", "the", "given", "types", "and", "argument", "names", "." ]
ce6bfeb8e33265480daa7b797989dd915d51238d
https://github.com/headius/invokebinder/blob/ce6bfeb8e33265480daa7b797989dd915d51238d/src/main/java/com/headius/invokebinder/SmartBinder.java#L100-L102
42,525
headius/invokebinder
src/main/java/com/headius/invokebinder/SmartBinder.java
SmartBinder.from
public static SmartBinder from(Class<?> retType, String name, Class<?> type) { return from(Signature.returning(retType).appendArg(name, type)); }
java
public static SmartBinder from(Class<?> retType, String name, Class<?> type) { return from(Signature.returning(retType).appendArg(name, type)); }
[ "public", "static", "SmartBinder", "from", "(", "Class", "<", "?", ">", "retType", ",", "String", "name", ",", "Class", "<", "?", ">", "type", ")", "{", "return", "from", "(", "Signature", ".", "returning", "(", "retType", ")", ".", "appendArg", "(", ...
Create a new SmartBinder with from the given types and argument name. @param retType the type of the return value to start with @param name the name of the sole argument @param type the sole argument's type @return a new SmartBinder
[ "Create", "a", "new", "SmartBinder", "with", "from", "the", "given", "types", "and", "argument", "name", "." ]
ce6bfeb8e33265480daa7b797989dd915d51238d
https://github.com/headius/invokebinder/blob/ce6bfeb8e33265480daa7b797989dd915d51238d/src/main/java/com/headius/invokebinder/SmartBinder.java#L112-L114
42,526
headius/invokebinder
src/main/java/com/headius/invokebinder/SmartBinder.java
SmartBinder.from
public static SmartBinder from(Lookup lookup, Signature inbound) { return new SmartBinder(inbound, Binder.from(lookup, inbound.type())); }
java
public static SmartBinder from(Lookup lookup, Signature inbound) { return new SmartBinder(inbound, Binder.from(lookup, inbound.type())); }
[ "public", "static", "SmartBinder", "from", "(", "Lookup", "lookup", ",", "Signature", "inbound", ")", "{", "return", "new", "SmartBinder", "(", "inbound", ",", "Binder", ".", "from", "(", "lookup", ",", "inbound", ".", "type", "(", ")", ")", ")", ";", ...
Create a new SmartBinder from the given Signature, using the given Lookup for any handle lookups. @param lookup the Lookup to use for handle lookups @param inbound the Signature to start from @return a new SmartBinder
[ "Create", "a", "new", "SmartBinder", "from", "the", "given", "Signature", "using", "the", "given", "Lookup", "for", "any", "handle", "lookups", "." ]
ce6bfeb8e33265480daa7b797989dd915d51238d
https://github.com/headius/invokebinder/blob/ce6bfeb8e33265480daa7b797989dd915d51238d/src/main/java/com/headius/invokebinder/SmartBinder.java#L124-L126
42,527
headius/invokebinder
src/main/java/com/headius/invokebinder/SmartBinder.java
SmartBinder.foldVoid
public SmartBinder foldVoid(SmartHandle function) { if (Arrays.equals(signature().argNames(), function.signature().argNames())) { return foldVoid(function.handle()); } else { return foldVoid(signature().asFold(void.class).permuteWith(function).handle()); } }
java
public SmartBinder foldVoid(SmartHandle function) { if (Arrays.equals(signature().argNames(), function.signature().argNames())) { return foldVoid(function.handle()); } else { return foldVoid(signature().asFold(void.class).permuteWith(function).handle()); } }
[ "public", "SmartBinder", "foldVoid", "(", "SmartHandle", "function", ")", "{", "if", "(", "Arrays", ".", "equals", "(", "signature", "(", ")", ".", "argNames", "(", ")", ",", "function", ".", "signature", "(", ")", ".", "argNames", "(", ")", ")", ")", ...
Pass all arguments to the given function and drop any result. @param function a function which will receive all arguments and have its return value inserted into the call chain @return a new SmartBinder with the fold applied
[ "Pass", "all", "arguments", "to", "the", "given", "function", "and", "drop", "any", "result", "." ]
ce6bfeb8e33265480daa7b797989dd915d51238d
https://github.com/headius/invokebinder/blob/ce6bfeb8e33265480daa7b797989dd915d51238d/src/main/java/com/headius/invokebinder/SmartBinder.java#L210-L216
42,528
headius/invokebinder
src/main/java/com/headius/invokebinder/SmartBinder.java
SmartBinder.foldStatic
public SmartBinder foldStatic(String newName, Lookup lookup, Class<?> target, String method) { Binder newBinder = binder.foldStatic(lookup, target, method); return new SmartBinder(this, signature().prependArg(newName, newBinder.type().parameterType(0)), binder); }
java
public SmartBinder foldStatic(String newName, Lookup lookup, Class<?> target, String method) { Binder newBinder = binder.foldStatic(lookup, target, method); return new SmartBinder(this, signature().prependArg(newName, newBinder.type().parameterType(0)), binder); }
[ "public", "SmartBinder", "foldStatic", "(", "String", "newName", ",", "Lookup", "lookup", ",", "Class", "<", "?", ">", "target", ",", "String", "method", ")", "{", "Binder", "newBinder", "=", "binder", ".", "foldStatic", "(", "lookup", ",", "target", ",", ...
Acquire a static folding function from the given target class, using the given name and Lookup. Pass all arguments to that function and insert the resulting value as newName into the argument list. @param newName the name of the new first argument where the fold function's result will be passed @param lookup the Look...
[ "Acquire", "a", "static", "folding", "function", "from", "the", "given", "target", "class", "using", "the", "given", "name", "and", "Lookup", ".", "Pass", "all", "arguments", "to", "that", "function", "and", "insert", "the", "resulting", "value", "as", "newN...
ce6bfeb8e33265480daa7b797989dd915d51238d
https://github.com/headius/invokebinder/blob/ce6bfeb8e33265480daa7b797989dd915d51238d/src/main/java/com/headius/invokebinder/SmartBinder.java#L230-L233
42,529
headius/invokebinder
src/main/java/com/headius/invokebinder/SmartBinder.java
SmartBinder.foldVirtual
public SmartBinder foldVirtual(String newName, Lookup lookup, String method) { Binder newBinder = binder.foldVirtual(lookup, method); return new SmartBinder(this, signature().prependArg(newName, newBinder.type().parameterType(0)), newBinder); }
java
public SmartBinder foldVirtual(String newName, Lookup lookup, String method) { Binder newBinder = binder.foldVirtual(lookup, method); return new SmartBinder(this, signature().prependArg(newName, newBinder.type().parameterType(0)), newBinder); }
[ "public", "SmartBinder", "foldVirtual", "(", "String", "newName", ",", "Lookup", "lookup", ",", "String", "method", ")", "{", "Binder", "newBinder", "=", "binder", ".", "foldVirtual", "(", "lookup", ",", "method", ")", ";", "return", "new", "SmartBinder", "(...
Acquire a virtual folding function from the first argument's class, using the given name and Lookup. Pass all arguments to that function and insert the resulting value as newName into the argument list. @param newName the name of the new first argument where the fold function's result will be passed @param lookup the...
[ "Acquire", "a", "virtual", "folding", "function", "from", "the", "first", "argument", "s", "class", "using", "the", "given", "name", "and", "Lookup", ".", "Pass", "all", "arguments", "to", "that", "function", "and", "insert", "the", "resulting", "value", "as...
ce6bfeb8e33265480daa7b797989dd915d51238d
https://github.com/headius/invokebinder/blob/ce6bfeb8e33265480daa7b797989dd915d51238d/src/main/java/com/headius/invokebinder/SmartBinder.java#L262-L265
42,530
headius/invokebinder
src/main/java/com/headius/invokebinder/SmartBinder.java
SmartBinder.permute
public SmartBinder permute(Signature target) { return new SmartBinder(this, target, binder.permute(signature().to(target))); }
java
public SmartBinder permute(Signature target) { return new SmartBinder(this, target, binder.permute(signature().to(target))); }
[ "public", "SmartBinder", "permute", "(", "Signature", "target", ")", "{", "return", "new", "SmartBinder", "(", "this", ",", "target", ",", "binder", ".", "permute", "(", "signature", "(", ")", ".", "to", "(", "target", ")", ")", ")", ";", "}" ]
Using the argument names and order in the target Signature, permute the arguments in this SmartBinder. Arguments may be duplicated or omitted in the target Signature, but all arguments in the target must be defined in this SmartBinder . @param target the Signature from which to derive a new argument list @return a new...
[ "Using", "the", "argument", "names", "and", "order", "in", "the", "target", "Signature", "permute", "the", "arguments", "in", "this", "SmartBinder", ".", "Arguments", "may", "be", "duplicated", "or", "omitted", "in", "the", "target", "Signature", "but", "all",...
ce6bfeb8e33265480daa7b797989dd915d51238d
https://github.com/headius/invokebinder/blob/ce6bfeb8e33265480daa7b797989dd915d51238d/src/main/java/com/headius/invokebinder/SmartBinder.java#L296-L298
42,531
headius/invokebinder
src/main/java/com/headius/invokebinder/SmartBinder.java
SmartBinder.spread
public SmartBinder spread(String[] spreadNames, Class<?>... spreadTypes) { return new SmartBinder(this, signature().spread(spreadNames, spreadTypes), binder.spread(spreadTypes)); }
java
public SmartBinder spread(String[] spreadNames, Class<?>... spreadTypes) { return new SmartBinder(this, signature().spread(spreadNames, spreadTypes), binder.spread(spreadTypes)); }
[ "public", "SmartBinder", "spread", "(", "String", "[", "]", "spreadNames", ",", "Class", "<", "?", ">", "...", "spreadTypes", ")", "{", "return", "new", "SmartBinder", "(", "this", ",", "signature", "(", ")", ".", "spread", "(", "spreadNames", ",", "spre...
Spread a trailing array into the specified argument types. @param spreadNames the names for the spread out arguments @param spreadTypes the types as which to spread the incoming array @return a new SmartBinder with the spread applied
[ "Spread", "a", "trailing", "array", "into", "the", "specified", "argument", "types", "." ]
ce6bfeb8e33265480daa7b797989dd915d51238d
https://github.com/headius/invokebinder/blob/ce6bfeb8e33265480daa7b797989dd915d51238d/src/main/java/com/headius/invokebinder/SmartBinder.java#L336-L338
42,532
headius/invokebinder
src/main/java/com/headius/invokebinder/SmartBinder.java
SmartBinder.spread
public SmartBinder spread(String baseName, int count) { return new SmartBinder(this, signature().spread(baseName, count), binder.spread(count)); }
java
public SmartBinder spread(String baseName, int count) { return new SmartBinder(this, signature().spread(baseName, count), binder.spread(count)); }
[ "public", "SmartBinder", "spread", "(", "String", "baseName", ",", "int", "count", ")", "{", "return", "new", "SmartBinder", "(", "this", ",", "signature", "(", ")", ".", "spread", "(", "baseName", ",", "count", ")", ",", "binder", ".", "spread", "(", ...
Spread a trailing array into count number of arguments, using the natural component type for the array. Build names for the arguments using the given baseName plus the argument's index. Example: Current binder has a signature of (int, String[])void. We want to spread the strings into five arguments named "str". <code...
[ "Spread", "a", "trailing", "array", "into", "count", "number", "of", "arguments", "using", "the", "natural", "component", "type", "for", "the", "array", ".", "Build", "names", "for", "the", "arguments", "using", "the", "given", "baseName", "plus", "the", "ar...
ce6bfeb8e33265480daa7b797989dd915d51238d
https://github.com/headius/invokebinder/blob/ce6bfeb8e33265480daa7b797989dd915d51238d/src/main/java/com/headius/invokebinder/SmartBinder.java#L358-L360
42,533
headius/invokebinder
src/main/java/com/headius/invokebinder/SmartBinder.java
SmartBinder.insert
public SmartBinder insert(int index, String[] names, Class<?>[] types, Object... values) { return new SmartBinder(this, signature().insertArgs(index, names, types), binder.insert(index, types, values)); }
java
public SmartBinder insert(int index, String[] names, Class<?>[] types, Object... values) { return new SmartBinder(this, signature().insertArgs(index, names, types), binder.insert(index, types, values)); }
[ "public", "SmartBinder", "insert", "(", "int", "index", ",", "String", "[", "]", "names", ",", "Class", "<", "?", ">", "[", "]", "types", ",", "Object", "...", "values", ")", "{", "return", "new", "SmartBinder", "(", "this", ",", "signature", "(", ")...
Insert arguments into the argument list at the given index with the given names and values. @param index the index at which to insert the arguments @param names the names of the new arguments @param types the types of the new arguments @param values the values of the new arguments @return a new SmartBinder with the...
[ "Insert", "arguments", "into", "the", "argument", "list", "at", "the", "given", "index", "with", "the", "given", "names", "and", "values", "." ]
ce6bfeb8e33265480daa7b797989dd915d51238d
https://github.com/headius/invokebinder/blob/ce6bfeb8e33265480daa7b797989dd915d51238d/src/main/java/com/headius/invokebinder/SmartBinder.java#L507-L509
42,534
headius/invokebinder
src/main/java/com/headius/invokebinder/SmartBinder.java
SmartBinder.append
public SmartBinder append(String[] names, Class<?>[] types, Object... values) { return new SmartBinder(this, signature().appendArgs(names, types), binder.append(types, values)); }
java
public SmartBinder append(String[] names, Class<?>[] types, Object... values) { return new SmartBinder(this, signature().appendArgs(names, types), binder.append(types, values)); }
[ "public", "SmartBinder", "append", "(", "String", "[", "]", "names", ",", "Class", "<", "?", ">", "[", "]", "types", ",", "Object", "...", "values", ")", "{", "return", "new", "SmartBinder", "(", "this", ",", "signature", "(", ")", ".", "appendArgs", ...
Append the given arguments to the argument list, assigning them the given names. @param names the names of the new arguments @param types the types to use in the new signature @param values the values of the new arguments @return a new SmartBinder with the append applied
[ "Append", "the", "given", "arguments", "to", "the", "argument", "list", "assigning", "them", "the", "given", "names", "." ]
ce6bfeb8e33265480daa7b797989dd915d51238d
https://github.com/headius/invokebinder/blob/ce6bfeb8e33265480daa7b797989dd915d51238d/src/main/java/com/headius/invokebinder/SmartBinder.java#L641-L643
42,535
headius/invokebinder
src/main/java/com/headius/invokebinder/SmartBinder.java
SmartBinder.prepend
public SmartBinder prepend(String[] names, Class<?>[] types, Object... values) { return new SmartBinder(this, signature().prependArgs(names, types), binder.prepend(types, values)); }
java
public SmartBinder prepend(String[] names, Class<?>[] types, Object... values) { return new SmartBinder(this, signature().prependArgs(names, types), binder.prepend(types, values)); }
[ "public", "SmartBinder", "prepend", "(", "String", "[", "]", "names", ",", "Class", "<", "?", ">", "[", "]", "types", ",", "Object", "...", "values", ")", "{", "return", "new", "SmartBinder", "(", "this", ",", "signature", "(", ")", ".", "prependArgs",...
Prepend the given arguments to the argument list, assigning them the given name. @param names the names of the new arguments @param types the types to use in the new signature @param values the values of the new arguments @return a new SmartBinder with the prepend applied
[ "Prepend", "the", "given", "arguments", "to", "the", "argument", "list", "assigning", "them", "the", "given", "name", "." ]
ce6bfeb8e33265480daa7b797989dd915d51238d
https://github.com/headius/invokebinder/blob/ce6bfeb8e33265480daa7b797989dd915d51238d/src/main/java/com/headius/invokebinder/SmartBinder.java#L775-L777
42,536
headius/invokebinder
src/main/java/com/headius/invokebinder/SmartBinder.java
SmartBinder.drop
public SmartBinder drop(String name) { int index = signature().argOffset(name); return new SmartBinder(this, signature().dropArg(index), binder.drop(index)); }
java
public SmartBinder drop(String name) { int index = signature().argOffset(name); return new SmartBinder(this, signature().dropArg(index), binder.drop(index)); }
[ "public", "SmartBinder", "drop", "(", "String", "name", ")", "{", "int", "index", "=", "signature", "(", ")", ".", "argOffset", "(", "name", ")", ";", "return", "new", "SmartBinder", "(", "this", ",", "signature", "(", ")", ".", "dropArg", "(", "index"...
Drop the argument with the given name. @param name the name of the argument to drop @return a new SmartBinder with the drop applied
[ "Drop", "the", "argument", "with", "the", "given", "name", "." ]
ce6bfeb8e33265480daa7b797989dd915d51238d
https://github.com/headius/invokebinder/blob/ce6bfeb8e33265480daa7b797989dd915d51238d/src/main/java/com/headius/invokebinder/SmartBinder.java#L789-L792
42,537
headius/invokebinder
src/main/java/com/headius/invokebinder/SmartBinder.java
SmartBinder.dropLast
public SmartBinder dropLast(int count) { return new SmartBinder(this, signature().dropLast(count), binder.dropLast(count)); }
java
public SmartBinder dropLast(int count) { return new SmartBinder(this, signature().dropLast(count), binder.dropLast(count)); }
[ "public", "SmartBinder", "dropLast", "(", "int", "count", ")", "{", "return", "new", "SmartBinder", "(", "this", ",", "signature", "(", ")", ".", "dropLast", "(", "count", ")", ",", "binder", ".", "dropLast", "(", "count", ")", ")", ";", "}" ]
Drop the last N arguments. @param count the count of arguments to drop @return a new SmartBinder with the drop applied
[ "Drop", "the", "last", "N", "arguments", "." ]
ce6bfeb8e33265480daa7b797989dd915d51238d
https://github.com/headius/invokebinder/blob/ce6bfeb8e33265480daa7b797989dd915d51238d/src/main/java/com/headius/invokebinder/SmartBinder.java#L809-L811
42,538
headius/invokebinder
src/main/java/com/headius/invokebinder/SmartBinder.java
SmartBinder.dropFirst
public SmartBinder dropFirst(int count) { return new SmartBinder(this, signature().dropFirst(count), binder.dropFirst(count)); }
java
public SmartBinder dropFirst(int count) { return new SmartBinder(this, signature().dropFirst(count), binder.dropFirst(count)); }
[ "public", "SmartBinder", "dropFirst", "(", "int", "count", ")", "{", "return", "new", "SmartBinder", "(", "this", ",", "signature", "(", ")", ".", "dropFirst", "(", "count", ")", ",", "binder", ".", "dropFirst", "(", "count", ")", ")", ";", "}" ]
Drop the first N arguments. @param count the count of arguments to drop @return a new SmartBinder with the drop applied
[ "Drop", "the", "first", "N", "arguments", "." ]
ce6bfeb8e33265480daa7b797989dd915d51238d
https://github.com/headius/invokebinder/blob/ce6bfeb8e33265480daa7b797989dd915d51238d/src/main/java/com/headius/invokebinder/SmartBinder.java#L828-L830
42,539
headius/invokebinder
src/main/java/com/headius/invokebinder/SmartBinder.java
SmartBinder.collect
public SmartBinder collect(String outName, String namePattern) { int index = signature().argOffsets(namePattern); assert index >= 0 : "no arguments matching " + namePattern + " found in signature " + signature(); Signature newSignature = signature().collect(outName, namePattern); retu...
java
public SmartBinder collect(String outName, String namePattern) { int index = signature().argOffsets(namePattern); assert index >= 0 : "no arguments matching " + namePattern + " found in signature " + signature(); Signature newSignature = signature().collect(outName, namePattern); retu...
[ "public", "SmartBinder", "collect", "(", "String", "outName", ",", "String", "namePattern", ")", "{", "int", "index", "=", "signature", "(", ")", ".", "argOffsets", "(", "namePattern", ")", ";", "assert", "index", ">=", "0", ":", "\"no arguments matching \"", ...
Collect arguments matching namePattern into an trailing array argument named outName. The namePattern is a standard regular expression. @param outName the name of the new array argument @param namePattern a pattern with which to match arguments for collecting @return a new SmartBinder with the collect applied
[ "Collect", "arguments", "matching", "namePattern", "into", "an", "trailing", "array", "argument", "named", "outName", "." ]
ce6bfeb8e33265480daa7b797989dd915d51238d
https://github.com/headius/invokebinder/blob/ce6bfeb8e33265480daa7b797989dd915d51238d/src/main/java/com/headius/invokebinder/SmartBinder.java#L846-L854
42,540
headius/invokebinder
src/main/java/com/headius/invokebinder/SmartBinder.java
SmartBinder.cast
public SmartBinder cast(Signature target) { return new SmartBinder(target, binder.cast(target.type())); }
java
public SmartBinder cast(Signature target) { return new SmartBinder(target, binder.cast(target.type())); }
[ "public", "SmartBinder", "cast", "(", "Signature", "target", ")", "{", "return", "new", "SmartBinder", "(", "target", ",", "binder", ".", "cast", "(", "target", ".", "type", "(", ")", ")", ")", ";", "}" ]
Cast the incoming arguments to the types in the given signature. The argument count must match, but the names in the target signature are ignored. @param target the Signature to which arguments should be cast @return a new SmartBinder with the cast applied
[ "Cast", "the", "incoming", "arguments", "to", "the", "types", "in", "the", "given", "signature", ".", "The", "argument", "count", "must", "match", "but", "the", "names", "in", "the", "target", "signature", "are", "ignored", "." ]
ce6bfeb8e33265480daa7b797989dd915d51238d
https://github.com/headius/invokebinder/blob/ce6bfeb8e33265480daa7b797989dd915d51238d/src/main/java/com/headius/invokebinder/SmartBinder.java#L868-L870
42,541
headius/invokebinder
src/main/java/com/headius/invokebinder/SmartBinder.java
SmartBinder.cast
public SmartBinder cast(Class<?> returnType, Class<?>... argTypes) { return new SmartBinder(this, new Signature(returnType, argTypes, signature().argNames()), binder.cast(returnType, argTypes)); }
java
public SmartBinder cast(Class<?> returnType, Class<?>... argTypes) { return new SmartBinder(this, new Signature(returnType, argTypes, signature().argNames()), binder.cast(returnType, argTypes)); }
[ "public", "SmartBinder", "cast", "(", "Class", "<", "?", ">", "returnType", ",", "Class", "<", "?", ">", "...", "argTypes", ")", "{", "return", "new", "SmartBinder", "(", "this", ",", "new", "Signature", "(", "returnType", ",", "argTypes", ",", "signatur...
Cast the incoming arguments to the return and argument types given. The argument count must match. @param returnType the return type for the casted signature @param argTypes the types of the arguments for the casted signature @return a new SmartBinder with the cast applied
[ "Cast", "the", "incoming", "arguments", "to", "the", "return", "and", "argument", "types", "given", ".", "The", "argument", "count", "must", "match", "." ]
ce6bfeb8e33265480daa7b797989dd915d51238d
https://github.com/headius/invokebinder/blob/ce6bfeb8e33265480daa7b797989dd915d51238d/src/main/java/com/headius/invokebinder/SmartBinder.java#L880-L882
42,542
headius/invokebinder
src/main/java/com/headius/invokebinder/SmartBinder.java
SmartBinder.castVirtual
public SmartBinder castVirtual(Class<?> returnType, Class<?> firstArg, Class<?>... restArgs) { return new SmartBinder(this, new Signature(returnType, firstArg, restArgs, signature().argNames()), binder.castVirtual(returnType, firstArg, restArgs)); }
java
public SmartBinder castVirtual(Class<?> returnType, Class<?> firstArg, Class<?>... restArgs) { return new SmartBinder(this, new Signature(returnType, firstArg, restArgs, signature().argNames()), binder.castVirtual(returnType, firstArg, restArgs)); }
[ "public", "SmartBinder", "castVirtual", "(", "Class", "<", "?", ">", "returnType", ",", "Class", "<", "?", ">", "firstArg", ",", "Class", "<", "?", ">", "...", "restArgs", ")", "{", "return", "new", "SmartBinder", "(", "this", ",", "new", "Signature", ...
Cast the incoming arguments to the return, first argument type, and remaining argument types. Provide for convenience when dealing with virtual method argument lists, which frequently omit the target object. @param returnType the return type for the casted signature @param firstArg the type of the first argument for...
[ "Cast", "the", "incoming", "arguments", "to", "the", "return", "first", "argument", "type", "and", "remaining", "argument", "types", ".", "Provide", "for", "convenience", "when", "dealing", "with", "virtual", "method", "argument", "lists", "which", "frequently", ...
ce6bfeb8e33265480daa7b797989dd915d51238d
https://github.com/headius/invokebinder/blob/ce6bfeb8e33265480daa7b797989dd915d51238d/src/main/java/com/headius/invokebinder/SmartBinder.java#L895-L897
42,543
headius/invokebinder
src/main/java/com/headius/invokebinder/SmartBinder.java
SmartBinder.castArg
public SmartBinder castArg(String name, Class<?> type) { Signature newSig = signature().replaceArg(name, name, type); return new SmartBinder(this, newSig, binder.cast(newSig.type())); }
java
public SmartBinder castArg(String name, Class<?> type) { Signature newSig = signature().replaceArg(name, name, type); return new SmartBinder(this, newSig, binder.cast(newSig.type())); }
[ "public", "SmartBinder", "castArg", "(", "String", "name", ",", "Class", "<", "?", ">", "type", ")", "{", "Signature", "newSig", "=", "signature", "(", ")", ".", "replaceArg", "(", "name", ",", "name", ",", "type", ")", ";", "return", "new", "SmartBind...
Cast the named argument to the given type. @param name the name of the argument to cast @param type the type to which that argument will be cast @return a new SmartBinder with the cast applied
[ "Cast", "the", "named", "argument", "to", "the", "given", "type", "." ]
ce6bfeb8e33265480daa7b797989dd915d51238d
https://github.com/headius/invokebinder/blob/ce6bfeb8e33265480daa7b797989dd915d51238d/src/main/java/com/headius/invokebinder/SmartBinder.java#L906-L909
42,544
headius/invokebinder
src/main/java/com/headius/invokebinder/SmartBinder.java
SmartBinder.castReturn
public SmartBinder castReturn(Class<?> type) { return new SmartBinder(this, signature().changeReturn(type), binder.cast(type, binder.type().parameterArray())); }
java
public SmartBinder castReturn(Class<?> type) { return new SmartBinder(this, signature().changeReturn(type), binder.cast(type, binder.type().parameterArray())); }
[ "public", "SmartBinder", "castReturn", "(", "Class", "<", "?", ">", "type", ")", "{", "return", "new", "SmartBinder", "(", "this", ",", "signature", "(", ")", ".", "changeReturn", "(", "type", ")", ",", "binder", ".", "cast", "(", "type", ",", "binder"...
Cast the return value to the given type. Example: Our current signature is (String)String but the method this handle will eventually call returns CharSequence. <code>binder = binder.castReturn(CharSequence.class);</code> Our handle will now successfully find and call the target method and propagate the returned Char...
[ "Cast", "the", "return", "value", "to", "the", "given", "type", "." ]
ce6bfeb8e33265480daa7b797989dd915d51238d
https://github.com/headius/invokebinder/blob/ce6bfeb8e33265480daa7b797989dd915d51238d/src/main/java/com/headius/invokebinder/SmartBinder.java#L925-L927
42,545
headius/invokebinder
src/main/java/com/headius/invokebinder/SmartBinder.java
SmartBinder.invokeVirtual
public SmartHandle invokeVirtual(Lookup lookup, String name) throws NoSuchMethodException, IllegalAccessException { return new SmartHandle(start, binder.invokeVirtual(lookup, name)); }
java
public SmartHandle invokeVirtual(Lookup lookup, String name) throws NoSuchMethodException, IllegalAccessException { return new SmartHandle(start, binder.invokeVirtual(lookup, name)); }
[ "public", "SmartHandle", "invokeVirtual", "(", "Lookup", "lookup", ",", "String", "name", ")", "throws", "NoSuchMethodException", ",", "IllegalAccessException", "{", "return", "new", "SmartHandle", "(", "start", ",", "binder", ".", "invokeVirtual", "(", "lookup", ...
Terminate this binder by looking up the named virtual method on the first argument's type. Perform the actual method lookup using the given Lookup object. @param lookup the Lookup to use for handle lookups @param name the name of the target virtual method @return a SmartHandle with this binder's starting signature, ...
[ "Terminate", "this", "binder", "by", "looking", "up", "the", "named", "virtual", "method", "on", "the", "first", "argument", "s", "type", ".", "Perform", "the", "actual", "method", "lookup", "using", "the", "given", "Lookup", "object", "." ]
ce6bfeb8e33265480daa7b797989dd915d51238d
https://github.com/headius/invokebinder/blob/ce6bfeb8e33265480daa7b797989dd915d51238d/src/main/java/com/headius/invokebinder/SmartBinder.java#L981-L983
42,546
headius/invokebinder
src/main/java/com/headius/invokebinder/SmartBinder.java
SmartBinder.invokeStatic
public SmartHandle invokeStatic(Lookup lookup, Class<?> target, String name) throws NoSuchMethodException, IllegalAccessException { return new SmartHandle(start, binder.invokeStatic(lookup, target, name)); }
java
public SmartHandle invokeStatic(Lookup lookup, Class<?> target, String name) throws NoSuchMethodException, IllegalAccessException { return new SmartHandle(start, binder.invokeStatic(lookup, target, name)); }
[ "public", "SmartHandle", "invokeStatic", "(", "Lookup", "lookup", ",", "Class", "<", "?", ">", "target", ",", "String", "name", ")", "throws", "NoSuchMethodException", ",", "IllegalAccessException", "{", "return", "new", "SmartHandle", "(", "start", ",", "binder...
Terminate this binder by looking up the named static method on the given target type. Perform the actual method lookup using the given Lookup object. @param lookup the Lookup to use for handle lookups @param target the type on which to find the static method @param name the name of the target static method @return a...
[ "Terminate", "this", "binder", "by", "looking", "up", "the", "named", "static", "method", "on", "the", "given", "target", "type", ".", "Perform", "the", "actual", "method", "lookup", "using", "the", "given", "Lookup", "object", "." ]
ce6bfeb8e33265480daa7b797989dd915d51238d
https://github.com/headius/invokebinder/blob/ce6bfeb8e33265480daa7b797989dd915d51238d/src/main/java/com/headius/invokebinder/SmartBinder.java#L1018-L1020
42,547
headius/invokebinder
src/main/java/com/headius/invokebinder/SmartBinder.java
SmartBinder.invoke
public SmartHandle invoke(SmartHandle target) { return new SmartHandle(start, binder.invoke(target.handle())); }
java
public SmartHandle invoke(SmartHandle target) { return new SmartHandle(start, binder.invoke(target.handle())); }
[ "public", "SmartHandle", "invoke", "(", "SmartHandle", "target", ")", "{", "return", "new", "SmartHandle", "(", "start", ",", "binder", ".", "invoke", "(", "target", ".", "handle", "(", ")", ")", ")", ";", "}" ]
Terminate this binder by invoking the given target handle. The signature of this binder is not compared to the signature of the given SmartHandle. @param target the handle to invoke @return a new SmartHandle with this binder's starting signature, bound through to the given handle
[ "Terminate", "this", "binder", "by", "invoking", "the", "given", "target", "handle", ".", "The", "signature", "of", "this", "binder", "is", "not", "compared", "to", "the", "signature", "of", "the", "given", "SmartHandle", "." ]
ce6bfeb8e33265480daa7b797989dd915d51238d
https://github.com/headius/invokebinder/blob/ce6bfeb8e33265480daa7b797989dd915d51238d/src/main/java/com/headius/invokebinder/SmartBinder.java#L1052-L1054
42,548
headius/invokebinder
src/main/java/com/headius/invokebinder/SmartBinder.java
SmartBinder.filter
public SmartBinder filter(String pattern, MethodHandle filter) { String[] argNames = signature().argNames(); Pattern pat = Pattern.compile(pattern); Binder newBinder = binder(); Signature newSig = signature(); for (int i = 0; i < argNames.length; i++) { if (pat.match...
java
public SmartBinder filter(String pattern, MethodHandle filter) { String[] argNames = signature().argNames(); Pattern pat = Pattern.compile(pattern); Binder newBinder = binder(); Signature newSig = signature(); for (int i = 0; i < argNames.length; i++) { if (pat.match...
[ "public", "SmartBinder", "filter", "(", "String", "pattern", ",", "MethodHandle", "filter", ")", "{", "String", "[", "]", "argNames", "=", "signature", "(", ")", ".", "argNames", "(", ")", ";", "Pattern", "pat", "=", "Pattern", ".", "compile", "(", "patt...
Filter the arguments matching the given pattern using the given filter function. @param pattern the regular expression pattern to match arguments @param filter the MethodHandle to use to filter the arguments @return a new SmartBinder with the filter applied
[ "Filter", "the", "arguments", "matching", "the", "given", "pattern", "using", "the", "given", "filter", "function", "." ]
ce6bfeb8e33265480daa7b797989dd915d51238d
https://github.com/headius/invokebinder/blob/ce6bfeb8e33265480daa7b797989dd915d51238d/src/main/java/com/headius/invokebinder/SmartBinder.java#L1153-L1167
42,549
headius/invokebinder
src/main/java/com/headius/invokebinder/Signature.java
Signature.from
public static Signature from(Class<?> retval, Class<?>[] argTypes, String... argNames) { assert argTypes.length == argNames.length; return new Signature(retval, argTypes, argNames); }
java
public static Signature from(Class<?> retval, Class<?>[] argTypes, String... argNames) { assert argTypes.length == argNames.length; return new Signature(retval, argTypes, argNames); }
[ "public", "static", "Signature", "from", "(", "Class", "<", "?", ">", "retval", ",", "Class", "<", "?", ">", "[", "]", "argTypes", ",", "String", "...", "argNames", ")", "{", "assert", "argTypes", ".", "length", "==", "argNames", ".", "length", ";", ...
Create a new signature based on the given return value, argument types, and argument names @param retval the type of the return value @param argTypes the types of the arguments @param argNames the names of the arguments @return a new Signature
[ "Create", "a", "new", "signature", "based", "on", "the", "given", "return", "value", "argument", "types", "and", "argument", "names" ]
ce6bfeb8e33265480daa7b797989dd915d51238d
https://github.com/headius/invokebinder/blob/ce6bfeb8e33265480daa7b797989dd915d51238d/src/main/java/com/headius/invokebinder/Signature.java#L154-L158
42,550
headius/invokebinder
src/main/java/com/headius/invokebinder/Signature.java
Signature.dropArg
public Signature dropArg(String name) { String[] newArgNames = new String[argNames.length - 1]; MethodType newType = methodType; for (int i = 0, j = 0; i < argNames.length; i++) { if (argNames[i].equals(name)) { newType = newType.dropParameterTypes(j, j + 1); ...
java
public Signature dropArg(String name) { String[] newArgNames = new String[argNames.length - 1]; MethodType newType = methodType; for (int i = 0, j = 0; i < argNames.length; i++) { if (argNames[i].equals(name)) { newType = newType.dropParameterTypes(j, j + 1); ...
[ "public", "Signature", "dropArg", "(", "String", "name", ")", "{", "String", "[", "]", "newArgNames", "=", "new", "String", "[", "argNames", ".", "length", "-", "1", "]", ";", "MethodType", "newType", "=", "methodType", ";", "for", "(", "int", "i", "="...
Drops the first argument with the given name. @param name the name of the argument to drop @return a new signature
[ "Drops", "the", "first", "argument", "with", "the", "given", "name", "." ]
ce6bfeb8e33265480daa7b797989dd915d51238d
https://github.com/headius/invokebinder/blob/ce6bfeb8e33265480daa7b797989dd915d51238d/src/main/java/com/headius/invokebinder/Signature.java#L308-L326
42,551
headius/invokebinder
src/main/java/com/headius/invokebinder/Signature.java
Signature.dropArg
public Signature dropArg(int index) { assert index < argNames.length; String[] newArgNames = new String[argNames.length - 1]; if (index > 0) System.arraycopy(argNames, 0, newArgNames, 0, index); if (index < argNames.length - 1) System.arraycopy(argNames, index + 1, newArgNam...
java
public Signature dropArg(int index) { assert index < argNames.length; String[] newArgNames = new String[argNames.length - 1]; if (index > 0) System.arraycopy(argNames, 0, newArgNames, 0, index); if (index < argNames.length - 1) System.arraycopy(argNames, index + 1, newArgNam...
[ "public", "Signature", "dropArg", "(", "int", "index", ")", "{", "assert", "index", "<", "argNames", ".", "length", ";", "String", "[", "]", "newArgNames", "=", "new", "String", "[", "argNames", ".", "length", "-", "1", "]", ";", "if", "(", "index", ...
Drops the argument at the given index. @param index the index of the argument to drop @return a new signature
[ "Drops", "the", "argument", "at", "the", "given", "index", "." ]
ce6bfeb8e33265480daa7b797989dd915d51238d
https://github.com/headius/invokebinder/blob/ce6bfeb8e33265480daa7b797989dd915d51238d/src/main/java/com/headius/invokebinder/Signature.java#L334-L345
42,552
headius/invokebinder
src/main/java/com/headius/invokebinder/Signature.java
Signature.dropLast
public Signature dropLast(int n) { return new Signature( methodType.dropParameterTypes(methodType.parameterCount() - n, methodType.parameterCount()), Arrays.copyOfRange(argNames, 0, argNames.length - n)); }
java
public Signature dropLast(int n) { return new Signature( methodType.dropParameterTypes(methodType.parameterCount() - n, methodType.parameterCount()), Arrays.copyOfRange(argNames, 0, argNames.length - n)); }
[ "public", "Signature", "dropLast", "(", "int", "n", ")", "{", "return", "new", "Signature", "(", "methodType", ".", "dropParameterTypes", "(", "methodType", ".", "parameterCount", "(", ")", "-", "n", ",", "methodType", ".", "parameterCount", "(", ")", ")", ...
Drop the specified number of last arguments from this signature. @param n number of arguments to drop @return a new signature
[ "Drop", "the", "specified", "number", "of", "last", "arguments", "from", "this", "signature", "." ]
ce6bfeb8e33265480daa7b797989dd915d51238d
https://github.com/headius/invokebinder/blob/ce6bfeb8e33265480daa7b797989dd915d51238d/src/main/java/com/headius/invokebinder/Signature.java#L362-L366
42,553
headius/invokebinder
src/main/java/com/headius/invokebinder/Signature.java
Signature.dropFirst
public Signature dropFirst(int n) { return new Signature( methodType.dropParameterTypes(0, n), Arrays.copyOfRange(argNames, n, argNames.length)); }
java
public Signature dropFirst(int n) { return new Signature( methodType.dropParameterTypes(0, n), Arrays.copyOfRange(argNames, n, argNames.length)); }
[ "public", "Signature", "dropFirst", "(", "int", "n", ")", "{", "return", "new", "Signature", "(", "methodType", ".", "dropParameterTypes", "(", "0", ",", "n", ")", ",", "Arrays", ".", "copyOfRange", "(", "argNames", ",", "n", ",", "argNames", ".", "lengt...
Drop the specified number of first arguments from this signature. @param n number of arguments to drop @return a new signature
[ "Drop", "the", "specified", "number", "of", "first", "arguments", "from", "this", "signature", "." ]
ce6bfeb8e33265480daa7b797989dd915d51238d
https://github.com/headius/invokebinder/blob/ce6bfeb8e33265480daa7b797989dd915d51238d/src/main/java/com/headius/invokebinder/Signature.java#L383-L387
42,554
headius/invokebinder
src/main/java/com/headius/invokebinder/Signature.java
Signature.replaceArg
public Signature replaceArg(String oldName, String newName, Class<?> newType) { int offset = argOffset(oldName); String[] newArgNames = argNames; if (!oldName.equals(newName)) { newArgNames = Arrays.copyOf(argNames, argNames.length); newArgNames[offset] = newName; ...
java
public Signature replaceArg(String oldName, String newName, Class<?> newType) { int offset = argOffset(oldName); String[] newArgNames = argNames; if (!oldName.equals(newName)) { newArgNames = Arrays.copyOf(argNames, argNames.length); newArgNames[offset] = newName; ...
[ "public", "Signature", "replaceArg", "(", "String", "oldName", ",", "String", "newName", ",", "Class", "<", "?", ">", "newType", ")", "{", "int", "offset", "=", "argOffset", "(", "oldName", ")", ";", "String", "[", "]", "newArgNames", "=", "argNames", ";...
Replace the named argument with a new name and type. @param oldName the old name of the argument @param newName the new name of the argument; can be the same as old @param newType the new type of the argument; can be the same as old @return a new signature with the modified argument
[ "Replace", "the", "named", "argument", "with", "a", "new", "name", "and", "type", "." ]
ce6bfeb8e33265480daa7b797989dd915d51238d
https://github.com/headius/invokebinder/blob/ce6bfeb8e33265480daa7b797989dd915d51238d/src/main/java/com/headius/invokebinder/Signature.java#L397-L412
42,555
headius/invokebinder
src/main/java/com/headius/invokebinder/Signature.java
Signature.collect
public Signature collect(String newName, String oldPattern) { int start = -1; int newCount = 0; int gatherCount = 0; Class<?> type = null; Pattern pattern = Pattern.compile(oldPattern); MethodType newType = type(); for (int i = 0; i < argNames.length; i++) { ...
java
public Signature collect(String newName, String oldPattern) { int start = -1; int newCount = 0; int gatherCount = 0; Class<?> type = null; Pattern pattern = Pattern.compile(oldPattern); MethodType newType = type(); for (int i = 0; i < argNames.length; i++) { ...
[ "public", "Signature", "collect", "(", "String", "newName", ",", "String", "oldPattern", ")", "{", "int", "start", "=", "-", "1", ";", "int", "newCount", "=", "0", ";", "int", "gatherCount", "=", "0", ";", "Class", "<", "?", ">", "type", "=", "null",...
Collect sequential arguments matching pattern into an array. They must have the same type. @param newName the name of the new array argument @param oldPattern the pattern of arguments to collect @return a new signature with an array argument where the collected arguments were
[ "Collect", "sequential", "arguments", "matching", "pattern", "into", "an", "array", ".", "They", "must", "have", "the", "same", "type", "." ]
ce6bfeb8e33265480daa7b797989dd915d51238d
https://github.com/headius/invokebinder/blob/ce6bfeb8e33265480daa7b797989dd915d51238d/src/main/java/com/headius/invokebinder/Signature.java#L474-L520
42,556
headius/invokebinder
src/main/java/com/headius/invokebinder/Signature.java
Signature.argName
public Signature argName(int index, String name) { String[] argNames = Arrays.copyOf(argNames(), argNames().length); argNames[index] = name; return new Signature(type(), argNames); }
java
public Signature argName(int index, String name) { String[] argNames = Arrays.copyOf(argNames(), argNames().length); argNames[index] = name; return new Signature(type(), argNames); }
[ "public", "Signature", "argName", "(", "int", "index", ",", "String", "name", ")", "{", "String", "[", "]", "argNames", "=", "Arrays", ".", "copyOf", "(", "argNames", "(", ")", ",", "argNames", "(", ")", ".", "length", ")", ";", "argNames", "[", "ind...
Set the argument name at the given index. @param index the index at which to set the argument name @param name the name to set @return a new signature with the given name at the given index
[ "Set", "the", "argument", "name", "at", "the", "given", "index", "." ]
ce6bfeb8e33265480daa7b797989dd915d51238d
https://github.com/headius/invokebinder/blob/ce6bfeb8e33265480daa7b797989dd915d51238d/src/main/java/com/headius/invokebinder/Signature.java#L612-L616
42,557
headius/invokebinder
src/main/java/com/headius/invokebinder/Signature.java
Signature.argType
public Signature argType(int index, Class<?> type) { return new Signature(type().changeParameterType(index, type), argNames()); }
java
public Signature argType(int index, Class<?> type) { return new Signature(type().changeParameterType(index, type), argNames()); }
[ "public", "Signature", "argType", "(", "int", "index", ",", "Class", "<", "?", ">", "type", ")", "{", "return", "new", "Signature", "(", "type", "(", ")", ".", "changeParameterType", "(", "index", ",", "type", ")", ",", "argNames", "(", ")", ")", ";"...
Set the argument type at the given index. @param index the index at which to set the argument type @param type the type to set @return a new signature with the given type at the given index
[ "Set", "the", "argument", "type", "at", "the", "given", "index", "." ]
ce6bfeb8e33265480daa7b797989dd915d51238d
https://github.com/headius/invokebinder/blob/ce6bfeb8e33265480daa7b797989dd915d51238d/src/main/java/com/headius/invokebinder/Signature.java#L653-L655
42,558
headius/invokebinder
src/main/java/com/headius/invokebinder/Signature.java
Signature.permuteWith
public MethodHandle permuteWith(MethodHandle target, String... permuteArgs) { return MethodHandles.permuteArguments(target, methodType, to(permute(permuteArgs))); }
java
public MethodHandle permuteWith(MethodHandle target, String... permuteArgs) { return MethodHandles.permuteArguments(target, methodType, to(permute(permuteArgs))); }
[ "public", "MethodHandle", "permuteWith", "(", "MethodHandle", "target", ",", "String", "...", "permuteArgs", ")", "{", "return", "MethodHandles", ".", "permuteArguments", "(", "target", ",", "methodType", ",", "to", "(", "permute", "(", "permuteArgs", ")", ")", ...
Produce a method handle permuting the arguments in this signature using the given permute arguments and targeting the given java.lang.invoke.MethodHandle. Example: <pre> Signature sig = Signature.returning(String.class).appendArg("a", int.class).appendArg("b", int.class); MethodHandle handle = handleThatTakesOneInt()...
[ "Produce", "a", "method", "handle", "permuting", "the", "arguments", "in", "this", "signature", "using", "the", "given", "permute", "arguments", "and", "targeting", "the", "given", "java", ".", "lang", ".", "invoke", ".", "MethodHandle", "." ]
ce6bfeb8e33265480daa7b797989dd915d51238d
https://github.com/headius/invokebinder/blob/ce6bfeb8e33265480daa7b797989dd915d51238d/src/main/java/com/headius/invokebinder/Signature.java#L730-L732
42,559
headius/invokebinder
src/main/java/com/headius/invokebinder/Signature.java
Signature.permuteWith
public SmartHandle permuteWith(SmartHandle target) { String[] argNames = target.signature().argNames(); return new SmartHandle(this, permuteWith(target.handle(), argNames)); }
java
public SmartHandle permuteWith(SmartHandle target) { String[] argNames = target.signature().argNames(); return new SmartHandle(this, permuteWith(target.handle(), argNames)); }
[ "public", "SmartHandle", "permuteWith", "(", "SmartHandle", "target", ")", "{", "String", "[", "]", "argNames", "=", "target", ".", "signature", "(", ")", ".", "argNames", "(", ")", ";", "return", "new", "SmartHandle", "(", "this", ",", "permuteWith", "(",...
Produce a new SmartHandle by permuting this Signature's arguments to the Signature of a target SmartHandle. The new SmartHandle's signature will match this one, permuting those arguments and invoking the target handle. @param target the SmartHandle to use as a permutation target @return a new SmartHandle that permutes...
[ "Produce", "a", "new", "SmartHandle", "by", "permuting", "this", "Signature", "s", "arguments", "to", "the", "Signature", "of", "a", "target", "SmartHandle", ".", "The", "new", "SmartHandle", "s", "signature", "will", "match", "this", "one", "permuting", "thos...
ce6bfeb8e33265480daa7b797989dd915d51238d
https://github.com/headius/invokebinder/blob/ce6bfeb8e33265480daa7b797989dd915d51238d/src/main/java/com/headius/invokebinder/Signature.java#L744-L747
42,560
mcdiae/kludje
kludje-experimental/src/main/java/uk/kludje/experimental/stream/AltStreams.java
AltStreams.streamUntil
public static <E> Stream<E> streamUntil(Supplier<? extends E> supplier, Predicate<? super E> stop) { Iterator<E> iterator = AltIterators.iterateUntil(supplier, stop); Spliterator<E> spliterator = Spliterators.spliterator(iterator, Long.MAX_VALUE, Spliterator.ORDERED); return StreamSupport.stream(spliterato...
java
public static <E> Stream<E> streamUntil(Supplier<? extends E> supplier, Predicate<? super E> stop) { Iterator<E> iterator = AltIterators.iterateUntil(supplier, stop); Spliterator<E> spliterator = Spliterators.spliterator(iterator, Long.MAX_VALUE, Spliterator.ORDERED); return StreamSupport.stream(spliterato...
[ "public", "static", "<", "E", ">", "Stream", "<", "E", ">", "streamUntil", "(", "Supplier", "<", "?", "extends", "E", ">", "supplier", ",", "Predicate", "<", "?", "super", "E", ">", "stop", ")", "{", "Iterator", "<", "E", ">", "iterator", "=", "Alt...
Consumes data from the supplier until a condition is met. Use this method where a "poison pill" can be supplied to stop processing. @param supplier element source @param stop stops invoking supplier when this returns true @param <E> the element type @return a new stream
[ "Consumes", "data", "from", "the", "supplier", "until", "a", "condition", "is", "met", ".", "Use", "this", "method", "where", "a", "poison", "pill", "can", "be", "supplied", "to", "stop", "processing", "." ]
9ed80cd183ebf162708d5922d784f79ac3841dfc
https://github.com/mcdiae/kludje/blob/9ed80cd183ebf162708d5922d784f79ac3841dfc/kludje-experimental/src/main/java/uk/kludje/experimental/stream/AltStreams.java#L47-L52
42,561
mcdiae/kludje
kludje-experimental/src/main/java/uk/kludje/experimental/array/LinearSearch.java
LinearSearch.find
public static int find(int[] arr, int start, int end, int valueToFind) { assert arr != null; assert end >= 0; assert end <= arr.length; for (int i = start; i < end; i++) { if (arr[i] == valueToFind) { return i; } } return NOT_FOUND; }
java
public static int find(int[] arr, int start, int end, int valueToFind) { assert arr != null; assert end >= 0; assert end <= arr.length; for (int i = start; i < end; i++) { if (arr[i] == valueToFind) { return i; } } return NOT_FOUND; }
[ "public", "static", "int", "find", "(", "int", "[", "]", "arr", ",", "int", "start", ",", "int", "end", ",", "int", "valueToFind", ")", "{", "assert", "arr", "!=", "null", ";", "assert", "end", ">=", "0", ";", "assert", "end", "<=", "arr", ".", "...
Finds a value in an int array. @param arr the target array @param start the inclusive initial value to check @param end the exclusive end value to check @param valueToFind the value to find @return the index1 or NOT_FOUND
[ "Finds", "a", "value", "in", "an", "int", "array", "." ]
9ed80cd183ebf162708d5922d784f79ac3841dfc
https://github.com/mcdiae/kludje/blob/9ed80cd183ebf162708d5922d784f79ac3841dfc/kludje-experimental/src/main/java/uk/kludje/experimental/array/LinearSearch.java#L40-L53
42,562
mcdiae/kludje
kludje-experimental/src/main/java/uk/kludje/experimental/array/LinearSearch.java
LinearSearch.find
public static int find(Object[] arr, int start, int end, Object valueToFind) { assert arr != null; assert end >= 0; assert end <= arr.length; for (int i = start; i < end; i++) { if (Objects.equals(arr[i], valueToFind)) { return i; } } return NOT_FOUND; }
java
public static int find(Object[] arr, int start, int end, Object valueToFind) { assert arr != null; assert end >= 0; assert end <= arr.length; for (int i = start; i < end; i++) { if (Objects.equals(arr[i], valueToFind)) { return i; } } return NOT_FOUND; }
[ "public", "static", "int", "find", "(", "Object", "[", "]", "arr", ",", "int", "start", ",", "int", "end", ",", "Object", "valueToFind", ")", "{", "assert", "arr", "!=", "null", ";", "assert", "end", ">=", "0", ";", "assert", "end", "<=", "arr", "....
Finds a value in an Object array. @param arr the target array @param start the inclusive initial value to check @param end the exclusive end value to check @param valueToFind the value to find @return the index1 or NOT_FOUND
[ "Finds", "a", "value", "in", "an", "Object", "array", "." ]
9ed80cd183ebf162708d5922d784f79ac3841dfc
https://github.com/mcdiae/kludje/blob/9ed80cd183ebf162708d5922d784f79ac3841dfc/kludje-experimental/src/main/java/uk/kludje/experimental/array/LinearSearch.java#L64-L77
42,563
mcdiae/kludje
kludje-experimental/src/main/java/uk/kludje/experimental/fluent/Mutator.java
Mutator.mutate
public static <T> Mutator<T> mutate(T t) { Objects.requireNonNull(t); return new Mutator<>(t); }
java
public static <T> Mutator<T> mutate(T t) { Objects.requireNonNull(t); return new Mutator<>(t); }
[ "public", "static", "<", "T", ">", "Mutator", "<", "T", ">", "mutate", "(", "T", "t", ")", "{", "Objects", ".", "requireNonNull", "(", "t", ")", ";", "return", "new", "Mutator", "<>", "(", "t", ")", ";", "}" ]
Creates a new mutate instance. @param t the non-null type to adapt @param <T> the adapted type @return a new instance
[ "Creates", "a", "new", "mutate", "instance", "." ]
9ed80cd183ebf162708d5922d784f79ac3841dfc
https://github.com/mcdiae/kludje/blob/9ed80cd183ebf162708d5922d784f79ac3841dfc/kludje-experimental/src/main/java/uk/kludje/experimental/fluent/Mutator.java#L48-L51
42,564
stickfigure/batchfb
src/main/java/com/googlecode/batchfb/util/DefaultRequestExecutor.java
DefaultRequestExecutor.executeOnce
private HttpResponse executeOnce(RequestSetup setup) throws IOException { DefaultRequestDefinition req = new DefaultRequestDefinition(); setup.setup(req); HttpResponse response = req.execute(); // This will force the request to complete, causing any timeout exceptions to happen here response.getR...
java
private HttpResponse executeOnce(RequestSetup setup) throws IOException { DefaultRequestDefinition req = new DefaultRequestDefinition(); setup.setup(req); HttpResponse response = req.execute(); // This will force the request to complete, causing any timeout exceptions to happen here response.getR...
[ "private", "HttpResponse", "executeOnce", "(", "RequestSetup", "setup", ")", "throws", "IOException", "{", "DefaultRequestDefinition", "req", "=", "new", "DefaultRequestDefinition", "(", ")", ";", "setup", ".", "setup", "(", "req", ")", ";", "HttpResponse", "respo...
Execute given the specified http method once, throwing any exceptions as they come
[ "Execute", "given", "the", "specified", "http", "method", "once", "throwing", "any", "exceptions", "as", "they", "come" ]
ceeda78aa6d8397eec032ab1d8997adb7378e9e2
https://github.com/stickfigure/batchfb/blob/ceeda78aa6d8397eec032ab1d8997adb7378e9e2/src/main/java/com/googlecode/batchfb/util/DefaultRequestExecutor.java#L126-L136
42,565
headius/invokebinder
src/main/java/com/headius/invokebinder/transform/Transform.java
Transform.buildClassArguments
protected static void buildClassArguments(StringBuilder builder, Class<?>[] types) { boolean second = false; for (Class cls : types) { if (second) builder.append(", "); second = true; buildClassArgument(builder, cls); } }
java
protected static void buildClassArguments(StringBuilder builder, Class<?>[] types) { boolean second = false; for (Class cls : types) { if (second) builder.append(", "); second = true; buildClassArgument(builder, cls); } }
[ "protected", "static", "void", "buildClassArguments", "(", "StringBuilder", "builder", ",", "Class", "<", "?", ">", "[", "]", "types", ")", "{", "boolean", "second", "=", "false", ";", "for", "(", "Class", "cls", ":", "types", ")", "{", "if", "(", "sec...
Build a list of argument type classes suitable for inserting into Java code. This will be an argument list of the form "pkg.Cls1.class, pkg.Cls2[].class, primtype.class, ..." @param builder the builder in which to build the argument list @param types the classes from which to create the argument list
[ "Build", "a", "list", "of", "argument", "type", "classes", "suitable", "for", "inserting", "into", "Java", "code", "." ]
ce6bfeb8e33265480daa7b797989dd915d51238d
https://github.com/headius/invokebinder/blob/ce6bfeb8e33265480daa7b797989dd915d51238d/src/main/java/com/headius/invokebinder/transform/Transform.java#L65-L72
42,566
headius/invokebinder
src/main/java/com/headius/invokebinder/transform/Transform.java
Transform.buildClassArgument
protected static void buildClassArgument(StringBuilder builder, Class cls) { buildClass(builder, cls); builder.append(".class"); }
java
protected static void buildClassArgument(StringBuilder builder, Class cls) { buildClass(builder, cls); builder.append(".class"); }
[ "protected", "static", "void", "buildClassArgument", "(", "StringBuilder", "builder", ",", "Class", "cls", ")", "{", "buildClass", "(", "builder", ",", "cls", ")", ";", "builder", ".", "append", "(", "\".class\"", ")", ";", "}" ]
Build Java code to represent a single .class reference. This will be an argument of the form "pkg.Cls1.class" or "pkg.Cls2[].class" or "primtype.class" @param builder the builder in which to build the argument @param cls the type for the argument
[ "Build", "Java", "code", "to", "represent", "a", "single", ".", "class", "reference", "." ]
ce6bfeb8e33265480daa7b797989dd915d51238d
https://github.com/headius/invokebinder/blob/ce6bfeb8e33265480daa7b797989dd915d51238d/src/main/java/com/headius/invokebinder/transform/Transform.java#L82-L85
42,567
headius/invokebinder
src/main/java/com/headius/invokebinder/transform/Transform.java
Transform.buildClassCast
protected static void buildClassCast(StringBuilder builder, Class cls) { builder.append('('); buildClass(builder, cls); builder.append(')'); }
java
protected static void buildClassCast(StringBuilder builder, Class cls) { builder.append('('); buildClass(builder, cls); builder.append(')'); }
[ "protected", "static", "void", "buildClassCast", "(", "StringBuilder", "builder", ",", "Class", "cls", ")", "{", "builder", ".", "append", "(", "'", "'", ")", ";", "buildClass", "(", "builder", ",", "cls", ")", ";", "builder", ".", "append", "(", "'", ...
Build Java code to represent a cast to the given type. This will be an argument of the form "(pkg.Cls1)" or "(pkg.Cls2[])" or "(primtype)" @param builder the builder in which to build the argument @param cls the type for the argument
[ "Build", "Java", "code", "to", "represent", "a", "cast", "to", "the", "given", "type", "." ]
ce6bfeb8e33265480daa7b797989dd915d51238d
https://github.com/headius/invokebinder/blob/ce6bfeb8e33265480daa7b797989dd915d51238d/src/main/java/com/headius/invokebinder/transform/Transform.java#L95-L99
42,568
headius/invokebinder
src/main/java/com/headius/invokebinder/transform/Transform.java
Transform.buildPrimitiveJava
protected static void buildPrimitiveJava(StringBuilder builder, Object value) { builder.append(value.toString()); if (value.getClass() == Float.class) builder.append('F'); if (value.getClass() == Long.class) builder.append('L'); }
java
protected static void buildPrimitiveJava(StringBuilder builder, Object value) { builder.append(value.toString()); if (value.getClass() == Float.class) builder.append('F'); if (value.getClass() == Long.class) builder.append('L'); }
[ "protected", "static", "void", "buildPrimitiveJava", "(", "StringBuilder", "builder", ",", "Object", "value", ")", "{", "builder", ".", "append", "(", "value", ".", "toString", "(", ")", ")", ";", "if", "(", "value", ".", "getClass", "(", ")", "==", "Flo...
Build Java code to represent a literal primitive. This will append L or F as appropriate for long and float primitives. @param builder the builder in which to generate the code @param value the primitive value to generate from
[ "Build", "Java", "code", "to", "represent", "a", "literal", "primitive", "." ]
ce6bfeb8e33265480daa7b797989dd915d51238d
https://github.com/headius/invokebinder/blob/ce6bfeb8e33265480daa7b797989dd915d51238d/src/main/java/com/headius/invokebinder/transform/Transform.java#L109-L113
42,569
headius/invokebinder
src/main/java/com/headius/invokebinder/transform/Transform.java
Transform.buildClass
private static void buildClass(StringBuilder builder, Class cls) { int arrayDims = 0; Class tmp = cls; while (tmp.isArray()) { arrayDims++; tmp = tmp.getComponentType(); } builder.append(tmp.getName()); if (arrayDims > 0) { for (; array...
java
private static void buildClass(StringBuilder builder, Class cls) { int arrayDims = 0; Class tmp = cls; while (tmp.isArray()) { arrayDims++; tmp = tmp.getComponentType(); } builder.append(tmp.getName()); if (arrayDims > 0) { for (; array...
[ "private", "static", "void", "buildClass", "(", "StringBuilder", "builder", ",", "Class", "cls", ")", "{", "int", "arrayDims", "=", "0", ";", "Class", "tmp", "=", "cls", ";", "while", "(", "tmp", ".", "isArray", "(", ")", ")", "{", "arrayDims", "++", ...
Build Java code to represent a type reference to the given class. This will be of the form "pkg.Cls1" or "pkc.Cls2[]" or "primtype". @param builder the builder in which to build the type reference @param cls the type for the reference
[ "Build", "Java", "code", "to", "represent", "a", "type", "reference", "to", "the", "given", "class", "." ]
ce6bfeb8e33265480daa7b797989dd915d51238d
https://github.com/headius/invokebinder/blob/ce6bfeb8e33265480daa7b797989dd915d51238d/src/main/java/com/headius/invokebinder/transform/Transform.java#L123-L136
42,570
headius/invokebinder
src/main/java/com/headius/invokebinder/transform/Transform.java
Transform.generateMethodType
public static String generateMethodType(MethodType source) { StringBuilder builder = new StringBuilder("MethodType.methodType("); buildClassArgument(builder, source.returnType()); if (source.parameterCount() > 0) { builder.append(", "); buildClassArguments(builder, source...
java
public static String generateMethodType(MethodType source) { StringBuilder builder = new StringBuilder("MethodType.methodType("); buildClassArgument(builder, source.returnType()); if (source.parameterCount() > 0) { builder.append(", "); buildClassArguments(builder, source...
[ "public", "static", "String", "generateMethodType", "(", "MethodType", "source", ")", "{", "StringBuilder", "builder", "=", "new", "StringBuilder", "(", "\"MethodType.methodType(\"", ")", ";", "buildClassArgument", "(", "builder", ",", "source", ".", "returnType", "...
Build Java code appropriate for standing up the given MethodType. @param source the MethodType for which to build Java code @return Java code suitable for building the given MethodType
[ "Build", "Java", "code", "appropriate", "for", "standing", "up", "the", "given", "MethodType", "." ]
ce6bfeb8e33265480daa7b797989dd915d51238d
https://github.com/headius/invokebinder/blob/ce6bfeb8e33265480daa7b797989dd915d51238d/src/main/java/com/headius/invokebinder/transform/Transform.java#L144-L153
42,571
stickfigure/batchfb
src/main/java/com/googlecode/batchfb/util/RequestBuilder.java
RequestBuilder.execute
protected HttpResponse execute(final HttpMethod meth, String postURL) throws IOException { final String url = (meth == HttpMethod.POST) ? postURL : this.toString(); if (log.isLoggable(Level.FINER)) log.finer(meth + "ing: " + url); return RequestExecutor.instance().execute(this.retries, new RequestSetup...
java
protected HttpResponse execute(final HttpMethod meth, String postURL) throws IOException { final String url = (meth == HttpMethod.POST) ? postURL : this.toString(); if (log.isLoggable(Level.FINER)) log.finer(meth + "ing: " + url); return RequestExecutor.instance().execute(this.retries, new RequestSetup...
[ "protected", "HttpResponse", "execute", "(", "final", "HttpMethod", "meth", ",", "String", "postURL", ")", "throws", "IOException", "{", "final", "String", "url", "=", "(", "meth", "==", "HttpMethod", ".", "POST", ")", "?", "postURL", ":", "this", ".", "to...
Execute given the specified http method, retrying up to the allowed number of retries. @postURL is the url to use if this is a POST request; ignored otherwise.
[ "Execute", "given", "the", "specified", "http", "method", "retrying", "up", "to", "the", "allowed", "number", "of", "retries", "." ]
ceeda78aa6d8397eec032ab1d8997adb7378e9e2
https://github.com/stickfigure/batchfb/blob/ceeda78aa6d8397eec032ab1d8997adb7378e9e2/src/main/java/com/googlecode/batchfb/util/RequestBuilder.java#L153-L189
42,572
stickfigure/batchfb
src/main/java/com/googlecode/batchfb/util/RequestBuilder.java
RequestBuilder.createQueryString
protected String createQueryString() { assert !this.hasBinaryAttachments; if (this.params.isEmpty()) return ""; StringBuilder bld = null; for (Map.Entry<String, Object> param: this.params.entrySet()) { if (bld == null) bld = new StringBuilder(); else bld.append('&'); ...
java
protected String createQueryString() { assert !this.hasBinaryAttachments; if (this.params.isEmpty()) return ""; StringBuilder bld = null; for (Map.Entry<String, Object> param: this.params.entrySet()) { if (bld == null) bld = new StringBuilder(); else bld.append('&'); ...
[ "protected", "String", "createQueryString", "(", ")", "{", "assert", "!", "this", ".", "hasBinaryAttachments", ";", "if", "(", "this", ".", "params", ".", "isEmpty", "(", ")", ")", "return", "\"\"", ";", "StringBuilder", "bld", "=", "null", ";", "for", "...
Creates a string representing the current query string, or an empty string if there are no parameters. Will not work if there are binary attachments!
[ "Creates", "a", "string", "representing", "the", "current", "query", "string", "or", "an", "empty", "string", "if", "there", "are", "no", "parameters", ".", "Will", "not", "work", "if", "there", "are", "binary", "attachments!" ]
ceeda78aa6d8397eec032ab1d8997adb7378e9e2
https://github.com/stickfigure/batchfb/blob/ceeda78aa6d8397eec032ab1d8997adb7378e9e2/src/main/java/com/googlecode/batchfb/util/RequestBuilder.java#L195-L215
42,573
stickfigure/batchfb
src/main/java/com/googlecode/batchfb/FacebookCookie.java
FacebookCookie.decode
public static FacebookCookie decode(String cookie, String appSecret) { // Parsing and verifying signature seems to be poorly documented, but here's what I've found: // Look at parseSignedRequest() in https://github.com/facebook/php-sdk/blob/master/src/base_facebook.php // Python version: https://developers....
java
public static FacebookCookie decode(String cookie, String appSecret) { // Parsing and verifying signature seems to be poorly documented, but here's what I've found: // Look at parseSignedRequest() in https://github.com/facebook/php-sdk/blob/master/src/base_facebook.php // Python version: https://developers....
[ "public", "static", "FacebookCookie", "decode", "(", "String", "cookie", ",", "String", "appSecret", ")", "{", "// Parsing and verifying signature seems to be poorly documented, but here's what I've found:\r", "// Look at parseSignedRequest() in https://github.com/facebook/php-sdk/blob/mas...
Decodes and validates the cookie. @param cookie is the fbsr_YOURAPPID cookie from Facebook @param appSecret is your application secret from the Facebook Developer application console @throws IllegalStateException if the cookie does not validate
[ "Decodes", "and", "validates", "the", "cookie", "." ]
ceeda78aa6d8397eec032ab1d8997adb7378e9e2
https://github.com/stickfigure/batchfb/blob/ceeda78aa6d8397eec032ab1d8997adb7378e9e2/src/main/java/com/googlecode/batchfb/FacebookCookie.java#L60-L91
42,574
jspringbot/jspringbot
src/main/java/org/jspringbot/spring/KeywordUtils.java
KeywordUtils.getKeywordMap
public static Map<String, String> getKeywordMap(ApplicationContext context) { Map<String, String> keywordToBeanMap = new HashMap<String, String>(); // Retrieve beans implementing the Keyword interface. String[] beanNames = context.getBeanNamesForType(Keyword.class); for (String beanNam...
java
public static Map<String, String> getKeywordMap(ApplicationContext context) { Map<String, String> keywordToBeanMap = new HashMap<String, String>(); // Retrieve beans implementing the Keyword interface. String[] beanNames = context.getBeanNamesForType(Keyword.class); for (String beanNam...
[ "public", "static", "Map", "<", "String", ",", "String", ">", "getKeywordMap", "(", "ApplicationContext", "context", ")", "{", "Map", "<", "String", ",", "String", ">", "keywordToBeanMap", "=", "new", "HashMap", "<", "String", ",", "String", ">", "(", ")",...
Builds mapping of robot keywords to actual bean names in spring context. @param context Spring application context. @return mapping of robot keywords to bean names
[ "Builds", "mapping", "of", "robot", "keywords", "to", "actual", "bean", "names", "in", "spring", "context", "." ]
03285a7013492fb793cb0c38a4625a5f5c5750e0
https://github.com/jspringbot/jspringbot/blob/03285a7013492fb793cb0c38a4625a5f5c5750e0/src/main/java/org/jspringbot/spring/KeywordUtils.java#L57-L79
42,575
jspringbot/jspringbot
src/main/java/org/jspringbot/spring/KeywordUtils.java
KeywordUtils.getDescription
public static String getDescription(String keyword, ApplicationContext context, Map<String, String> beanMap) { KeywordInfo keywordInfo = getKeywordInfo(keyword, context, beanMap); if(keywordInfo == null) { return ""; } String desc = keywordInfo.description(); if(de...
java
public static String getDescription(String keyword, ApplicationContext context, Map<String, String> beanMap) { KeywordInfo keywordInfo = getKeywordInfo(keyword, context, beanMap); if(keywordInfo == null) { return ""; } String desc = keywordInfo.description(); if(de...
[ "public", "static", "String", "getDescription", "(", "String", "keyword", ",", "ApplicationContext", "context", ",", "Map", "<", "String", ",", "String", ">", "beanMap", ")", "{", "KeywordInfo", "keywordInfo", "=", "getKeywordInfo", "(", "keyword", ",", "context...
Retrieves the given keyword's description. @param keyword keyword name @param context Spring application context @param beanMap keyword name to bean name mapping @return the documentation string of the given keyword, or empty string if unavailable.
[ "Retrieves", "the", "given", "keyword", "s", "description", "." ]
03285a7013492fb793cb0c38a4625a5f5c5750e0
https://github.com/jspringbot/jspringbot/blob/03285a7013492fb793cb0c38a4625a5f5c5750e0/src/main/java/org/jspringbot/spring/KeywordUtils.java#L90-L111
42,576
jspringbot/jspringbot
src/main/java/org/jspringbot/spring/KeywordUtils.java
KeywordUtils.getParameters
public static String[] getParameters(String keyword, ApplicationContext context, Map<String, String> beanMap) { KeywordInfo keywordInfo = getKeywordInfo(keyword, context, beanMap); return keywordInfo == null ? DEFAULT_PARAMS : keywordInfo.parameters(); }
java
public static String[] getParameters(String keyword, ApplicationContext context, Map<String, String> beanMap) { KeywordInfo keywordInfo = getKeywordInfo(keyword, context, beanMap); return keywordInfo == null ? DEFAULT_PARAMS : keywordInfo.parameters(); }
[ "public", "static", "String", "[", "]", "getParameters", "(", "String", "keyword", ",", "ApplicationContext", "context", ",", "Map", "<", "String", ",", "String", ">", "beanMap", ")", "{", "KeywordInfo", "keywordInfo", "=", "getKeywordInfo", "(", "keyword", ",...
Retrieves the given keyword's parameter description. @param keyword keyword name @param context Spring application context @param beanMap keyword name to bean name mapping @return the parameter description string of the given keyword, or {"*args"} if unavailable.
[ "Retrieves", "the", "given", "keyword", "s", "parameter", "description", "." ]
03285a7013492fb793cb0c38a4625a5f5c5750e0
https://github.com/jspringbot/jspringbot/blob/03285a7013492fb793cb0c38a4625a5f5c5750e0/src/main/java/org/jspringbot/spring/KeywordUtils.java#L121-L125
42,577
jspringbot/jspringbot
src/main/java/org/jspringbot/spring/KeywordUtils.java
KeywordUtils.getKeywordInfo
public static KeywordInfo getKeywordInfo(String keyword, ApplicationContext context, Map<String, String> beanMap) { Object bean = context.getBean(beanMap.get(keyword)); return AnnotationUtils.findAnnotation(bean.getClass(), KeywordInfo.class); }
java
public static KeywordInfo getKeywordInfo(String keyword, ApplicationContext context, Map<String, String> beanMap) { Object bean = context.getBean(beanMap.get(keyword)); return AnnotationUtils.findAnnotation(bean.getClass(), KeywordInfo.class); }
[ "public", "static", "KeywordInfo", "getKeywordInfo", "(", "String", "keyword", ",", "ApplicationContext", "context", ",", "Map", "<", "String", ",", "String", ">", "beanMap", ")", "{", "Object", "bean", "=", "context", ".", "getBean", "(", "beanMap", ".", "g...
Retrieves the KeywordInfo of the given keyword. @param keyword keyword name @param context Spring application context @param beanMap keyword name to bean name mapping @return KeywordInfo object or null if unavailable
[ "Retrieves", "the", "KeywordInfo", "of", "the", "given", "keyword", "." ]
03285a7013492fb793cb0c38a4625a5f5c5750e0
https://github.com/jspringbot/jspringbot/blob/03285a7013492fb793cb0c38a4625a5f5c5750e0/src/main/java/org/jspringbot/spring/KeywordUtils.java#L135-L138
42,578
stickfigure/batchfb
src/main/java/com/googlecode/batchfb/impl/MultiqueryRequest.java
MultiqueryRequest.getParams
@Override @JsonIgnore protected Param[] getParams() { Map<String, String> queries = new LinkedHashMap<String, String>(); for (QueryRequest<?> req: this.queryRequests) queries.put(req.getName(), req.getFQL()); String json = JSONUtils.toJSON(queries, this.mapper); return new Param[] { new Param("querie...
java
@Override @JsonIgnore protected Param[] getParams() { Map<String, String> queries = new LinkedHashMap<String, String>(); for (QueryRequest<?> req: this.queryRequests) queries.put(req.getName(), req.getFQL()); String json = JSONUtils.toJSON(queries, this.mapper); return new Param[] { new Param("querie...
[ "@", "Override", "@", "JsonIgnore", "protected", "Param", "[", "]", "getParams", "(", ")", "{", "Map", "<", "String", ",", "String", ">", "queries", "=", "new", "LinkedHashMap", "<", "String", ",", "String", ">", "(", ")", ";", "for", "(", "QueryReques...
Generate the parameters approprate to a multiquery from the registered queries
[ "Generate", "the", "parameters", "approprate", "to", "a", "multiquery", "from", "the", "registered", "queries" ]
ceeda78aa6d8397eec032ab1d8997adb7378e9e2
https://github.com/stickfigure/batchfb/blob/ceeda78aa6d8397eec032ab1d8997adb7378e9e2/src/main/java/com/googlecode/batchfb/impl/MultiqueryRequest.java#L38-L48
42,579
stickfigure/batchfb
src/main/java/com/googlecode/batchfb/GraphRequestBase.java
GraphRequestBase.getRelativeURL
@JsonProperty("relative_url") public String getRelativeURL() { StringBuilder bld = new StringBuilder(); bld.append(this.object); Param[] params = this.getParams(); if (params != null && params.length > 0) { bld.append('?'); boolean afterFirst = false; for (Param param: params) { if (afte...
java
@JsonProperty("relative_url") public String getRelativeURL() { StringBuilder bld = new StringBuilder(); bld.append(this.object); Param[] params = this.getParams(); if (params != null && params.length > 0) { bld.append('?'); boolean afterFirst = false; for (Param param: params) { if (afte...
[ "@", "JsonProperty", "(", "\"relative_url\"", ")", "public", "String", "getRelativeURL", "(", ")", "{", "StringBuilder", "bld", "=", "new", "StringBuilder", "(", ")", ";", "bld", ".", "append", "(", "this", ".", "object", ")", ";", "Param", "[", "]", "pa...
What Facebook uses to define the url in a batch
[ "What", "Facebook", "uses", "to", "define", "the", "url", "in", "a", "batch" ]
ceeda78aa6d8397eec032ab1d8997adb7378e9e2
https://github.com/stickfigure/batchfb/blob/ceeda78aa6d8397eec032ab1d8997adb7378e9e2/src/main/java/com/googlecode/batchfb/GraphRequestBase.java#L57-L87
42,580
headius/invokebinder
src/main/java/com/headius/invokebinder/SmartHandle.java
SmartHandle.findStaticQuiet
public static SmartHandle findStaticQuiet(Lookup lookup, Class<?> target, String name, Signature signature) { try { return new SmartHandle(signature, lookup.findStatic(target, name, signature.type())); } catch (NoSuchMethodException | IllegalAccessException e) { throw new Runtime...
java
public static SmartHandle findStaticQuiet(Lookup lookup, Class<?> target, String name, Signature signature) { try { return new SmartHandle(signature, lookup.findStatic(target, name, signature.type())); } catch (NoSuchMethodException | IllegalAccessException e) { throw new Runtime...
[ "public", "static", "SmartHandle", "findStaticQuiet", "(", "Lookup", "lookup", ",", "Class", "<", "?", ">", "target", ",", "String", "name", ",", "Signature", "signature", ")", "{", "try", "{", "return", "new", "SmartHandle", "(", "signature", ",", "lookup",...
Create a new SmartHandle by performing a lookup on the given target class for the given method name with the given signature. @param lookup the MethodHandles.Lookup object to use @param target the class where the method is located @param name the name of the method @param signature the signature of the meth...
[ "Create", "a", "new", "SmartHandle", "by", "performing", "a", "lookup", "on", "the", "given", "target", "class", "for", "the", "given", "method", "name", "with", "the", "given", "signature", "." ]
ce6bfeb8e33265480daa7b797989dd915d51238d
https://github.com/headius/invokebinder/blob/ce6bfeb8e33265480daa7b797989dd915d51238d/src/main/java/com/headius/invokebinder/SmartHandle.java#L103-L109
42,581
headius/invokebinder
src/main/java/com/headius/invokebinder/SmartHandle.java
SmartHandle.drop
public SmartHandle drop(String beforeName, String newName, Class<?> type) { return new SmartHandle(signature.insertArg(beforeName, newName, type), MethodHandles.dropArguments(handle, signature.argOffset(beforeName), type)); }
java
public SmartHandle drop(String beforeName, String newName, Class<?> type) { return new SmartHandle(signature.insertArg(beforeName, newName, type), MethodHandles.dropArguments(handle, signature.argOffset(beforeName), type)); }
[ "public", "SmartHandle", "drop", "(", "String", "beforeName", ",", "String", "newName", ",", "Class", "<", "?", ">", "type", ")", "{", "return", "new", "SmartHandle", "(", "signature", ".", "insertArg", "(", "beforeName", ",", "newName", ",", "type", ")", ...
Drop an argument name and type from the handle at the given index, returning a new SmartHandle. @param beforeName name before which the dropped argument goes @param newName name of the argument @param type type of the argument @return a new SmartHandle with the additional argument
[ "Drop", "an", "argument", "name", "and", "type", "from", "the", "handle", "at", "the", "given", "index", "returning", "a", "new", "SmartHandle", "." ]
ce6bfeb8e33265480daa7b797989dd915d51238d
https://github.com/headius/invokebinder/blob/ce6bfeb8e33265480daa7b797989dd915d51238d/src/main/java/com/headius/invokebinder/SmartHandle.java#L179-L181
42,582
headius/invokebinder
src/main/java/com/headius/invokebinder/SmartHandle.java
SmartHandle.drop
public SmartHandle drop(int index, String newName, Class<?> type) { return new SmartHandle(signature.insertArg(index, newName, type), MethodHandles.dropArguments(handle, index, type)); }
java
public SmartHandle drop(int index, String newName, Class<?> type) { return new SmartHandle(signature.insertArg(index, newName, type), MethodHandles.dropArguments(handle, index, type)); }
[ "public", "SmartHandle", "drop", "(", "int", "index", ",", "String", "newName", ",", "Class", "<", "?", ">", "type", ")", "{", "return", "new", "SmartHandle", "(", "signature", ".", "insertArg", "(", "index", ",", "newName", ",", "type", ")", ",", "Met...
Drop an argument from the handle at the given index, returning a new SmartHandle. @param index index before which the dropped argument goes @param newName name of the argument @param type type of the argument @return a new SmartHandle with the additional argument
[ "Drop", "an", "argument", "from", "the", "handle", "at", "the", "given", "index", "returning", "a", "new", "SmartHandle", "." ]
ce6bfeb8e33265480daa7b797989dd915d51238d
https://github.com/headius/invokebinder/blob/ce6bfeb8e33265480daa7b797989dd915d51238d/src/main/java/com/headius/invokebinder/SmartHandle.java#L192-L194
42,583
headius/invokebinder
src/main/java/com/headius/invokebinder/SmartHandle.java
SmartHandle.dropLast
public SmartHandle dropLast(String newName, Class<?> type) { return new SmartHandle(signature.appendArg(newName, type), MethodHandles.dropArguments(handle, signature.argOffset(newName), type)); }
java
public SmartHandle dropLast(String newName, Class<?> type) { return new SmartHandle(signature.appendArg(newName, type), MethodHandles.dropArguments(handle, signature.argOffset(newName), type)); }
[ "public", "SmartHandle", "dropLast", "(", "String", "newName", ",", "Class", "<", "?", ">", "type", ")", "{", "return", "new", "SmartHandle", "(", "signature", ".", "appendArg", "(", "newName", ",", "type", ")", ",", "MethodHandles", ".", "dropArguments", ...
Drop an argument from the handle at the end, returning a new SmartHandle. @param newName name of the argument @param type type of the argument @return a new SmartHandle with the additional argument
[ "Drop", "an", "argument", "from", "the", "handle", "at", "the", "end", "returning", "a", "new", "SmartHandle", "." ]
ce6bfeb8e33265480daa7b797989dd915d51238d
https://github.com/headius/invokebinder/blob/ce6bfeb8e33265480daa7b797989dd915d51238d/src/main/java/com/headius/invokebinder/SmartHandle.java#L204-L206
42,584
headius/invokebinder
src/main/java/com/headius/invokebinder/SmartHandle.java
SmartHandle.bindTo
public SmartHandle bindTo(Object obj) { return new SmartHandle(signature.dropFirst(), handle.bindTo(obj)); }
java
public SmartHandle bindTo(Object obj) { return new SmartHandle(signature.dropFirst(), handle.bindTo(obj)); }
[ "public", "SmartHandle", "bindTo", "(", "Object", "obj", ")", "{", "return", "new", "SmartHandle", "(", "signature", ".", "dropFirst", "(", ")", ",", "handle", ".", "bindTo", "(", "obj", ")", ")", ";", "}" ]
Bind the first argument of this SmartHandle to the given object, returning a new adapted handle. @param obj the object to which to bind this handle's first argument @return a new SmartHandle with the first argument dropped in favor of obj
[ "Bind", "the", "first", "argument", "of", "this", "SmartHandle", "to", "the", "given", "object", "returning", "a", "new", "adapted", "handle", "." ]
ce6bfeb8e33265480daa7b797989dd915d51238d
https://github.com/headius/invokebinder/blob/ce6bfeb8e33265480daa7b797989dd915d51238d/src/main/java/com/headius/invokebinder/SmartHandle.java#L237-L239
42,585
headius/invokebinder
src/main/java/com/headius/invokebinder/SmartHandle.java
SmartHandle.returnValue
public SmartHandle returnValue(Class<?> type, Object value) { return new SmartHandle(signature.changeReturn(type), MethodHandles.filterReturnValue(handle, MethodHandles.constant(type, value))); }
java
public SmartHandle returnValue(Class<?> type, Object value) { return new SmartHandle(signature.changeReturn(type), MethodHandles.filterReturnValue(handle, MethodHandles.constant(type, value))); }
[ "public", "SmartHandle", "returnValue", "(", "Class", "<", "?", ">", "type", ",", "Object", "value", ")", "{", "return", "new", "SmartHandle", "(", "signature", ".", "changeReturn", "(", "type", ")", ",", "MethodHandles", ".", "filterReturnValue", "(", "hand...
Replace the return value with the given value, performing no other processing of the original value. @param type the type for the new return value @param value the new value to return @return a new SmartHandle that returns the given value
[ "Replace", "the", "return", "value", "with", "the", "given", "value", "performing", "no", "other", "processing", "of", "the", "original", "value", "." ]
ce6bfeb8e33265480daa7b797989dd915d51238d
https://github.com/headius/invokebinder/blob/ce6bfeb8e33265480daa7b797989dd915d51238d/src/main/java/com/headius/invokebinder/SmartHandle.java#L323-L325
42,586
stickfigure/batchfb
src/main/java/com/googlecode/batchfb/util/JSONUtils.java
JSONUtils.toJSON
public static String toJSON(Object value, ObjectMapper mapper) { try { return mapper.writeValueAsString(value); } catch (IOException ex) { throw new FacebookException(ex); } }
java
public static String toJSON(Object value, ObjectMapper mapper) { try { return mapper.writeValueAsString(value); } catch (IOException ex) { throw new FacebookException(ex); } }
[ "public", "static", "String", "toJSON", "(", "Object", "value", ",", "ObjectMapper", "mapper", ")", "{", "try", "{", "return", "mapper", ".", "writeValueAsString", "(", "value", ")", ";", "}", "catch", "(", "IOException", "ex", ")", "{", "throw", "new", ...
Converts the object to a JSON string using the mapper
[ "Converts", "the", "object", "to", "a", "JSON", "string", "using", "the", "mapper" ]
ceeda78aa6d8397eec032ab1d8997adb7378e9e2
https://github.com/stickfigure/batchfb/blob/ceeda78aa6d8397eec032ab1d8997adb7378e9e2/src/main/java/com/googlecode/batchfb/util/JSONUtils.java#L41-L47
42,587
stickfigure/batchfb
src/main/java/com/googlecode/batchfb/util/JSONUtils.java
JSONUtils.toNode
public static JsonNode toNode(String value, ObjectMapper mapper) { try { return mapper.readTree(value); } catch (IOException ex) { throw new FacebookException(ex); } }
java
public static JsonNode toNode(String value, ObjectMapper mapper) { try { return mapper.readTree(value); } catch (IOException ex) { throw new FacebookException(ex); } }
[ "public", "static", "JsonNode", "toNode", "(", "String", "value", ",", "ObjectMapper", "mapper", ")", "{", "try", "{", "return", "mapper", ".", "readTree", "(", "value", ")", ";", "}", "catch", "(", "IOException", "ex", ")", "{", "throw", "new", "Faceboo...
Parses a string into a JsonNode using the mapper
[ "Parses", "a", "string", "into", "a", "JsonNode", "using", "the", "mapper" ]
ceeda78aa6d8397eec032ab1d8997adb7378e9e2
https://github.com/stickfigure/batchfb/blob/ceeda78aa6d8397eec032ab1d8997adb7378e9e2/src/main/java/com/googlecode/batchfb/util/JSONUtils.java#L52-L58
42,588
stickfigure/batchfb
src/main/java/com/googlecode/batchfb/util/StringUtils.java
StringUtils.stringifyValue
public static String stringifyValue(Param param, ObjectMapper mapper) { assert !(param instanceof BinaryParam); if (param.value instanceof String) return (String)param.value; if (param.value instanceof Date) return Long.toString(((Date)param.value).getTime() / 1000); else if (param.value instanc...
java
public static String stringifyValue(Param param, ObjectMapper mapper) { assert !(param instanceof BinaryParam); if (param.value instanceof String) return (String)param.value; if (param.value instanceof Date) return Long.toString(((Date)param.value).getTime() / 1000); else if (param.value instanc...
[ "public", "static", "String", "stringifyValue", "(", "Param", "param", ",", "ObjectMapper", "mapper", ")", "{", "assert", "!", "(", "param", "instanceof", "BinaryParam", ")", ";", "if", "(", "param", ".", "value", "instanceof", "String", ")", "return", "(", ...
Stringify the parameter value in an appropriate way. Note that Facebook fucks up dates by using unix time-since-epoch some places and ISO-8601 others. However, maybe unix times always work as parameters?
[ "Stringify", "the", "parameter", "value", "in", "an", "appropriate", "way", ".", "Note", "that", "Facebook", "fucks", "up", "dates", "by", "using", "unix", "time", "-", "since", "-", "epoch", "some", "places", "and", "ISO", "-", "8601", "others", ".", "H...
ceeda78aa6d8397eec032ab1d8997adb7378e9e2
https://github.com/stickfigure/batchfb/blob/ceeda78aa6d8397eec032ab1d8997adb7378e9e2/src/main/java/com/googlecode/batchfb/util/StringUtils.java#L70-L81
42,589
stickfigure/batchfb
src/main/java/com/googlecode/batchfb/util/StringUtils.java
StringUtils.read
public static String read(InputStream input) { try { StringBuilder bld = new StringBuilder(); Reader reader = new InputStreamReader(input, "utf-8"); int ch; while ((ch = reader.read()) >= 0) bld.append((char)ch); return bld.toString(); } catch (IOException ex) { throw new Runtime...
java
public static String read(InputStream input) { try { StringBuilder bld = new StringBuilder(); Reader reader = new InputStreamReader(input, "utf-8"); int ch; while ((ch = reader.read()) >= 0) bld.append((char)ch); return bld.toString(); } catch (IOException ex) { throw new Runtime...
[ "public", "static", "String", "read", "(", "InputStream", "input", ")", "{", "try", "{", "StringBuilder", "bld", "=", "new", "StringBuilder", "(", ")", ";", "Reader", "reader", "=", "new", "InputStreamReader", "(", "input", ",", "\"utf-8\"", ")", ";", "int...
Reads an input stream into a String, encoding with UTF-8
[ "Reads", "an", "input", "stream", "into", "a", "String", "encoding", "with", "UTF", "-", "8" ]
ceeda78aa6d8397eec032ab1d8997adb7378e9e2
https://github.com/stickfigure/batchfb/blob/ceeda78aa6d8397eec032ab1d8997adb7378e9e2/src/main/java/com/googlecode/batchfb/util/StringUtils.java#L86-L98
42,590
headius/invokebinder
src/main/java/com/headius/invokebinder/Binder.java
Binder.from
public static Binder from(MethodHandles.Lookup lookup, Binder start) { return new Binder(lookup, start); }
java
public static Binder from(MethodHandles.Lookup lookup, Binder start) { return new Binder(lookup, start); }
[ "public", "static", "Binder", "from", "(", "MethodHandles", ".", "Lookup", "lookup", ",", "Binder", "start", ")", "{", "return", "new", "Binder", "(", "lookup", ",", "start", ")", ";", "}" ]
Construct a new Binder, starting from a given invokebinder. @param lookup the Lookup context to use for direct handles @param start the starting invokebinder; the new one will start with the current endpoint type of the given invokebinder @return the Binder object
[ "Construct", "a", "new", "Binder", "starting", "from", "a", "given", "invokebinder", "." ]
ce6bfeb8e33265480daa7b797989dd915d51238d
https://github.com/headius/invokebinder/blob/ce6bfeb8e33265480daa7b797989dd915d51238d/src/main/java/com/headius/invokebinder/Binder.java#L264-L266
42,591
headius/invokebinder
src/main/java/com/headius/invokebinder/Binder.java
Binder.to
public Binder to(Binder other) { assert type().equals(other.start); Binder newBinder = new Binder(this); for (ListIterator<Transform> iter = other.transforms.listIterator(other.transforms.size()); iter.hasPrevious(); ) { Transform t = iter.previous(); newBinder.add(t); ...
java
public Binder to(Binder other) { assert type().equals(other.start); Binder newBinder = new Binder(this); for (ListIterator<Transform> iter = other.transforms.listIterator(other.transforms.size()); iter.hasPrevious(); ) { Transform t = iter.previous(); newBinder.add(t); ...
[ "public", "Binder", "to", "(", "Binder", "other", ")", "{", "assert", "type", "(", ")", ".", "equals", "(", "other", ".", "start", ")", ";", "Binder", "newBinder", "=", "new", "Binder", "(", "this", ")", ";", "for", "(", "ListIterator", "<", "Transfo...
Join this binder to an existing one by applying its transformations after this one. @param other the Binder containing the set of transformations to append @return a new Binder combining this Binder with the target Binder
[ "Join", "this", "binder", "to", "an", "existing", "one", "by", "applying", "its", "transformations", "after", "this", "one", "." ]
ce6bfeb8e33265480daa7b797989dd915d51238d
https://github.com/headius/invokebinder/blob/ce6bfeb8e33265480daa7b797989dd915d51238d/src/main/java/com/headius/invokebinder/Binder.java#L275-L286
42,592
headius/invokebinder
src/main/java/com/headius/invokebinder/Binder.java
Binder.add
private void add(Transform transform, MethodType target) { types.add(0, target); transforms.add(0, transform); }
java
private void add(Transform transform, MethodType target) { types.add(0, target); transforms.add(0, transform); }
[ "private", "void", "add", "(", "Transform", "transform", ",", "MethodType", "target", ")", "{", "types", ".", "add", "(", "0", ",", "target", ")", ";", "transforms", ".", "add", "(", "0", ",", "transform", ")", ";", "}" ]
Add a Transform with an associated MethodType target to the chain. @param transform @param target
[ "Add", "a", "Transform", "with", "an", "associated", "MethodType", "target", "to", "the", "chain", "." ]
ce6bfeb8e33265480daa7b797989dd915d51238d
https://github.com/headius/invokebinder/blob/ce6bfeb8e33265480daa7b797989dd915d51238d/src/main/java/com/headius/invokebinder/Binder.java#L314-L317
42,593
headius/invokebinder
src/main/java/com/headius/invokebinder/Binder.java
Binder.insert
public Binder insert(int index, Class<?> type, Object value) { return new Binder(this, new Insert(index, new Class[]{type}, value)); }
java
public Binder insert(int index, Class<?> type, Object value) { return new Binder(this, new Insert(index, new Class[]{type}, value)); }
[ "public", "Binder", "insert", "(", "int", "index", ",", "Class", "<", "?", ">", "type", ",", "Object", "value", ")", "{", "return", "new", "Binder", "(", "this", ",", "new", "Insert", "(", "index", ",", "new", "Class", "[", "]", "{", "type", "}", ...
Insert at the given index the given argument value. @param index the index at which to insert the argument value @param type the actual type to use, rather than getClass @param value the value to insert @return a new Binder
[ "Insert", "at", "the", "given", "index", "the", "given", "argument", "value", "." ]
ce6bfeb8e33265480daa7b797989dd915d51238d
https://github.com/headius/invokebinder/blob/ce6bfeb8e33265480daa7b797989dd915d51238d/src/main/java/com/headius/invokebinder/Binder.java#L465-L467
42,594
headius/invokebinder
src/main/java/com/headius/invokebinder/Binder.java
Binder.append
public Binder append(Class<?> type, Object value) { return new Binder(this, new Insert(type().parameterCount(), new Class[]{type}, value)); }
java
public Binder append(Class<?> type, Object value) { return new Binder(this, new Insert(type().parameterCount(), new Class[]{type}, value)); }
[ "public", "Binder", "append", "(", "Class", "<", "?", ">", "type", ",", "Object", "value", ")", "{", "return", "new", "Binder", "(", "this", ",", "new", "Insert", "(", "type", "(", ")", ".", "parameterCount", "(", ")", ",", "new", "Class", "[", "]"...
Append to the argument list the given argument value with the specified type. @param type the actual type to use, rather than getClass @param value the value to append @return a new Binder
[ "Append", "to", "the", "argument", "list", "the", "given", "argument", "value", "with", "the", "specified", "type", "." ]
ce6bfeb8e33265480daa7b797989dd915d51238d
https://github.com/headius/invokebinder/blob/ce6bfeb8e33265480daa7b797989dd915d51238d/src/main/java/com/headius/invokebinder/Binder.java#L668-L670
42,595
headius/invokebinder
src/main/java/com/headius/invokebinder/Binder.java
Binder.append
public Binder append(Class<?>[] types, Object... values) { return new Binder(this, new Insert(type().parameterCount(), types, values)); }
java
public Binder append(Class<?>[] types, Object... values) { return new Binder(this, new Insert(type().parameterCount(), types, values)); }
[ "public", "Binder", "append", "(", "Class", "<", "?", ">", "[", "]", "types", ",", "Object", "...", "values", ")", "{", "return", "new", "Binder", "(", "this", ",", "new", "Insert", "(", "type", "(", ")", ".", "parameterCount", "(", ")", ",", "type...
Append to the argument list the given argument values with the specified types. @param types the actual types to use, rather than getClass @param values the value(s) to append @return a new Binder
[ "Append", "to", "the", "argument", "list", "the", "given", "argument", "values", "with", "the", "specified", "types", "." ]
ce6bfeb8e33265480daa7b797989dd915d51238d
https://github.com/headius/invokebinder/blob/ce6bfeb8e33265480daa7b797989dd915d51238d/src/main/java/com/headius/invokebinder/Binder.java#L679-L681
42,596
headius/invokebinder
src/main/java/com/headius/invokebinder/Binder.java
Binder.prepend
public Binder prepend(Class<?> type, Object value) { return new Binder(this, new Insert(0, new Class[]{type}, value)); }
java
public Binder prepend(Class<?> type, Object value) { return new Binder(this, new Insert(0, new Class[]{type}, value)); }
[ "public", "Binder", "prepend", "(", "Class", "<", "?", ">", "type", ",", "Object", "value", ")", "{", "return", "new", "Binder", "(", "this", ",", "new", "Insert", "(", "0", ",", "new", "Class", "[", "]", "{", "type", "}", ",", "value", ")", ")",...
Prepend to the argument list the given argument value with the specified type @param type the actual type to use, rather than getClass @param value the value(s) to prepend @return a new Binder
[ "Prepend", "to", "the", "argument", "list", "the", "given", "argument", "value", "with", "the", "specified", "type" ]
ce6bfeb8e33265480daa7b797989dd915d51238d
https://github.com/headius/invokebinder/blob/ce6bfeb8e33265480daa7b797989dd915d51238d/src/main/java/com/headius/invokebinder/Binder.java#L690-L692
42,597
headius/invokebinder
src/main/java/com/headius/invokebinder/Binder.java
Binder.prepend
public Binder prepend(Class<?>[] types, Object... values) { return new Binder(this, new Insert(0, types, values)); }
java
public Binder prepend(Class<?>[] types, Object... values) { return new Binder(this, new Insert(0, types, values)); }
[ "public", "Binder", "prepend", "(", "Class", "<", "?", ">", "[", "]", "types", ",", "Object", "...", "values", ")", "{", "return", "new", "Binder", "(", "this", ",", "new", "Insert", "(", "0", ",", "types", ",", "values", ")", ")", ";", "}" ]
Prepend to the argument list the given argument values with the specified types. @param types the actual types to use, rather than getClass @param values the value(s) to prepend @return a new Binder
[ "Prepend", "to", "the", "argument", "list", "the", "given", "argument", "values", "with", "the", "specified", "types", "." ]
ce6bfeb8e33265480daa7b797989dd915d51238d
https://github.com/headius/invokebinder/blob/ce6bfeb8e33265480daa7b797989dd915d51238d/src/main/java/com/headius/invokebinder/Binder.java#L701-L703
42,598
headius/invokebinder
src/main/java/com/headius/invokebinder/Binder.java
Binder.drop
public Binder drop(int index, int count) { return new Binder(this, new Drop(index, Arrays.copyOfRange(type().parameterArray(), index, index + count))); }
java
public Binder drop(int index, int count) { return new Binder(this, new Drop(index, Arrays.copyOfRange(type().parameterArray(), index, index + count))); }
[ "public", "Binder", "drop", "(", "int", "index", ",", "int", "count", ")", "{", "return", "new", "Binder", "(", "this", ",", "new", "Drop", "(", "index", ",", "Arrays", ".", "copyOfRange", "(", "type", "(", ")", ".", "parameterArray", "(", ")", ",", ...
Drop from the given index a number of arguments. @param index the index at which to start dropping @param count the number of arguments to drop @return a new Binder
[ "Drop", "from", "the", "given", "index", "a", "number", "of", "arguments", "." ]
ce6bfeb8e33265480daa7b797989dd915d51238d
https://github.com/headius/invokebinder/blob/ce6bfeb8e33265480daa7b797989dd915d51238d/src/main/java/com/headius/invokebinder/Binder.java#L722-L724
42,599
headius/invokebinder
src/main/java/com/headius/invokebinder/Binder.java
Binder.dropLast
public Binder dropLast(int count) { assert count <= type().parameterCount(); return drop(type().parameterCount() - count, count); }
java
public Binder dropLast(int count) { assert count <= type().parameterCount(); return drop(type().parameterCount() - count, count); }
[ "public", "Binder", "dropLast", "(", "int", "count", ")", "{", "assert", "count", "<=", "type", "(", ")", ".", "parameterCount", "(", ")", ";", "return", "drop", "(", "type", "(", ")", ".", "parameterCount", "(", ")", "-", "count", ",", "count", ")",...
Drop from the end of the argument list a number of arguments. @param count the number of arguments to drop @return a new Binder
[ "Drop", "from", "the", "end", "of", "the", "argument", "list", "a", "number", "of", "arguments", "." ]
ce6bfeb8e33265480daa7b797989dd915d51238d
https://github.com/headius/invokebinder/blob/ce6bfeb8e33265480daa7b797989dd915d51238d/src/main/java/com/headius/invokebinder/Binder.java#L741-L745