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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
113,200 | julianhyde/sqlline | src/main/java/sqlline/DatabaseConnection.java | DatabaseConnection.connect | boolean connect() throws SQLException {
try {
if (driver != null && driver.length() != 0) {
Class.forName(driver);
}
} catch (ClassNotFoundException cnfe) {
return sqlLine.error(cnfe);
}
boolean foundDriver = false;
Driver theDriver = null;
try {
theDriver = Driv... | java | boolean connect() throws SQLException {
try {
if (driver != null && driver.length() != 0) {
Class.forName(driver);
}
} catch (ClassNotFoundException cnfe) {
return sqlLine.error(cnfe);
}
boolean foundDriver = false;
Driver theDriver = null;
try {
theDriver = Driv... | [
"boolean",
"connect",
"(",
")",
"throws",
"SQLException",
"{",
"try",
"{",
"if",
"(",
"driver",
"!=",
"null",
"&&",
"driver",
".",
"length",
"(",
")",
"!=",
"0",
")",
"{",
"Class",
".",
"forName",
"(",
"driver",
")",
";",
"}",
"}",
"catch",
"(",
... | Connection to the specified data source. | [
"Connection",
"to",
"the",
"specified",
"data",
"source",
"."
] | 7577f3ebaca0897a9ff01d1553d4576487e1d2c3 | https://github.com/julianhyde/sqlline/blob/7577f3ebaca0897a9ff01d1553d4576487e1d2c3/src/main/java/sqlline/DatabaseConnection.java#L88-L175 |
113,201 | julianhyde/sqlline | src/main/java/sqlline/Application.java | Application.getOutputFormats | public Map<String, OutputFormat> getOutputFormats(SqlLine sqlLine) {
final Map<String, OutputFormat> outputFormats = new HashMap<>();
outputFormats.put("vertical", new VerticalOutputFormat(sqlLine));
outputFormats.put("table", new TableOutputFormat(sqlLine));
outputFormats.put("csv", new SeparatedValues... | java | public Map<String, OutputFormat> getOutputFormats(SqlLine sqlLine) {
final Map<String, OutputFormat> outputFormats = new HashMap<>();
outputFormats.put("vertical", new VerticalOutputFormat(sqlLine));
outputFormats.put("table", new TableOutputFormat(sqlLine));
outputFormats.put("csv", new SeparatedValues... | [
"public",
"Map",
"<",
"String",
",",
"OutputFormat",
">",
"getOutputFormats",
"(",
"SqlLine",
"sqlLine",
")",
"{",
"final",
"Map",
"<",
"String",
",",
"OutputFormat",
">",
"outputFormats",
"=",
"new",
"HashMap",
"<>",
"(",
")",
";",
"outputFormats",
".",
"... | Override this method to modify known output formats implementations.
<p>If method is not overridden, current state of formats will be
reset to default ({@code super.getOutputFormats(sqlLine)}).
<p>To update / leave current state, override this method
and use {@code sqlLine.getOutputFormats()}.
<p>When overriding out... | [
"Override",
"this",
"method",
"to",
"modify",
"known",
"output",
"formats",
"implementations",
"."
] | 7577f3ebaca0897a9ff01d1553d4576487e1d2c3 | https://github.com/julianhyde/sqlline/blob/7577f3ebaca0897a9ff01d1553d4576487e1d2c3/src/main/java/sqlline/Application.java#L180-L194 |
113,202 | julianhyde/sqlline | src/main/java/sqlline/Commands.java | Commands.buildMetadataArgs | private List<Object> buildMetadataArgs(
String line,
String paramName,
String[] defaultValues) {
final List<Object> list = new ArrayList<>();
final String[][] ret = sqlLine.splitCompound(line);
String[] compound;
if (ret == null || ret.length != 2) {
if (defaultValues[defaultValu... | java | private List<Object> buildMetadataArgs(
String line,
String paramName,
String[] defaultValues) {
final List<Object> list = new ArrayList<>();
final String[][] ret = sqlLine.splitCompound(line);
String[] compound;
if (ret == null || ret.length != 2) {
if (defaultValues[defaultValu... | [
"private",
"List",
"<",
"Object",
">",
"buildMetadataArgs",
"(",
"String",
"line",
",",
"String",
"paramName",
",",
"String",
"[",
"]",
"defaultValues",
")",
"{",
"final",
"List",
"<",
"Object",
">",
"list",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
... | Constructs a list of string parameters for a metadata call.
<p>The number of items is equal to the number of arguments once
the command line (the {@code line} parameter) has been parsed,
typically three (catalog, schema, table name).
<p>Parses the command line, and assumes that the the first word is
a compound identi... | [
"Constructs",
"a",
"list",
"of",
"string",
"parameters",
"for",
"a",
"metadata",
"call",
"."
] | 7577f3ebaca0897a9ff01d1553d4576487e1d2c3 | https://github.com/julianhyde/sqlline/blob/7577f3ebaca0897a9ff01d1553d4576487e1d2c3/src/main/java/sqlline/Commands.java#L345-L372 |
113,203 | julianhyde/sqlline | src/main/java/sqlline/Commands.java | Commands.closeall | public void closeall(String line, DispatchCallback callback) {
close(null, callback);
if (callback.isSuccess()) {
while (callback.isSuccess()) {
close(null, callback);
}
// the last "close" will set it to fail so reset it to success.
callback.setToSuccess();
}
// probably... | java | public void closeall(String line, DispatchCallback callback) {
close(null, callback);
if (callback.isSuccess()) {
while (callback.isSuccess()) {
close(null, callback);
}
// the last "close" will set it to fail so reset it to success.
callback.setToSuccess();
}
// probably... | [
"public",
"void",
"closeall",
"(",
"String",
"line",
",",
"DispatchCallback",
"callback",
")",
"{",
"close",
"(",
"null",
",",
"callback",
")",
";",
"if",
"(",
"callback",
".",
"isSuccess",
"(",
")",
")",
"{",
"while",
"(",
"callback",
".",
"isSuccess",
... | Closes all connections.
@param line Command line
@param callback Callback for command status | [
"Closes",
"all",
"connections",
"."
] | 7577f3ebaca0897a9ff01d1553d4576487e1d2c3 | https://github.com/julianhyde/sqlline/blob/7577f3ebaca0897a9ff01d1553d4576487e1d2c3/src/main/java/sqlline/Commands.java#L1028-L1039 |
113,204 | julianhyde/sqlline | src/main/java/sqlline/Commands.java | Commands.close | public void close(String line, DispatchCallback callback) {
// close file writer
if (sqlLine.getRecordOutputFile() != null) {
// instead of line could be any string
stopRecording(line, callback);
}
DatabaseConnection databaseConnection = sqlLine.getDatabaseConnection();
if (databaseConn... | java | public void close(String line, DispatchCallback callback) {
// close file writer
if (sqlLine.getRecordOutputFile() != null) {
// instead of line could be any string
stopRecording(line, callback);
}
DatabaseConnection databaseConnection = sqlLine.getDatabaseConnection();
if (databaseConn... | [
"public",
"void",
"close",
"(",
"String",
"line",
",",
"DispatchCallback",
"callback",
")",
"{",
"// close file writer",
"if",
"(",
"sqlLine",
".",
"getRecordOutputFile",
"(",
")",
"!=",
"null",
")",
"{",
"// instead of line could be any string",
"stopRecording",
"(... | Closes the current connection.
Closes the current file writer.
@param line Command line
@param callback Callback for command status | [
"Closes",
"the",
"current",
"connection",
".",
"Closes",
"the",
"current",
"file",
"writer",
"."
] | 7577f3ebaca0897a9ff01d1553d4576487e1d2c3 | https://github.com/julianhyde/sqlline/blob/7577f3ebaca0897a9ff01d1553d4576487e1d2c3/src/main/java/sqlline/Commands.java#L1048-L1078 |
113,205 | julianhyde/sqlline | src/main/java/sqlline/Commands.java | Commands.properties | public void properties(String line, DispatchCallback callback)
throws Exception {
String example = "";
example += "Usage: properties <properties file>" + SqlLine.getSeparator();
String[] parts = sqlLine.split(line);
if (parts.length < 2) {
callback.setToFailure();
sqlLine.error(exampl... | java | public void properties(String line, DispatchCallback callback)
throws Exception {
String example = "";
example += "Usage: properties <properties file>" + SqlLine.getSeparator();
String[] parts = sqlLine.split(line);
if (parts.length < 2) {
callback.setToFailure();
sqlLine.error(exampl... | [
"public",
"void",
"properties",
"(",
"String",
"line",
",",
"DispatchCallback",
"callback",
")",
"throws",
"Exception",
"{",
"String",
"example",
"=",
"\"\"",
";",
"example",
"+=",
"\"Usage: properties <properties file>\"",
"+",
"SqlLine",
".",
"getSeparator",
"(",
... | Connects to the database defined in the specified properties file.
@param line Command line
@param callback Callback for command status
@throws Exception on error | [
"Connects",
"to",
"the",
"database",
"defined",
"in",
"the",
"specified",
"properties",
"file",
"."
] | 7577f3ebaca0897a9ff01d1553d4576487e1d2c3 | https://github.com/julianhyde/sqlline/blob/7577f3ebaca0897a9ff01d1553d4576487e1d2c3/src/main/java/sqlline/Commands.java#L1087-L1119 |
113,206 | julianhyde/sqlline | src/main/java/sqlline/Commands.java | Commands.list | public void list(String line, DispatchCallback callback) {
int index = 0;
DatabaseConnections databaseConnections = sqlLine.getDatabaseConnections();
sqlLine.info(
sqlLine.loc("active-connections", databaseConnections.size()));
for (DatabaseConnection databaseConnection : databaseConnections) {... | java | public void list(String line, DispatchCallback callback) {
int index = 0;
DatabaseConnections databaseConnections = sqlLine.getDatabaseConnections();
sqlLine.info(
sqlLine.loc("active-connections", databaseConnections.size()));
for (DatabaseConnection databaseConnection : databaseConnections) {... | [
"public",
"void",
"list",
"(",
"String",
"line",
",",
"DispatchCallback",
"callback",
")",
"{",
"int",
"index",
"=",
"0",
";",
"DatabaseConnections",
"databaseConnections",
"=",
"sqlLine",
".",
"getDatabaseConnections",
"(",
")",
";",
"sqlLine",
".",
"info",
"... | Lists the current connections.
@param line Command line
@param callback Callback for command status | [
"Lists",
"the",
"current",
"connections",
"."
] | 7577f3ebaca0897a9ff01d1553d4576487e1d2c3 | https://github.com/julianhyde/sqlline/blob/7577f3ebaca0897a9ff01d1553d4576487e1d2c3/src/main/java/sqlline/Commands.java#L1323-L1346 |
113,207 | julianhyde/sqlline | src/main/java/sqlline/Commands.java | Commands.script | public void script(String line, DispatchCallback callback) {
if (sqlLine.getScriptOutputFile() == null) {
startScript(line, callback);
} else {
stopScript(line, callback);
}
} | java | public void script(String line, DispatchCallback callback) {
if (sqlLine.getScriptOutputFile() == null) {
startScript(line, callback);
} else {
stopScript(line, callback);
}
} | [
"public",
"void",
"script",
"(",
"String",
"line",
",",
"DispatchCallback",
"callback",
")",
"{",
"if",
"(",
"sqlLine",
".",
"getScriptOutputFile",
"(",
")",
"==",
"null",
")",
"{",
"startScript",
"(",
"line",
",",
"callback",
")",
";",
"}",
"else",
"{",... | Starts or stops saving a script to a file.
@param line Command line
@param callback Callback for command status | [
"Starts",
"or",
"stops",
"saving",
"a",
"script",
"to",
"a",
"file",
"."
] | 7577f3ebaca0897a9ff01d1553d4576487e1d2c3 | https://github.com/julianhyde/sqlline/blob/7577f3ebaca0897a9ff01d1553d4576487e1d2c3/src/main/java/sqlline/Commands.java#L1401-L1407 |
113,208 | julianhyde/sqlline | src/main/java/sqlline/Commands.java | Commands.stopScript | private void stopScript(String line, DispatchCallback callback) {
try {
sqlLine.getScriptOutputFile().close();
} catch (Exception e) {
sqlLine.handleException(e);
}
sqlLine.output(sqlLine.loc("script-closed", sqlLine.getScriptOutputFile()));
sqlLine.setScriptOutputFile(null);
callba... | java | private void stopScript(String line, DispatchCallback callback) {
try {
sqlLine.getScriptOutputFile().close();
} catch (Exception e) {
sqlLine.handleException(e);
}
sqlLine.output(sqlLine.loc("script-closed", sqlLine.getScriptOutputFile()));
sqlLine.setScriptOutputFile(null);
callba... | [
"private",
"void",
"stopScript",
"(",
"String",
"line",
",",
"DispatchCallback",
"callback",
")",
"{",
"try",
"{",
"sqlLine",
".",
"getScriptOutputFile",
"(",
")",
".",
"close",
"(",
")",
";",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",
"sqlLine",
"."... | Stop writing to the script file and close the script. | [
"Stop",
"writing",
"to",
"the",
"script",
"file",
"and",
"close",
"the",
"script",
"."
] | 7577f3ebaca0897a9ff01d1553d4576487e1d2c3 | https://github.com/julianhyde/sqlline/blob/7577f3ebaca0897a9ff01d1553d4576487e1d2c3/src/main/java/sqlline/Commands.java#L1412-L1422 |
113,209 | julianhyde/sqlline | src/main/java/sqlline/Commands.java | Commands.startScript | private void startScript(String line, DispatchCallback callback) {
OutputFile outFile = sqlLine.getScriptOutputFile();
if (outFile != null) {
callback.setToFailure();
sqlLine.error(sqlLine.loc("script-already-running", outFile));
return;
}
String filename;
if (line.length() == "sc... | java | private void startScript(String line, DispatchCallback callback) {
OutputFile outFile = sqlLine.getScriptOutputFile();
if (outFile != null) {
callback.setToFailure();
sqlLine.error(sqlLine.loc("script-already-running", outFile));
return;
}
String filename;
if (line.length() == "sc... | [
"private",
"void",
"startScript",
"(",
"String",
"line",
",",
"DispatchCallback",
"callback",
")",
"{",
"OutputFile",
"outFile",
"=",
"sqlLine",
".",
"getScriptOutputFile",
"(",
")",
";",
"if",
"(",
"outFile",
"!=",
"null",
")",
"{",
"callback",
".",
"setToF... | Start writing to the specified script file. | [
"Start",
"writing",
"to",
"the",
"specified",
"script",
"file",
"."
] | 7577f3ebaca0897a9ff01d1553d4576487e1d2c3 | https://github.com/julianhyde/sqlline/blob/7577f3ebaca0897a9ff01d1553d4576487e1d2c3/src/main/java/sqlline/Commands.java#L1427-L1453 |
113,210 | julianhyde/sqlline | src/main/java/sqlline/Commands.java | Commands.run | public void run(String line, DispatchCallback callback) {
String filename;
if (line.length() == "run".length()
|| (filename =
sqlLine.dequote(line.substring("run".length() + 1))) == null) {
sqlLine.error("Usage: run <file name>");
callback.setToFailure();
return;
}
... | java | public void run(String line, DispatchCallback callback) {
String filename;
if (line.length() == "run".length()
|| (filename =
sqlLine.dequote(line.substring("run".length() + 1))) == null) {
sqlLine.error("Usage: run <file name>");
callback.setToFailure();
return;
}
... | [
"public",
"void",
"run",
"(",
"String",
"line",
",",
"DispatchCallback",
"callback",
")",
"{",
"String",
"filename",
";",
"if",
"(",
"line",
".",
"length",
"(",
")",
"==",
"\"run\"",
".",
"length",
"(",
")",
"||",
"(",
"filename",
"=",
"sqlLine",
".",
... | Runs a script from the specified file.
@param line Command line
@param callback Callback for command status | [
"Runs",
"a",
"script",
"from",
"the",
"specified",
"file",
"."
] | 7577f3ebaca0897a9ff01d1553d4576487e1d2c3 | https://github.com/julianhyde/sqlline/blob/7577f3ebaca0897a9ff01d1553d4576487e1d2c3/src/main/java/sqlline/Commands.java#L1461-L1522 |
113,211 | julianhyde/sqlline | src/main/java/sqlline/Commands.java | Commands.expand | public static String expand(String filename) {
if (filename.startsWith("~" + File.separator)) {
try {
String home = System.getProperty("user.home");
if (home != null) {
return home + filename.substring(1);
}
} catch (SecurityException e) {
// ignore
}
... | java | public static String expand(String filename) {
if (filename.startsWith("~" + File.separator)) {
try {
String home = System.getProperty("user.home");
if (home != null) {
return home + filename.substring(1);
}
} catch (SecurityException e) {
// ignore
}
... | [
"public",
"static",
"String",
"expand",
"(",
"String",
"filename",
")",
"{",
"if",
"(",
"filename",
".",
"startsWith",
"(",
"\"~\"",
"+",
"File",
".",
"separator",
")",
")",
"{",
"try",
"{",
"String",
"home",
"=",
"System",
".",
"getProperty",
"(",
"\"... | Expands "~" to the home directory.
@param filename File name
@return Expanded file name | [
"Expands",
"~",
"to",
"the",
"home",
"directory",
"."
] | 7577f3ebaca0897a9ff01d1553d4576487e1d2c3 | https://github.com/julianhyde/sqlline/blob/7577f3ebaca0897a9ff01d1553d4576487e1d2c3/src/main/java/sqlline/Commands.java#L1535-L1547 |
113,212 | julianhyde/sqlline | src/main/java/sqlline/Commands.java | Commands.record | public void record(String line, DispatchCallback callback) {
if (sqlLine.getRecordOutputFile() == null) {
startRecording(line, callback);
} else {
stopRecording(line, callback);
}
} | java | public void record(String line, DispatchCallback callback) {
if (sqlLine.getRecordOutputFile() == null) {
startRecording(line, callback);
} else {
stopRecording(line, callback);
}
} | [
"public",
"void",
"record",
"(",
"String",
"line",
",",
"DispatchCallback",
"callback",
")",
"{",
"if",
"(",
"sqlLine",
".",
"getRecordOutputFile",
"(",
")",
"==",
"null",
")",
"{",
"startRecording",
"(",
"line",
",",
"callback",
")",
";",
"}",
"else",
"... | Starts or stops saving all output to a file.
@param line Command line
@param callback Callback for command status | [
"Starts",
"or",
"stops",
"saving",
"all",
"output",
"to",
"a",
"file",
"."
] | 7577f3ebaca0897a9ff01d1553d4576487e1d2c3 | https://github.com/julianhyde/sqlline/blob/7577f3ebaca0897a9ff01d1553d4576487e1d2c3/src/main/java/sqlline/Commands.java#L1555-L1561 |
113,213 | julianhyde/sqlline | src/main/java/sqlline/Commands.java | Commands.stopRecording | private void stopRecording(String line, DispatchCallback callback) {
try {
sqlLine.getRecordOutputFile().close();
} catch (Exception e) {
sqlLine.handleException(e);
}
sqlLine.output(sqlLine.loc("record-closed", sqlLine.getRecordOutputFile()));
sqlLine.setRecordOutputFile(null);
cal... | java | private void stopRecording(String line, DispatchCallback callback) {
try {
sqlLine.getRecordOutputFile().close();
} catch (Exception e) {
sqlLine.handleException(e);
}
sqlLine.output(sqlLine.loc("record-closed", sqlLine.getRecordOutputFile()));
sqlLine.setRecordOutputFile(null);
cal... | [
"private",
"void",
"stopRecording",
"(",
"String",
"line",
",",
"DispatchCallback",
"callback",
")",
"{",
"try",
"{",
"sqlLine",
".",
"getRecordOutputFile",
"(",
")",
".",
"close",
"(",
")",
";",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",
"sqlLine",
... | Stop writing output to the record file. | [
"Stop",
"writing",
"output",
"to",
"the",
"record",
"file",
"."
] | 7577f3ebaca0897a9ff01d1553d4576487e1d2c3 | https://github.com/julianhyde/sqlline/blob/7577f3ebaca0897a9ff01d1553d4576487e1d2c3/src/main/java/sqlline/Commands.java#L1623-L1633 |
113,214 | julianhyde/sqlline | src/main/java/sqlline/Commands.java | Commands.startRecording | private void startRecording(String line, DispatchCallback callback) {
OutputFile outputFile = sqlLine.getRecordOutputFile();
if (outputFile != null) {
callback.setToFailure();
sqlLine.error(sqlLine.loc("record-already-running", outputFile));
return;
}
String filename;
if (line.len... | java | private void startRecording(String line, DispatchCallback callback) {
OutputFile outputFile = sqlLine.getRecordOutputFile();
if (outputFile != null) {
callback.setToFailure();
sqlLine.error(sqlLine.loc("record-already-running", outputFile));
return;
}
String filename;
if (line.len... | [
"private",
"void",
"startRecording",
"(",
"String",
"line",
",",
"DispatchCallback",
"callback",
")",
"{",
"OutputFile",
"outputFile",
"=",
"sqlLine",
".",
"getRecordOutputFile",
"(",
")",
";",
"if",
"(",
"outputFile",
"!=",
"null",
")",
"{",
"callback",
".",
... | Start writing to the specified record file. | [
"Start",
"writing",
"to",
"the",
"specified",
"record",
"file",
"."
] | 7577f3ebaca0897a9ff01d1553d4576487e1d2c3 | https://github.com/julianhyde/sqlline/blob/7577f3ebaca0897a9ff01d1553d4576487e1d2c3/src/main/java/sqlline/Commands.java#L1638-L1664 |
113,215 | julianhyde/sqlline | src/main/java/sqlline/SqlLine.java | SqlLine.mainWithInputRedirection | public static Status mainWithInputRedirection(String[] args,
InputStream inputStream) throws IOException {
return start(args, inputStream, false);
} | java | public static Status mainWithInputRedirection(String[] args,
InputStream inputStream) throws IOException {
return start(args, inputStream, false);
} | [
"public",
"static",
"Status",
"mainWithInputRedirection",
"(",
"String",
"[",
"]",
"args",
",",
"InputStream",
"inputStream",
")",
"throws",
"IOException",
"{",
"return",
"start",
"(",
"args",
",",
"inputStream",
",",
"false",
")",
";",
"}"
] | Starts the program with redirected input.
<p>For redirected output, use {@link #setOutputStream} and
{@link #setErrorStream}.
<p>Exits with 0 on success, 1 on invalid arguments, and 2 on any
other error.
@param args same as main()
@param inputStream redirected input, or null to use standard input
@return Stat... | [
"Starts",
"the",
"program",
"with",
"redirected",
"input",
"."
] | 7577f3ebaca0897a9ff01d1553d4576487e1d2c3 | https://github.com/julianhyde/sqlline/blob/7577f3ebaca0897a9ff01d1553d4576487e1d2c3/src/main/java/sqlline/SqlLine.java#L218-L221 |
113,216 | julianhyde/sqlline | src/main/java/sqlline/SqlLine.java | SqlLine.registerKnownDrivers | void registerKnownDrivers() {
if (appConfig.allowedDrivers == null) {
return;
}
for (String driverName : appConfig.allowedDrivers) {
try {
Class.forName(driverName);
} catch (Throwable t) {
// ignore
}
}
} | java | void registerKnownDrivers() {
if (appConfig.allowedDrivers == null) {
return;
}
for (String driverName : appConfig.allowedDrivers) {
try {
Class.forName(driverName);
} catch (Throwable t) {
// ignore
}
}
} | [
"void",
"registerKnownDrivers",
"(",
")",
"{",
"if",
"(",
"appConfig",
".",
"allowedDrivers",
"==",
"null",
")",
"{",
"return",
";",
"}",
"for",
"(",
"String",
"driverName",
":",
"appConfig",
".",
"allowedDrivers",
")",
"{",
"try",
"{",
"Class",
".",
"fo... | Walk through all the known drivers and try to register them. | [
"Walk",
"through",
"all",
"the",
"known",
"drivers",
"and",
"try",
"to",
"register",
"them",
"."
] | 7577f3ebaca0897a9ff01d1553d4576487e1d2c3 | https://github.com/julianhyde/sqlline/blob/7577f3ebaca0897a9ff01d1553d4576487e1d2c3/src/main/java/sqlline/SqlLine.java#L323-L334 |
113,217 | julianhyde/sqlline | src/main/java/sqlline/SqlLine.java | SqlLine.isComment | boolean isComment(String line, boolean trim) {
final String trimmedLine = trim ? line.trim() : line;
for (String comment: getDialect().getSqlLineOneLineComments()) {
if (trimmedLine.startsWith(comment)) {
return true;
}
}
return false;
} | java | boolean isComment(String line, boolean trim) {
final String trimmedLine = trim ? line.trim() : line;
for (String comment: getDialect().getSqlLineOneLineComments()) {
if (trimmedLine.startsWith(comment)) {
return true;
}
}
return false;
} | [
"boolean",
"isComment",
"(",
"String",
"line",
",",
"boolean",
"trim",
")",
"{",
"final",
"String",
"trimmedLine",
"=",
"trim",
"?",
"line",
".",
"trim",
"(",
")",
":",
"line",
";",
"for",
"(",
"String",
"comment",
":",
"getDialect",
"(",
")",
".",
"... | Test whether a line is a comment.
@param line the line to be tested
@return true if a comment | [
"Test",
"whether",
"a",
"line",
"is",
"a",
"comment",
"."
] | 7577f3ebaca0897a9ff01d1553d4576487e1d2c3 | https://github.com/julianhyde/sqlline/blob/7577f3ebaca0897a9ff01d1553d4576487e1d2c3/src/main/java/sqlline/SqlLine.java#L766-L774 |
113,218 | julianhyde/sqlline | src/main/java/sqlline/SqlLine.java | SqlLine.error | public boolean error(String msg) {
output(getColorBuffer().red(msg), true, errorStream);
return false;
} | java | public boolean error(String msg) {
output(getColorBuffer().red(msg), true, errorStream);
return false;
} | [
"public",
"boolean",
"error",
"(",
"String",
"msg",
")",
"{",
"output",
"(",
"getColorBuffer",
"(",
")",
".",
"red",
"(",
"msg",
")",
",",
"true",
",",
"errorStream",
")",
";",
"return",
"false",
";",
"}"
] | Issue the specified error message
@param msg the message to issue
@return false always | [
"Issue",
"the",
"specified",
"error",
"message"
] | 7577f3ebaca0897a9ff01d1553d4576487e1d2c3 | https://github.com/julianhyde/sqlline/blob/7577f3ebaca0897a9ff01d1553d4576487e1d2c3/src/main/java/sqlline/SqlLine.java#L807-L810 |
113,219 | julianhyde/sqlline | src/main/java/sqlline/SqlLine.java | SqlLine.assertAutoCommit | boolean assertAutoCommit() {
if (!assertConnection()) {
return false;
}
try {
if (getDatabaseConnection().connection.getAutoCommit()) {
return error(loc("autocommit-needs-off"));
}
} catch (Exception e) {
return error(e);
}
return true;
} | java | boolean assertAutoCommit() {
if (!assertConnection()) {
return false;
}
try {
if (getDatabaseConnection().connection.getAutoCommit()) {
return error(loc("autocommit-needs-off"));
}
} catch (Exception e) {
return error(e);
}
return true;
} | [
"boolean",
"assertAutoCommit",
"(",
")",
"{",
"if",
"(",
"!",
"assertConnection",
"(",
")",
")",
"{",
"return",
"false",
";",
"}",
"try",
"{",
"if",
"(",
"getDatabaseConnection",
"(",
")",
".",
"connection",
".",
"getAutoCommit",
"(",
")",
")",
"{",
"r... | Ensure that autocommit is on for the current connection
@return true if autocommit is set | [
"Ensure",
"that",
"autocommit",
"is",
"on",
"for",
"the",
"current",
"connection"
] | 7577f3ebaca0897a9ff01d1553d4576487e1d2c3 | https://github.com/julianhyde/sqlline/blob/7577f3ebaca0897a9ff01d1553d4576487e1d2c3/src/main/java/sqlline/SqlLine.java#L872-L886 |
113,220 | julianhyde/sqlline | src/main/java/sqlline/SqlLine.java | SqlLine.assertConnection | boolean assertConnection() {
try {
if (getDatabaseConnection() == null
|| getDatabaseConnection().connection == null) {
return error(loc("no-current-connection"));
}
if (getDatabaseConnection().connection.isClosed()) {
return error(loc("connection-is-closed"));
}
... | java | boolean assertConnection() {
try {
if (getDatabaseConnection() == null
|| getDatabaseConnection().connection == null) {
return error(loc("no-current-connection"));
}
if (getDatabaseConnection().connection.isClosed()) {
return error(loc("connection-is-closed"));
}
... | [
"boolean",
"assertConnection",
"(",
")",
"{",
"try",
"{",
"if",
"(",
"getDatabaseConnection",
"(",
")",
"==",
"null",
"||",
"getDatabaseConnection",
"(",
")",
".",
"connection",
"==",
"null",
")",
"{",
"return",
"error",
"(",
"loc",
"(",
"\"no-current-connec... | Assert that we have an active, living connection. Print an error message
if we do not.
@return true if there is a current, active connection | [
"Assert",
"that",
"we",
"have",
"an",
"active",
"living",
"connection",
".",
"Print",
"an",
"error",
"message",
"if",
"we",
"do",
"not",
"."
] | 7577f3ebaca0897a9ff01d1553d4576487e1d2c3 | https://github.com/julianhyde/sqlline/blob/7577f3ebaca0897a9ff01d1553d4576487e1d2c3/src/main/java/sqlline/SqlLine.java#L894-L909 |
113,221 | julianhyde/sqlline | src/main/java/sqlline/SqlLine.java | SqlLine.showWarnings | void showWarnings() {
if (getDatabaseConnection().connection == null) {
return;
}
if (!getOpts().getShowWarnings()) {
return;
}
try {
showWarnings(getDatabaseConnection().connection.getWarnings());
} catch (Exception e) {
handleException(e);
}
} | java | void showWarnings() {
if (getDatabaseConnection().connection == null) {
return;
}
if (!getOpts().getShowWarnings()) {
return;
}
try {
showWarnings(getDatabaseConnection().connection.getWarnings());
} catch (Exception e) {
handleException(e);
}
} | [
"void",
"showWarnings",
"(",
")",
"{",
"if",
"(",
"getDatabaseConnection",
"(",
")",
".",
"connection",
"==",
"null",
")",
"{",
"return",
";",
"}",
"if",
"(",
"!",
"getOpts",
"(",
")",
".",
"getShowWarnings",
"(",
")",
")",
"{",
"return",
";",
"}",
... | Print out any warnings that exist for the current connection. | [
"Print",
"out",
"any",
"warnings",
"that",
"exist",
"for",
"the",
"current",
"connection",
"."
] | 7577f3ebaca0897a9ff01d1553d4576487e1d2c3 | https://github.com/julianhyde/sqlline/blob/7577f3ebaca0897a9ff01d1553d4576487e1d2c3/src/main/java/sqlline/SqlLine.java#L914-L928 |
113,222 | julianhyde/sqlline | src/main/java/sqlline/SqlLine.java | SqlLine.split | String[] split(String line, int assertLen, String usage) {
String[] ret = split(line);
if (ret.length != assertLen) {
error(usage);
return null;
}
return ret;
} | java | String[] split(String line, int assertLen, String usage) {
String[] ret = split(line);
if (ret.length != assertLen) {
error(usage);
return null;
}
return ret;
} | [
"String",
"[",
"]",
"split",
"(",
"String",
"line",
",",
"int",
"assertLen",
",",
"String",
"usage",
")",
"{",
"String",
"[",
"]",
"ret",
"=",
"split",
"(",
"line",
")",
";",
"if",
"(",
"ret",
".",
"length",
"!=",
"assertLen",
")",
"{",
"error",
... | Split the line based on spaces, asserting that the number of words is
correct.
@param line the line to split
@param assertLen the number of words to assure
@param usage the message to output if there are an incorrect number of
words.
@return the split lines, or null if the assertion failed. | [
"Split",
"the",
"line",
"based",
"on",
"spaces",
"asserting",
"that",
"the",
"number",
"of",
"words",
"is",
"correct",
"."
] | 7577f3ebaca0897a9ff01d1553d4576487e1d2c3 | https://github.com/julianhyde/sqlline/blob/7577f3ebaca0897a9ff01d1553d4576487e1d2c3/src/main/java/sqlline/SqlLine.java#L1397-L1406 |
113,223 | julianhyde/sqlline | src/main/java/sqlline/SqlLine.java | SqlLine.wrap | String wrap(String toWrap, int len, int start) {
StringBuilder buff = new StringBuilder();
StringBuilder line = new StringBuilder();
char[] head = new char[start];
Arrays.fill(head, ' ');
for (StringTokenizer tok = new StringTokenizer(toWrap, " ");
tok.hasMoreTokens();) {
String nex... | java | String wrap(String toWrap, int len, int start) {
StringBuilder buff = new StringBuilder();
StringBuilder line = new StringBuilder();
char[] head = new char[start];
Arrays.fill(head, ' ');
for (StringTokenizer tok = new StringTokenizer(toWrap, " ");
tok.hasMoreTokens();) {
String nex... | [
"String",
"wrap",
"(",
"String",
"toWrap",
",",
"int",
"len",
",",
"int",
"start",
")",
"{",
"StringBuilder",
"buff",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"StringBuilder",
"line",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"char",
"[",
"]",
"he... | Wrap the specified string by breaking on space characters.
@param toWrap the string to wrap
@param len the maximum length of any line
@param start the number of spaces to pad at the beginning of a line
@return the wrapped string | [
"Wrap",
"the",
"specified",
"string",
"by",
"breaking",
"on",
"space",
"characters",
"."
] | 7577f3ebaca0897a9ff01d1553d4576487e1d2c3 | https://github.com/julianhyde/sqlline/blob/7577f3ebaca0897a9ff01d1553d4576487e1d2c3/src/main/java/sqlline/SqlLine.java#L1416-L1441 |
113,224 | julianhyde/sqlline | src/main/java/sqlline/SqlLine.java | SqlLine.progress | void progress(int cur, int max) {
StringBuilder out = new StringBuilder();
if (lastProgress != null) {
char[] back = new char[lastProgress.length()];
Arrays.fill(back, '\b');
out.append(back);
}
String progress =
cur + "/" + (max == -1 ? "?" : "" + max) + " "
+ (m... | java | void progress(int cur, int max) {
StringBuilder out = new StringBuilder();
if (lastProgress != null) {
char[] back = new char[lastProgress.length()];
Arrays.fill(back, '\b');
out.append(back);
}
String progress =
cur + "/" + (max == -1 ? "?" : "" + max) + " "
+ (m... | [
"void",
"progress",
"(",
"int",
"cur",
",",
"int",
"max",
")",
"{",
"StringBuilder",
"out",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"if",
"(",
"lastProgress",
"!=",
"null",
")",
"{",
"char",
"[",
"]",
"back",
"=",
"new",
"char",
"[",
"lastProgres... | Output a progress indicator to the console.
@param cur the current progress
@param max the maximum progress, or -1 if unknown | [
"Output",
"a",
"progress",
"indicator",
"to",
"the",
"console",
"."
] | 7577f3ebaca0897a9ff01d1553d4576487e1d2c3 | https://github.com/julianhyde/sqlline/blob/7577f3ebaca0897a9ff01d1553d4576487e1d2c3/src/main/java/sqlline/SqlLine.java#L1449-L1474 |
113,225 | julianhyde/sqlline | src/main/java/sqlline/SqlLine.java | SqlLine.scanForDriver | String scanForDriver(String url) {
try {
// already registered
Driver driver;
if ((driver = findRegisteredDriver(url)) != null) {
return driver.getClass().getCanonicalName();
}
scanDrivers();
if ((driver = findRegisteredDriver(url)) != null) {
return driver.getC... | java | String scanForDriver(String url) {
try {
// already registered
Driver driver;
if ((driver = findRegisteredDriver(url)) != null) {
return driver.getClass().getCanonicalName();
}
scanDrivers();
if ((driver = findRegisteredDriver(url)) != null) {
return driver.getC... | [
"String",
"scanForDriver",
"(",
"String",
"url",
")",
"{",
"try",
"{",
"// already registered",
"Driver",
"driver",
";",
"if",
"(",
"(",
"driver",
"=",
"findRegisteredDriver",
"(",
"url",
")",
")",
"!=",
"null",
")",
"{",
"return",
"driver",
".",
"getClass... | Looks for a driver with a particular URL. Returns the name of the class
if found, null if not found. | [
"Looks",
"for",
"a",
"driver",
"with",
"a",
"particular",
"URL",
".",
"Returns",
"the",
"name",
"of",
"the",
"class",
"if",
"found",
"null",
"if",
"not",
"found",
"."
] | 7577f3ebaca0897a9ff01d1553d4576487e1d2c3 | https://github.com/julianhyde/sqlline/blob/7577f3ebaca0897a9ff01d1553d4576487e1d2c3/src/main/java/sqlline/SqlLine.java#L1536-L1556 |
113,226 | julianhyde/sqlline | src/main/java/sqlline/SqlLine.java | SqlLine.withPrompting | <R> R withPrompting(Supplier<R> action) {
if (prompting) {
throw new IllegalArgumentException();
}
prompting = true;
try {
return action.get();
} finally {
prompting = false;
}
} | java | <R> R withPrompting(Supplier<R> action) {
if (prompting) {
throw new IllegalArgumentException();
}
prompting = true;
try {
return action.get();
} finally {
prompting = false;
}
} | [
"<",
"R",
">",
"R",
"withPrompting",
"(",
"Supplier",
"<",
"R",
">",
"action",
")",
"{",
"if",
"(",
"prompting",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
")",
";",
"}",
"prompting",
"=",
"true",
";",
"try",
"{",
"return",
"action",
... | Enables prompting, applies an action, and disables prompting. | [
"Enables",
"prompting",
"applies",
"an",
"action",
"and",
"disables",
"prompting",
"."
] | 7577f3ebaca0897a9ff01d1553d4576487e1d2c3 | https://github.com/julianhyde/sqlline/blob/7577f3ebaca0897a9ff01d1553d4576487e1d2c3/src/main/java/sqlline/SqlLine.java#L1863-L1873 |
113,227 | julianhyde/sqlline | src/main/java/sqlline/SqlLineOpts.java | SqlLineOpts.isDefault | public boolean isDefault(SqlLineProperty property) {
final String defaultValue = String.valueOf(property.defaultValue());
final String currentValue = get(property);
return String.valueOf((Object) null).equals(currentValue)
|| Objects.equals(currentValue, defaultValue);
} | java | public boolean isDefault(SqlLineProperty property) {
final String defaultValue = String.valueOf(property.defaultValue());
final String currentValue = get(property);
return String.valueOf((Object) null).equals(currentValue)
|| Objects.equals(currentValue, defaultValue);
} | [
"public",
"boolean",
"isDefault",
"(",
"SqlLineProperty",
"property",
")",
"{",
"final",
"String",
"defaultValue",
"=",
"String",
".",
"valueOf",
"(",
"property",
".",
"defaultValue",
"(",
")",
")",
";",
"final",
"String",
"currentValue",
"=",
"get",
"(",
"p... | Returns whether the property is its default value.
<p>This true if it has not been assigned a value,
or if has been assigned a value equal to its default value.
@param property Property
@return whether property has its default value | [
"Returns",
"whether",
"the",
"property",
"is",
"its",
"default",
"value",
"."
] | 7577f3ebaca0897a9ff01d1553d4576487e1d2c3 | https://github.com/julianhyde/sqlline/blob/7577f3ebaca0897a9ff01d1553d4576487e1d2c3/src/main/java/sqlline/SqlLineOpts.java#L410-L415 |
113,228 | julianhyde/sqlline | src/main/java/sqlline/ColorBuffer.java | ColorBuffer.pad | ColorBuffer pad(ColorBuffer str, int len) {
int n = str.getVisibleLength();
while (n < len) {
str.append(" ");
n++;
}
return append(str);
} | java | ColorBuffer pad(ColorBuffer str, int len) {
int n = str.getVisibleLength();
while (n < len) {
str.append(" ");
n++;
}
return append(str);
} | [
"ColorBuffer",
"pad",
"(",
"ColorBuffer",
"str",
",",
"int",
"len",
")",
"{",
"int",
"n",
"=",
"str",
".",
"getVisibleLength",
"(",
")",
";",
"while",
"(",
"n",
"<",
"len",
")",
"{",
"str",
".",
"append",
"(",
"\" \"",
")",
";",
"n",
"++",
";",
... | Pad the specified String with spaces to the indicated length
@param str The String to pad
@param len The length we want the return String to be
@return the passed in String with spaces appended until the
length matches the specified length. | [
"Pad",
"the",
"specified",
"String",
"with",
"spaces",
"to",
"the",
"indicated",
"length"
] | 7577f3ebaca0897a9ff01d1553d4576487e1d2c3 | https://github.com/julianhyde/sqlline/blob/7577f3ebaca0897a9ff01d1553d4576487e1d2c3/src/main/java/sqlline/ColorBuffer.java#L70-L78 |
113,229 | julianhyde/sqlline | src/main/java/sqlline/ColorBuffer.java | ColorBuffer.truncate | public ColorBuffer truncate(int len) {
ColorBuffer cbuff = new ColorBuffer(useColor);
ColorAttr lastAttr = null;
for (Iterator<Object> i = parts.iterator();
cbuff.getVisibleLength() < len && i.hasNext();) {
Object next = i.next();
if (next instanceof ColorAttr) {
lastAttr = (Colo... | java | public ColorBuffer truncate(int len) {
ColorBuffer cbuff = new ColorBuffer(useColor);
ColorAttr lastAttr = null;
for (Iterator<Object> i = parts.iterator();
cbuff.getVisibleLength() < len && i.hasNext();) {
Object next = i.next();
if (next instanceof ColorAttr) {
lastAttr = (Colo... | [
"public",
"ColorBuffer",
"truncate",
"(",
"int",
"len",
")",
"{",
"ColorBuffer",
"cbuff",
"=",
"new",
"ColorBuffer",
"(",
"useColor",
")",
";",
"ColorAttr",
"lastAttr",
"=",
"null",
";",
"for",
"(",
"Iterator",
"<",
"Object",
">",
"i",
"=",
"parts",
".",... | Truncate the ColorBuffer to the specified length and return
the new ColorBuffer. Any open color tags will be closed. | [
"Truncate",
"the",
"ColorBuffer",
"to",
"the",
"specified",
"length",
"and",
"return",
"the",
"new",
"ColorBuffer",
".",
"Any",
"open",
"color",
"tags",
"will",
"be",
"closed",
"."
] | 7577f3ebaca0897a9ff01d1553d4576487e1d2c3 | https://github.com/julianhyde/sqlline/blob/7577f3ebaca0897a9ff01d1553d4576487e1d2c3/src/main/java/sqlline/ColorBuffer.java#L133-L160 |
113,230 | julianhyde/sqlline | src/main/java/sqlline/SqlLineHighlighter.java | SqlLineHighlighter.getStartingPoint | private int getStartingPoint(String buffer) {
for (int i = 0; i < buffer.length(); i++) {
if (!Character.isWhitespace(buffer.charAt(i))) {
return i;
}
}
return buffer.length();
} | java | private int getStartingPoint(String buffer) {
for (int i = 0; i < buffer.length(); i++) {
if (!Character.isWhitespace(buffer.charAt(i))) {
return i;
}
}
return buffer.length();
} | [
"private",
"int",
"getStartingPoint",
"(",
"String",
"buffer",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"buffer",
".",
"length",
"(",
")",
";",
"i",
"++",
")",
"{",
"if",
"(",
"!",
"Character",
".",
"isWhitespace",
"(",
"buffer",
... | Returns the index of the first non-whitespace character.
@param buffer Input string
@return index of the first non-whitespace character | [
"Returns",
"the",
"index",
"of",
"the",
"first",
"non",
"-",
"whitespace",
"character",
"."
] | 7577f3ebaca0897a9ff01d1553d4576487e1d2c3 | https://github.com/julianhyde/sqlline/blob/7577f3ebaca0897a9ff01d1553d4576487e1d2c3/src/main/java/sqlline/SqlLineHighlighter.java#L201-L208 |
113,231 | julianhyde/sqlline | src/main/java/sqlline/SqlLineHighlighter.java | SqlLineHighlighter.handleNumbers | int handleNumbers(String line, BitSet numberBitSet, int startingPoint) {
int end = startingPoint + 1;
while (end < line.length() && Character.isDigit(line.charAt(end))) {
end++;
}
if (end == line.length()) {
if (Character.isDigit(line.charAt(line.length() - 1))) {
numberBitSet.set(st... | java | int handleNumbers(String line, BitSet numberBitSet, int startingPoint) {
int end = startingPoint + 1;
while (end < line.length() && Character.isDigit(line.charAt(end))) {
end++;
}
if (end == line.length()) {
if (Character.isDigit(line.charAt(line.length() - 1))) {
numberBitSet.set(st... | [
"int",
"handleNumbers",
"(",
"String",
"line",
",",
"BitSet",
"numberBitSet",
",",
"int",
"startingPoint",
")",
"{",
"int",
"end",
"=",
"startingPoint",
"+",
"1",
";",
"while",
"(",
"end",
"<",
"line",
".",
"length",
"(",
")",
"&&",
"Character",
".",
"... | Marks numbers position based on input.
<p>Assumes that a number starts at the specified position,
i.e. {@code Character.isDigit(line.charAt(startingPoint)) == true}
@param line Line where to handle number string
@param numberBitSet BitSet to use for position of number
@param startingPoint Start point
@r... | [
"Marks",
"numbers",
"position",
"based",
"on",
"input",
"."
] | 7577f3ebaca0897a9ff01d1553d4576487e1d2c3 | https://github.com/julianhyde/sqlline/blob/7577f3ebaca0897a9ff01d1553d4576487e1d2c3/src/main/java/sqlline/SqlLineHighlighter.java#L399-L429 |
113,232 | julianhyde/sqlline | src/main/java/sqlline/SqlLineHighlighter.java | SqlLineHighlighter.handleComments | int handleComments(String line, BitSet commentBitSet,
int startingPoint, boolean isSql) {
Set<String> oneLineComments = isSql
? sqlLine.getDialect().getOneLineComments()
: sqlLine.getDialect().getSqlLineOneLineComments();
final char ch = line.charAt(startingPoint);
if (startingPoint + ... | java | int handleComments(String line, BitSet commentBitSet,
int startingPoint, boolean isSql) {
Set<String> oneLineComments = isSql
? sqlLine.getDialect().getOneLineComments()
: sqlLine.getDialect().getSqlLineOneLineComments();
final char ch = line.charAt(startingPoint);
if (startingPoint + ... | [
"int",
"handleComments",
"(",
"String",
"line",
",",
"BitSet",
"commentBitSet",
",",
"int",
"startingPoint",
",",
"boolean",
"isSql",
")",
"{",
"Set",
"<",
"String",
">",
"oneLineComments",
"=",
"isSql",
"?",
"sqlLine",
".",
"getDialect",
"(",
")",
".",
"g... | Marks commented string position based on input.
<p>Assumes that there is a comment start since the specified position,
i.e. <code>line.charAt(startingPoint) == '-'
&& line.charAt(startingPoint + 1) == '-'</code>
or
i.e. <code>line.charAt(startingPoint) == '/'
&& line.charAt(startingPoint + 1) == '*'</code>
@param lin... | [
"Marks",
"commented",
"string",
"position",
"based",
"on",
"input",
"."
] | 7577f3ebaca0897a9ff01d1553d4576487e1d2c3 | https://github.com/julianhyde/sqlline/blob/7577f3ebaca0897a9ff01d1553d4576487e1d2c3/src/main/java/sqlline/SqlLineHighlighter.java#L458-L484 |
113,233 | julianhyde/sqlline | src/main/java/sqlline/SqlLineHighlighter.java | SqlLineHighlighter.handleSqlSingleQuotes | int handleSqlSingleQuotes(String line, BitSet quoteBitSet,
int startingPoint) {
int end;
int quoteCounter = 1;
boolean quotationEnded = false;
do {
end = line.indexOf('\'', startingPoint + 1);
if (end > -1) {
quoteCounter++;
}
if (end == -1 || end == line.length() -... | java | int handleSqlSingleQuotes(String line, BitSet quoteBitSet,
int startingPoint) {
int end;
int quoteCounter = 1;
boolean quotationEnded = false;
do {
end = line.indexOf('\'', startingPoint + 1);
if (end > -1) {
quoteCounter++;
}
if (end == -1 || end == line.length() -... | [
"int",
"handleSqlSingleQuotes",
"(",
"String",
"line",
",",
"BitSet",
"quoteBitSet",
",",
"int",
"startingPoint",
")",
"{",
"int",
"end",
";",
"int",
"quoteCounter",
"=",
"1",
";",
"boolean",
"quotationEnded",
"=",
"false",
";",
"do",
"{",
"end",
"=",
"lin... | Marks single-quoted string position based on input.
<p>Assumes that there is a single quote in the specified position,
i.e. {@code line.charAt(startingPoint) == '\''}.
@param line Line where to handle single-quoted string
@param quoteBitSet BitSet to use for positions of single quoted lines
@param starting... | [
"Marks",
"single",
"-",
"quoted",
"string",
"position",
"based",
"on",
"input",
"."
] | 7577f3ebaca0897a9ff01d1553d4576487e1d2c3 | https://github.com/julianhyde/sqlline/blob/7577f3ebaca0897a9ff01d1553d4576487e1d2c3/src/main/java/sqlline/SqlLineHighlighter.java#L506-L527 |
113,234 | square/otto | otto/src/main/java/com/squareup/otto/Bus.java | Bus.post | public void post(Object event) {
if (event == null) {
throw new NullPointerException("Event to post must not be null.");
}
enforcer.enforce(this);
Set<Class<?>> dispatchTypes = flattenHierarchy(event.getClass());
boolean dispatched = false;
for (Class<?> eventType : dispatchTypes) {
... | java | public void post(Object event) {
if (event == null) {
throw new NullPointerException("Event to post must not be null.");
}
enforcer.enforce(this);
Set<Class<?>> dispatchTypes = flattenHierarchy(event.getClass());
boolean dispatched = false;
for (Class<?> eventType : dispatchTypes) {
... | [
"public",
"void",
"post",
"(",
"Object",
"event",
")",
"{",
"if",
"(",
"event",
"==",
"null",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
"\"Event to post must not be null.\"",
")",
";",
"}",
"enforcer",
".",
"enforce",
"(",
"this",
")",
";",
"S... | Posts an event to all registered handlers. This method will return successfully after the event has been posted to
all handlers, and regardless of any exceptions thrown by handlers.
<p>If no handlers have been subscribed for {@code event}'s class, and {@code event} is not already a
{@link DeadEvent}, it will be wrapp... | [
"Posts",
"an",
"event",
"to",
"all",
"registered",
"handlers",
".",
"This",
"method",
"will",
"return",
"successfully",
"after",
"the",
"event",
"has",
"been",
"posted",
"to",
"all",
"handlers",
"and",
"regardless",
"of",
"any",
"exceptions",
"thrown",
"by",
... | 2a67589abd91879cf23a8c96542b59349485ec3d | https://github.com/square/otto/blob/2a67589abd91879cf23a8c96542b59349485ec3d/otto/src/main/java/com/squareup/otto/Bus.java#L313-L338 |
113,235 | square/otto | otto/src/main/java/com/squareup/otto/Bus.java | Bus.dispatchQueuedEvents | protected void dispatchQueuedEvents() {
// don't dispatch if we're already dispatching, that would allow reentrancy and out-of-order events. Instead, leave
// the events to be dispatched after the in-progress dispatch is complete.
if (isDispatching.get()) {
return;
}
isDispatching.set(true);
... | java | protected void dispatchQueuedEvents() {
// don't dispatch if we're already dispatching, that would allow reentrancy and out-of-order events. Instead, leave
// the events to be dispatched after the in-progress dispatch is complete.
if (isDispatching.get()) {
return;
}
isDispatching.set(true);
... | [
"protected",
"void",
"dispatchQueuedEvents",
"(",
")",
"{",
"// don't dispatch if we're already dispatching, that would allow reentrancy and out-of-order events. Instead, leave",
"// the events to be dispatched after the in-progress dispatch is complete.",
"if",
"(",
"isDispatching",
".",
"g... | Drain the queue of events to be dispatched. As the queue is being drained, new events may be posted to the end of
the queue. | [
"Drain",
"the",
"queue",
"of",
"events",
"to",
"be",
"dispatched",
".",
"As",
"the",
"queue",
"is",
"being",
"drained",
"new",
"events",
"may",
"be",
"posted",
"to",
"the",
"end",
"of",
"the",
"queue",
"."
] | 2a67589abd91879cf23a8c96542b59349485ec3d | https://github.com/square/otto/blob/2a67589abd91879cf23a8c96542b59349485ec3d/otto/src/main/java/com/squareup/otto/Bus.java#L352-L374 |
113,236 | hedzr/android-file-chooser | library/src/main/java/com/obsez/android/lib/filechooser/ChooserDialog.java | ChooserDialog.goBack | public boolean goBack() {
if (_entries.size() > 0 &&
(_entries.get(0).getName().equals(".."))) {
_list.performItemClick(_list, 0, 0);
return true;
}
return false;
} | java | public boolean goBack() {
if (_entries.size() > 0 &&
(_entries.get(0).getName().equals(".."))) {
_list.performItemClick(_list, 0, 0);
return true;
}
return false;
} | [
"public",
"boolean",
"goBack",
"(",
")",
"{",
"if",
"(",
"_entries",
".",
"size",
"(",
")",
">",
"0",
"&&",
"(",
"_entries",
".",
"get",
"(",
"0",
")",
".",
"getName",
"(",
")",
".",
"equals",
"(",
"\"..\"",
")",
")",
")",
"{",
"_list",
".",
... | attempts to move to the parent directory
@return true if successful. false otherwise | [
"attempts",
"to",
"move",
"to",
"the",
"parent",
"directory"
] | 01fbcda33eac23f4251d0448211c68dac099d156 | https://github.com/hedzr/android-file-chooser/blob/01fbcda33eac23f4251d0448211c68dac099d156/library/src/main/java/com/obsez/android/lib/filechooser/ChooserDialog.java#L1032-L1039 |
113,237 | hedzr/android-file-chooser | library/src/main/java/com/obsez/android/lib/filechooser/internals/UiUtil.java | UiUtil.getListYScroll | public static int getListYScroll(@NonNull final ListView list) {
View child = list.getChildAt(0);
return child == null ? -1
: list.getFirstVisiblePosition() * child.getHeight() - child.getTop() + list.getPaddingTop();
} | java | public static int getListYScroll(@NonNull final ListView list) {
View child = list.getChildAt(0);
return child == null ? -1
: list.getFirstVisiblePosition() * child.getHeight() - child.getTop() + list.getPaddingTop();
} | [
"public",
"static",
"int",
"getListYScroll",
"(",
"@",
"NonNull",
"final",
"ListView",
"list",
")",
"{",
"View",
"child",
"=",
"list",
".",
"getChildAt",
"(",
"0",
")",
";",
"return",
"child",
"==",
"null",
"?",
"-",
"1",
":",
"list",
".",
"getFirstVis... | This only works assuming that all list items have the same height! | [
"This",
"only",
"works",
"assuming",
"that",
"all",
"list",
"items",
"have",
"the",
"same",
"height!"
] | 01fbcda33eac23f4251d0448211c68dac099d156 | https://github.com/hedzr/android-file-chooser/blob/01fbcda33eac23f4251d0448211c68dac099d156/library/src/main/java/com/obsez/android/lib/filechooser/internals/UiUtil.java#L74-L78 |
113,238 | stripe/stripe-java | src/main/java/com/stripe/model/Event.java | Event.retrieve | public static Event retrieve(String id, RequestOptions options) throws StripeException {
return retrieve(id, null, options);
} | java | public static Event retrieve(String id, RequestOptions options) throws StripeException {
return retrieve(id, null, options);
} | [
"public",
"static",
"Event",
"retrieve",
"(",
"String",
"id",
",",
"RequestOptions",
"options",
")",
"throws",
"StripeException",
"{",
"return",
"retrieve",
"(",
"id",
",",
"null",
",",
"options",
")",
";",
"}"
] | Retrieves the details of an event. Supply the unique identifier of the event, which you might
have received in a webhook. | [
"Retrieves",
"the",
"details",
"of",
"an",
"event",
".",
"Supply",
"the",
"unique",
"identifier",
"of",
"the",
"event",
"which",
"you",
"might",
"have",
"received",
"in",
"a",
"webhook",
"."
] | acfa8becef3e73bfe3e9d8880bea3f3f30dadeac | https://github.com/stripe/stripe-java/blob/acfa8becef3e73bfe3e9d8880bea3f3f30dadeac/src/main/java/com/stripe/model/Event.java#L152-L154 |
113,239 | stripe/stripe-java | src/main/java/com/stripe/model/Customer.java | Customer.retrieve | public static Customer retrieve(String customer) throws StripeException {
return retrieve(customer, (Map<String, Object>) null, (RequestOptions) null);
} | java | public static Customer retrieve(String customer) throws StripeException {
return retrieve(customer, (Map<String, Object>) null, (RequestOptions) null);
} | [
"public",
"static",
"Customer",
"retrieve",
"(",
"String",
"customer",
")",
"throws",
"StripeException",
"{",
"return",
"retrieve",
"(",
"customer",
",",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
")",
"null",
",",
"(",
"RequestOptions",
")",
"null",
"... | Retrieves the details of an existing customer. You need only supply the unique customer
identifier that was returned upon customer creation. | [
"Retrieves",
"the",
"details",
"of",
"an",
"existing",
"customer",
".",
"You",
"need",
"only",
"supply",
"the",
"unique",
"customer",
"identifier",
"that",
"was",
"returned",
"upon",
"customer",
"creation",
"."
] | acfa8becef3e73bfe3e9d8880bea3f3f30dadeac | https://github.com/stripe/stripe-java/blob/acfa8becef3e73bfe3e9d8880bea3f3f30dadeac/src/main/java/com/stripe/model/Customer.java#L249-L251 |
113,240 | stripe/stripe-java | src/main/java/com/stripe/model/Customer.java | Customer.deleteDiscount | public Discount deleteDiscount() throws StripeException {
return deleteDiscount((Map<String, Object>) null, (RequestOptions) null);
} | java | public Discount deleteDiscount() throws StripeException {
return deleteDiscount((Map<String, Object>) null, (RequestOptions) null);
} | [
"public",
"Discount",
"deleteDiscount",
"(",
")",
"throws",
"StripeException",
"{",
"return",
"deleteDiscount",
"(",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
")",
"null",
",",
"(",
"RequestOptions",
")",
"null",
")",
";",
"}"
] | Removes the currently applied discount on a customer. | [
"Removes",
"the",
"currently",
"applied",
"discount",
"on",
"a",
"customer",
"."
] | acfa8becef3e73bfe3e9d8880bea3f3f30dadeac | https://github.com/stripe/stripe-java/blob/acfa8becef3e73bfe3e9d8880bea3f3f30dadeac/src/main/java/com/stripe/model/Customer.java#L415-L417 |
113,241 | stripe/stripe-java | src/main/java/com/stripe/model/ExpandableFieldSerializer.java | ExpandableFieldSerializer.serialize | @Override
public JsonElement serialize(ExpandableField<?> src, Type typeOfSrc,
JsonSerializationContext context) {
if (src.isExpanded()) {
return context.serialize(src.getExpanded());
} else if (src.getId() != null) {
return new JsonPrimitive(src.getId());
} else {
return null;
... | java | @Override
public JsonElement serialize(ExpandableField<?> src, Type typeOfSrc,
JsonSerializationContext context) {
if (src.isExpanded()) {
return context.serialize(src.getExpanded());
} else if (src.getId() != null) {
return new JsonPrimitive(src.getId());
} else {
return null;
... | [
"@",
"Override",
"public",
"JsonElement",
"serialize",
"(",
"ExpandableField",
"<",
"?",
">",
"src",
",",
"Type",
"typeOfSrc",
",",
"JsonSerializationContext",
"context",
")",
"{",
"if",
"(",
"src",
".",
"isExpanded",
"(",
")",
")",
"{",
"return",
"context",... | Serializes an expandable attribute into a JSON string. | [
"Serializes",
"an",
"expandable",
"attribute",
"into",
"a",
"JSON",
"string",
"."
] | acfa8becef3e73bfe3e9d8880bea3f3f30dadeac | https://github.com/stripe/stripe-java/blob/acfa8becef3e73bfe3e9d8880bea3f3f30dadeac/src/main/java/com/stripe/model/ExpandableFieldSerializer.java#L14-L24 |
113,242 | stripe/stripe-java | src/main/java/com/stripe/model/TaxRate.java | TaxRate.retrieve | public static TaxRate retrieve(String taxRate) throws StripeException {
return retrieve(taxRate, (Map<String, Object>) null, (RequestOptions) null);
} | java | public static TaxRate retrieve(String taxRate) throws StripeException {
return retrieve(taxRate, (Map<String, Object>) null, (RequestOptions) null);
} | [
"public",
"static",
"TaxRate",
"retrieve",
"(",
"String",
"taxRate",
")",
"throws",
"StripeException",
"{",
"return",
"retrieve",
"(",
"taxRate",
",",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
")",
"null",
",",
"(",
"RequestOptions",
")",
"null",
")",... | Retrieves a tax rate with the given ID. | [
"Retrieves",
"a",
"tax",
"rate",
"with",
"the",
"given",
"ID",
"."
] | acfa8becef3e73bfe3e9d8880bea3f3f30dadeac | https://github.com/stripe/stripe-java/blob/acfa8becef3e73bfe3e9d8880bea3f3f30dadeac/src/main/java/com/stripe/model/TaxRate.java#L122-L124 |
113,243 | stripe/stripe-java | src/main/java/com/stripe/model/TaxRate.java | TaxRate.create | public static TaxRate create(TaxRateCreateParams params, RequestOptions options)
throws StripeException {
String url = String.format("%s%s", Stripe.getApiBase(), "/v1/tax_rates");
return request(ApiResource.RequestMethod.POST, url, params, TaxRate.class, options);
} | java | public static TaxRate create(TaxRateCreateParams params, RequestOptions options)
throws StripeException {
String url = String.format("%s%s", Stripe.getApiBase(), "/v1/tax_rates");
return request(ApiResource.RequestMethod.POST, url, params, TaxRate.class, options);
} | [
"public",
"static",
"TaxRate",
"create",
"(",
"TaxRateCreateParams",
"params",
",",
"RequestOptions",
"options",
")",
"throws",
"StripeException",
"{",
"String",
"url",
"=",
"String",
".",
"format",
"(",
"\"%s%s\"",
",",
"Stripe",
".",
"getApiBase",
"(",
")",
... | Creates a new tax rate. | [
"Creates",
"a",
"new",
"tax",
"rate",
"."
] | acfa8becef3e73bfe3e9d8880bea3f3f30dadeac | https://github.com/stripe/stripe-java/blob/acfa8becef3e73bfe3e9d8880bea3f3f30dadeac/src/main/java/com/stripe/model/TaxRate.java#L171-L175 |
113,244 | stripe/stripe-java | src/main/java/com/stripe/model/TaxRate.java | TaxRate.update | @Override
public TaxRate update(Map<String, Object> params) throws StripeException {
return update(params, (RequestOptions) null);
} | java | @Override
public TaxRate update(Map<String, Object> params) throws StripeException {
return update(params, (RequestOptions) null);
} | [
"@",
"Override",
"public",
"TaxRate",
"update",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"params",
")",
"throws",
"StripeException",
"{",
"return",
"update",
"(",
"params",
",",
"(",
"RequestOptions",
")",
"null",
")",
";",
"}"
] | Updates an existing tax rate. | [
"Updates",
"an",
"existing",
"tax",
"rate",
"."
] | acfa8becef3e73bfe3e9d8880bea3f3f30dadeac | https://github.com/stripe/stripe-java/blob/acfa8becef3e73bfe3e9d8880bea3f3f30dadeac/src/main/java/com/stripe/model/TaxRate.java#L178-L181 |
113,245 | stripe/stripe-java | src/main/java/com/stripe/model/Dispute.java | Dispute.retrieve | public static Dispute retrieve(String dispute) throws StripeException {
return retrieve(dispute, (Map<String, Object>) null, (RequestOptions) null);
} | java | public static Dispute retrieve(String dispute) throws StripeException {
return retrieve(dispute, (Map<String, Object>) null, (RequestOptions) null);
} | [
"public",
"static",
"Dispute",
"retrieve",
"(",
"String",
"dispute",
")",
"throws",
"StripeException",
"{",
"return",
"retrieve",
"(",
"dispute",
",",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
")",
"null",
",",
"(",
"RequestOptions",
")",
"null",
")",... | Retrieves the dispute with the given ID. | [
"Retrieves",
"the",
"dispute",
"with",
"the",
"given",
"ID",
"."
] | acfa8becef3e73bfe3e9d8880bea3f3f30dadeac | https://github.com/stripe/stripe-java/blob/acfa8becef3e73bfe3e9d8880bea3f3f30dadeac/src/main/java/com/stripe/model/Dispute.java#L159-L161 |
113,246 | stripe/stripe-java | src/main/java/com/stripe/model/Dispute.java | Dispute.close | public Dispute close() throws StripeException {
return close((Map<String, Object>) null, (RequestOptions) null);
} | java | public Dispute close() throws StripeException {
return close((Map<String, Object>) null, (RequestOptions) null);
} | [
"public",
"Dispute",
"close",
"(",
")",
"throws",
"StripeException",
"{",
"return",
"close",
"(",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
")",
"null",
",",
"(",
"RequestOptions",
")",
"null",
")",
";",
"}"
] | Closing the dispute for a charge indicates that you do not have any evidence to submit and are
essentially dismissing the dispute, acknowledging it as lost.
<p>The status of the dispute will change from <code>needs_response</code> to <code>lost</code>.
<em>Closing a dispute is irreversible</em>. | [
"Closing",
"the",
"dispute",
"for",
"a",
"charge",
"indicates",
"that",
"you",
"do",
"not",
"have",
"any",
"evidence",
"to",
"submit",
"and",
"are",
"essentially",
"dismissing",
"the",
"dispute",
"acknowledging",
"it",
"as",
"lost",
"."
] | acfa8becef3e73bfe3e9d8880bea3f3f30dadeac | https://github.com/stripe/stripe-java/blob/acfa8becef3e73bfe3e9d8880bea3f3f30dadeac/src/main/java/com/stripe/model/Dispute.java#L265-L267 |
113,247 | stripe/stripe-java | src/main/java/com/stripe/model/IssuerFraudRecord.java | IssuerFraudRecord.retrieve | public static IssuerFraudRecord retrieve(String issuerFraudRecord) throws StripeException {
return retrieve(issuerFraudRecord, (Map<String, Object>) null, (RequestOptions) null);
} | java | public static IssuerFraudRecord retrieve(String issuerFraudRecord) throws StripeException {
return retrieve(issuerFraudRecord, (Map<String, Object>) null, (RequestOptions) null);
} | [
"public",
"static",
"IssuerFraudRecord",
"retrieve",
"(",
"String",
"issuerFraudRecord",
")",
"throws",
"StripeException",
"{",
"return",
"retrieve",
"(",
"issuerFraudRecord",
",",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
")",
"null",
",",
"(",
"RequestOpt... | Retrieves the details of an issuer fraud record that has previously been created.
<p>Please refer to the <a href="#issuer_fraud_record_object">issuer fraud record</a> object
reference for more details. | [
"Retrieves",
"the",
"details",
"of",
"an",
"issuer",
"fraud",
"record",
"that",
"has",
"previously",
"been",
"created",
"."
] | acfa8becef3e73bfe3e9d8880bea3f3f30dadeac | https://github.com/stripe/stripe-java/blob/acfa8becef3e73bfe3e9d8880bea3f3f30dadeac/src/main/java/com/stripe/model/IssuerFraudRecord.java#L124-L126 |
113,248 | stripe/stripe-java | src/main/java/com/stripe/model/WebhookEndpoint.java | WebhookEndpoint.retrieve | public static WebhookEndpoint retrieve(String webhookEndpoint) throws StripeException {
return retrieve(webhookEndpoint, (Map<String, Object>) null, (RequestOptions) null);
} | java | public static WebhookEndpoint retrieve(String webhookEndpoint) throws StripeException {
return retrieve(webhookEndpoint, (Map<String, Object>) null, (RequestOptions) null);
} | [
"public",
"static",
"WebhookEndpoint",
"retrieve",
"(",
"String",
"webhookEndpoint",
")",
"throws",
"StripeException",
"{",
"return",
"retrieve",
"(",
"webhookEndpoint",
",",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
")",
"null",
",",
"(",
"RequestOptions",... | Retrieves the webhook endpoint with the given ID. | [
"Retrieves",
"the",
"webhook",
"endpoint",
"with",
"the",
"given",
"ID",
"."
] | acfa8becef3e73bfe3e9d8880bea3f3f30dadeac | https://github.com/stripe/stripe-java/blob/acfa8becef3e73bfe3e9d8880bea3f3f30dadeac/src/main/java/com/stripe/model/WebhookEndpoint.java#L103-L105 |
113,249 | stripe/stripe-java | src/main/java/com/stripe/model/SubscriptionSchedule.java | SubscriptionSchedule.retrieve | public static SubscriptionSchedule retrieve(String schedule) throws StripeException {
return retrieve(schedule, (Map<String, Object>) null, (RequestOptions) null);
} | java | public static SubscriptionSchedule retrieve(String schedule) throws StripeException {
return retrieve(schedule, (Map<String, Object>) null, (RequestOptions) null);
} | [
"public",
"static",
"SubscriptionSchedule",
"retrieve",
"(",
"String",
"schedule",
")",
"throws",
"StripeException",
"{",
"return",
"retrieve",
"(",
"schedule",
",",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
")",
"null",
",",
"(",
"RequestOptions",
")",
... | Retrieves the details of an existing subscription schedule. You only need to supply the unique
subscription schedule identifier that was returned upon subscription schedule creation. | [
"Retrieves",
"the",
"details",
"of",
"an",
"existing",
"subscription",
"schedule",
".",
"You",
"only",
"need",
"to",
"supply",
"the",
"unique",
"subscription",
"schedule",
"identifier",
"that",
"was",
"returned",
"upon",
"subscription",
"schedule",
"creation",
"."... | acfa8becef3e73bfe3e9d8880bea3f3f30dadeac | https://github.com/stripe/stripe-java/blob/acfa8becef3e73bfe3e9d8880bea3f3f30dadeac/src/main/java/com/stripe/model/SubscriptionSchedule.java#L236-L238 |
113,250 | stripe/stripe-java | src/main/java/com/stripe/model/LoginLink.java | LoginLink.createOnAccount | public static LoginLink createOnAccount(
String account, Map<String, Object> params, RequestOptions options) throws StripeException {
String url =
String.format(
"%s%s",
Stripe.getApiBase(),
String.format("/v1/accounts/%s/login_links", ApiResource.urlEncodeId(accoun... | java | public static LoginLink createOnAccount(
String account, Map<String, Object> params, RequestOptions options) throws StripeException {
String url =
String.format(
"%s%s",
Stripe.getApiBase(),
String.format("/v1/accounts/%s/login_links", ApiResource.urlEncodeId(accoun... | [
"public",
"static",
"LoginLink",
"createOnAccount",
"(",
"String",
"account",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"params",
",",
"RequestOptions",
"options",
")",
"throws",
"StripeException",
"{",
"String",
"url",
"=",
"String",
".",
"format",
"(",
... | Creates a single-use login link for an Express account to access their Stripe dashboard.
<p><strong>You may only create login links for <a href="/docs/connect/express-accounts">Express
accounts</a> connected to your platform</strong>. | [
"Creates",
"a",
"single",
"-",
"use",
"login",
"link",
"for",
"an",
"Express",
"account",
"to",
"access",
"their",
"Stripe",
"dashboard",
"."
] | acfa8becef3e73bfe3e9d8880bea3f3f30dadeac | https://github.com/stripe/stripe-java/blob/acfa8becef3e73bfe3e9d8880bea3f3f30dadeac/src/main/java/com/stripe/model/LoginLink.java#L38-L46 |
113,251 | stripe/stripe-java | src/main/java/com/stripe/model/checkout/Session.java | Session.retrieve | public static Session retrieve(String session) throws StripeException {
return retrieve(session, (Map<String, Object>) null, (RequestOptions) null);
} | java | public static Session retrieve(String session) throws StripeException {
return retrieve(session, (Map<String, Object>) null, (RequestOptions) null);
} | [
"public",
"static",
"Session",
"retrieve",
"(",
"String",
"session",
")",
"throws",
"StripeException",
"{",
"return",
"retrieve",
"(",
"session",
",",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
")",
"null",
",",
"(",
"RequestOptions",
")",
"null",
")",... | Retrieves a Session object. | [
"Retrieves",
"a",
"Session",
"object",
"."
] | acfa8becef3e73bfe3e9d8880bea3f3f30dadeac | https://github.com/stripe/stripe-java/blob/acfa8becef3e73bfe3e9d8880bea3f3f30dadeac/src/main/java/com/stripe/model/checkout/Session.java#L177-L179 |
113,252 | stripe/stripe-java | src/main/java/com/stripe/model/sigma/ScheduledQueryRun.java | ScheduledQueryRun.retrieve | public static ScheduledQueryRun retrieve(String scheduledQueryRun) throws StripeException {
return retrieve(scheduledQueryRun, (Map<String, Object>) null, (RequestOptions) null);
} | java | public static ScheduledQueryRun retrieve(String scheduledQueryRun) throws StripeException {
return retrieve(scheduledQueryRun, (Map<String, Object>) null, (RequestOptions) null);
} | [
"public",
"static",
"ScheduledQueryRun",
"retrieve",
"(",
"String",
"scheduledQueryRun",
")",
"throws",
"StripeException",
"{",
"return",
"retrieve",
"(",
"scheduledQueryRun",
",",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
")",
"null",
",",
"(",
"RequestOpt... | Retrieves the details of an scheduled query run. | [
"Retrieves",
"the",
"details",
"of",
"an",
"scheduled",
"query",
"run",
"."
] | acfa8becef3e73bfe3e9d8880bea3f3f30dadeac | https://github.com/stripe/stripe-java/blob/acfa8becef3e73bfe3e9d8880bea3f3f30dadeac/src/main/java/com/stripe/model/sigma/ScheduledQueryRun.java#L101-L103 |
113,253 | stripe/stripe-java | src/main/java/com/stripe/model/Source.java | Source.retrieve | public static Source retrieve(String source) throws StripeException {
return retrieve(source, (Map<String, Object>) null, (RequestOptions) null);
} | java | public static Source retrieve(String source) throws StripeException {
return retrieve(source, (Map<String, Object>) null, (RequestOptions) null);
} | [
"public",
"static",
"Source",
"retrieve",
"(",
"String",
"source",
")",
"throws",
"StripeException",
"{",
"return",
"retrieve",
"(",
"source",
",",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
")",
"null",
",",
"(",
"RequestOptions",
")",
"null",
")",
... | Retrieves an existing source object. Supply the unique source ID from a source creation request
and Stripe will return the corresponding up-to-date source object information. | [
"Retrieves",
"an",
"existing",
"source",
"object",
".",
"Supply",
"the",
"unique",
"source",
"ID",
"from",
"a",
"source",
"creation",
"request",
"and",
"Stripe",
"will",
"return",
"the",
"corresponding",
"up",
"-",
"to",
"-",
"date",
"source",
"object",
"inf... | acfa8becef3e73bfe3e9d8880bea3f3f30dadeac | https://github.com/stripe/stripe-java/blob/acfa8becef3e73bfe3e9d8880bea3f3f30dadeac/src/main/java/com/stripe/model/Source.java#L222-L224 |
113,254 | stripe/stripe-java | src/main/java/com/stripe/model/Source.java | Source.verify | public Source verify(Map<String, Object> params) throws StripeException {
return verify(params, (RequestOptions) null);
} | java | public Source verify(Map<String, Object> params) throws StripeException {
return verify(params, (RequestOptions) null);
} | [
"public",
"Source",
"verify",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"params",
")",
"throws",
"StripeException",
"{",
"return",
"verify",
"(",
"params",
",",
"(",
"RequestOptions",
")",
"null",
")",
";",
"}"
] | Verify a given source. | [
"Verify",
"a",
"given",
"source",
"."
] | acfa8becef3e73bfe3e9d8880bea3f3f30dadeac | https://github.com/stripe/stripe-java/blob/acfa8becef3e73bfe3e9d8880bea3f3f30dadeac/src/main/java/com/stripe/model/Source.java#L345-L347 |
113,255 | stripe/stripe-java | src/main/java/com/stripe/model/Account.java | Account.retrieve | public static Account retrieve(RequestOptions options) throws StripeException {
return retrieve((Map<String, Object>) null, options);
} | java | public static Account retrieve(RequestOptions options) throws StripeException {
return retrieve((Map<String, Object>) null, options);
} | [
"public",
"static",
"Account",
"retrieve",
"(",
"RequestOptions",
"options",
")",
"throws",
"StripeException",
"{",
"return",
"retrieve",
"(",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
")",
"null",
",",
"options",
")",
";",
"}"
] | Retrieves the details of an account. | [
"Retrieves",
"the",
"details",
"of",
"an",
"account",
"."
] | acfa8becef3e73bfe3e9d8880bea3f3f30dadeac | https://github.com/stripe/stripe-java/blob/acfa8becef3e73bfe3e9d8880bea3f3f30dadeac/src/main/java/com/stripe/model/Account.java#L122-L124 |
113,256 | stripe/stripe-java | src/main/java/com/stripe/model/Payout.java | Payout.retrieve | public static Payout retrieve(String payout) throws StripeException {
return retrieve(payout, (Map<String, Object>) null, (RequestOptions) null);
} | java | public static Payout retrieve(String payout) throws StripeException {
return retrieve(payout, (Map<String, Object>) null, (RequestOptions) null);
} | [
"public",
"static",
"Payout",
"retrieve",
"(",
"String",
"payout",
")",
"throws",
"StripeException",
"{",
"return",
"retrieve",
"(",
"payout",
",",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
")",
"null",
",",
"(",
"RequestOptions",
")",
"null",
")",
... | Retrieves the details of an existing payout. Supply the unique payout ID from either a payout
creation request or the payout list, and Stripe will return the corresponding payout
information. | [
"Retrieves",
"the",
"details",
"of",
"an",
"existing",
"payout",
".",
"Supply",
"the",
"unique",
"payout",
"ID",
"from",
"either",
"a",
"payout",
"creation",
"request",
"or",
"the",
"payout",
"list",
"and",
"Stripe",
"will",
"return",
"the",
"corresponding",
... | acfa8becef3e73bfe3e9d8880bea3f3f30dadeac | https://github.com/stripe/stripe-java/blob/acfa8becef3e73bfe3e9d8880bea3f3f30dadeac/src/main/java/com/stripe/model/Payout.java#L211-L213 |
113,257 | stripe/stripe-java | src/main/java/com/stripe/net/StripeHeaders.java | StripeHeaders.get | public String get(String name) {
List<String> valuesList = values(name);
String value = null;
if (valuesList != null && valuesList.size() > 0) {
value = valuesList.get(0);
}
return value;
} | java | public String get(String name) {
List<String> valuesList = values(name);
String value = null;
if (valuesList != null && valuesList.size() > 0) {
value = valuesList.get(0);
}
return value;
} | [
"public",
"String",
"get",
"(",
"String",
"name",
")",
"{",
"List",
"<",
"String",
">",
"valuesList",
"=",
"values",
"(",
"name",
")",
";",
"String",
"value",
"=",
"null",
";",
"if",
"(",
"valuesList",
"!=",
"null",
"&&",
"valuesList",
".",
"size",
"... | Returns the first header value for a given key.
@param name The name of the header key
@return the first value for the given key | [
"Returns",
"the",
"first",
"header",
"value",
"for",
"a",
"given",
"key",
"."
] | acfa8becef3e73bfe3e9d8880bea3f3f30dadeac | https://github.com/stripe/stripe-java/blob/acfa8becef3e73bfe3e9d8880bea3f3f30dadeac/src/main/java/com/stripe/net/StripeHeaders.java#L19-L26 |
113,258 | stripe/stripe-java | src/main/java/com/stripe/model/UsageRecord.java | UsageRecord.createOnSubscriptionItem | public static UsageRecord createOnSubscriptionItem(
String subscriptionItem, Map<String, Object> params, RequestOptions options)
throws StripeException {
String url =
String.format(
"%s%s",
Stripe.getApiBase(),
String.format(
"/v1/subscription_... | java | public static UsageRecord createOnSubscriptionItem(
String subscriptionItem, Map<String, Object> params, RequestOptions options)
throws StripeException {
String url =
String.format(
"%s%s",
Stripe.getApiBase(),
String.format(
"/v1/subscription_... | [
"public",
"static",
"UsageRecord",
"createOnSubscriptionItem",
"(",
"String",
"subscriptionItem",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"params",
",",
"RequestOptions",
"options",
")",
"throws",
"StripeException",
"{",
"String",
"url",
"=",
"String",
".",... | Creates a usage record for a specified subscription item and date, and fills it with a
quantity.
<p>Usage records provide <code>quantity</code> information that Stripe uses to track how much a
customer is using your service. With usage information and the pricing model set up by the <a
href="https://stripe.com/docs/bi... | [
"Creates",
"a",
"usage",
"record",
"for",
"a",
"specified",
"subscription",
"item",
"and",
"date",
"and",
"fills",
"it",
"with",
"a",
"quantity",
"."
] | acfa8becef3e73bfe3e9d8880bea3f3f30dadeac | https://github.com/stripe/stripe-java/blob/acfa8becef3e73bfe3e9d8880bea3f3f30dadeac/src/main/java/com/stripe/model/UsageRecord.java#L70-L81 |
113,259 | stripe/stripe-java | src/main/java/com/stripe/model/TransferReversal.java | TransferReversal.update | @Override
public TransferReversal update(Map<String, Object> params, RequestOptions options)
throws StripeException {
String url;
if (this.getTransfer() != null) {
url =
String.format(
"%s%s",
Stripe.getApiBase(),
String.format(
... | java | @Override
public TransferReversal update(Map<String, Object> params, RequestOptions options)
throws StripeException {
String url;
if (this.getTransfer() != null) {
url =
String.format(
"%s%s",
Stripe.getApiBase(),
String.format(
... | [
"@",
"Override",
"public",
"TransferReversal",
"update",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"params",
",",
"RequestOptions",
"options",
")",
"throws",
"StripeException",
"{",
"String",
"url",
";",
"if",
"(",
"this",
".",
"getTransfer",
"(",
")",
... | Updates the specified reversal by setting the values of the parameters passed. Any parameters
not provided will be left unchanged.
<p>This request only accepts metadata and description as arguments. | [
"Updates",
"the",
"specified",
"reversal",
"by",
"setting",
"the",
"values",
"of",
"the",
"parameters",
"passed",
".",
"Any",
"parameters",
"not",
"provided",
"will",
"be",
"left",
"unchanged",
"."
] | acfa8becef3e73bfe3e9d8880bea3f3f30dadeac | https://github.com/stripe/stripe-java/blob/acfa8becef3e73bfe3e9d8880bea3f3f30dadeac/src/main/java/com/stripe/model/TransferReversal.java#L172-L195 |
113,260 | stripe/stripe-java | src/main/java/com/stripe/model/Coupon.java | Coupon.retrieve | public static Coupon retrieve(String coupon, RequestOptions options) throws StripeException {
return retrieve(coupon, (Map<String, Object>) null, options);
} | java | public static Coupon retrieve(String coupon, RequestOptions options) throws StripeException {
return retrieve(coupon, (Map<String, Object>) null, options);
} | [
"public",
"static",
"Coupon",
"retrieve",
"(",
"String",
"coupon",
",",
"RequestOptions",
"options",
")",
"throws",
"StripeException",
"{",
"return",
"retrieve",
"(",
"coupon",
",",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
")",
"null",
",",
"options",
... | Retrieves the coupon with the given ID. | [
"Retrieves",
"the",
"coupon",
"with",
"the",
"given",
"ID",
"."
] | acfa8becef3e73bfe3e9d8880bea3f3f30dadeac | https://github.com/stripe/stripe-java/blob/acfa8becef3e73bfe3e9d8880bea3f3f30dadeac/src/main/java/com/stripe/model/Coupon.java#L215-L217 |
113,261 | stripe/stripe-java | src/main/java/com/stripe/model/Topup.java | Topup.create | public static Topup create(Map<String, Object> params) throws StripeException {
return create(params, (RequestOptions) null);
} | java | public static Topup create(Map<String, Object> params) throws StripeException {
return create(params, (RequestOptions) null);
} | [
"public",
"static",
"Topup",
"create",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"params",
")",
"throws",
"StripeException",
"{",
"return",
"create",
"(",
"params",
",",
"(",
"RequestOptions",
")",
"null",
")",
";",
"}"
] | Top up the balance of an account. | [
"Top",
"up",
"the",
"balance",
"of",
"an",
"account",
"."
] | acfa8becef3e73bfe3e9d8880bea3f3f30dadeac | https://github.com/stripe/stripe-java/blob/acfa8becef3e73bfe3e9d8880bea3f3f30dadeac/src/main/java/com/stripe/model/Topup.java#L134-L136 |
113,262 | stripe/stripe-java | src/main/java/com/stripe/model/Topup.java | Topup.retrieve | public static Topup retrieve(String topup) throws StripeException {
return retrieve(topup, (Map<String, Object>) null, (RequestOptions) null);
} | java | public static Topup retrieve(String topup) throws StripeException {
return retrieve(topup, (Map<String, Object>) null, (RequestOptions) null);
} | [
"public",
"static",
"Topup",
"retrieve",
"(",
"String",
"topup",
")",
"throws",
"StripeException",
"{",
"return",
"retrieve",
"(",
"topup",
",",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
")",
"null",
",",
"(",
"RequestOptions",
")",
"null",
")",
";"... | Retrieves the details of a top-up that has previously been created. Supply the unique top-up ID
that was returned from your previous request, and Stripe will return the corresponding top-up
information. | [
"Retrieves",
"the",
"details",
"of",
"a",
"top",
"-",
"up",
"that",
"has",
"previously",
"been",
"created",
".",
"Supply",
"the",
"unique",
"top",
"-",
"up",
"ID",
"that",
"was",
"returned",
"from",
"your",
"previous",
"request",
"and",
"Stripe",
"will",
... | acfa8becef3e73bfe3e9d8880bea3f3f30dadeac | https://github.com/stripe/stripe-java/blob/acfa8becef3e73bfe3e9d8880bea3f3f30dadeac/src/main/java/com/stripe/model/Topup.java#L186-L188 |
113,263 | stripe/stripe-java | src/main/java/com/stripe/model/CountrySpec.java | CountrySpec.retrieve | public static CountrySpec retrieve(String country) throws StripeException {
return retrieve(country, (Map<String, Object>) null, (RequestOptions) null);
} | java | public static CountrySpec retrieve(String country) throws StripeException {
return retrieve(country, (Map<String, Object>) null, (RequestOptions) null);
} | [
"public",
"static",
"CountrySpec",
"retrieve",
"(",
"String",
"country",
")",
"throws",
"StripeException",
"{",
"return",
"retrieve",
"(",
"country",
",",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
")",
"null",
",",
"(",
"RequestOptions",
")",
"null",
... | Returns a Country Spec for a given Country code. | [
"Returns",
"a",
"Country",
"Spec",
"for",
"a",
"given",
"Country",
"code",
"."
] | acfa8becef3e73bfe3e9d8880bea3f3f30dadeac | https://github.com/stripe/stripe-java/blob/acfa8becef3e73bfe3e9d8880bea3f3f30dadeac/src/main/java/com/stripe/model/CountrySpec.java#L86-L88 |
113,264 | stripe/stripe-java | src/main/java/com/stripe/model/PaymentIntent.java | PaymentIntent.retrieve | public static PaymentIntent retrieve(String intent) throws StripeException {
return retrieve(intent, (Map<String, Object>) null, (RequestOptions) null);
} | java | public static PaymentIntent retrieve(String intent) throws StripeException {
return retrieve(intent, (Map<String, Object>) null, (RequestOptions) null);
} | [
"public",
"static",
"PaymentIntent",
"retrieve",
"(",
"String",
"intent",
")",
"throws",
"StripeException",
"{",
"return",
"retrieve",
"(",
"intent",
",",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
")",
"null",
",",
"(",
"RequestOptions",
")",
"null",
... | Retrieves the details of a PaymentIntent that has previously been created.
<p>Client-side retrieval using a publishable key is allowed when the <code>client_secret</code>
is provided in the query string.
<p>When retrieved with a publishable key, only a subset of properties will be returned. Please
refer to the <a hre... | [
"Retrieves",
"the",
"details",
"of",
"a",
"PaymentIntent",
"that",
"has",
"previously",
"been",
"created",
"."
] | acfa8becef3e73bfe3e9d8880bea3f3f30dadeac | https://github.com/stripe/stripe-java/blob/acfa8becef3e73bfe3e9d8880bea3f3f30dadeac/src/main/java/com/stripe/model/PaymentIntent.java#L407-L409 |
113,265 | stripe/stripe-java | src/main/java/com/stripe/model/PaymentIntent.java | PaymentIntent.confirm | public PaymentIntent confirm() throws StripeException {
return confirm((Map<String, Object>) null, (RequestOptions) null);
} | java | public PaymentIntent confirm() throws StripeException {
return confirm((Map<String, Object>) null, (RequestOptions) null);
} | [
"public",
"PaymentIntent",
"confirm",
"(",
")",
"throws",
"StripeException",
"{",
"return",
"confirm",
"(",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
")",
"null",
",",
"(",
"RequestOptions",
")",
"null",
")",
";",
"}"
] | Confirm that your customer intends to pay with current or provided payment method. Upon
confirmation, the PaymentIntent will attempt to initiate a payment.
<p>If the selected payment method requires additional authentication steps, the PaymentIntent
will transition to the <code>requires_action</code> status and sugges... | [
"Confirm",
"that",
"your",
"customer",
"intends",
"to",
"pay",
"with",
"current",
"or",
"provided",
"payment",
"method",
".",
"Upon",
"confirmation",
"the",
"PaymentIntent",
"will",
"attempt",
"to",
"initiate",
"a",
"payment",
"."
] | acfa8becef3e73bfe3e9d8880bea3f3f30dadeac | https://github.com/stripe/stripe-java/blob/acfa8becef3e73bfe3e9d8880bea3f3f30dadeac/src/main/java/com/stripe/model/PaymentIntent.java#L526-L528 |
113,266 | stripe/stripe-java | src/main/java/com/stripe/model/Invoice.java | Invoice.upcoming | public static Invoice upcoming() throws StripeException {
return upcoming((Map<String, Object>) null, (RequestOptions) null);
} | java | public static Invoice upcoming() throws StripeException {
return upcoming((Map<String, Object>) null, (RequestOptions) null);
} | [
"public",
"static",
"Invoice",
"upcoming",
"(",
")",
"throws",
"StripeException",
"{",
"return",
"upcoming",
"(",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
")",
"null",
",",
"(",
"RequestOptions",
")",
"null",
")",
";",
"}"
] | At any time, you can preview the upcoming invoice for a customer. This will show you all the
charges that are pending, including subscription renewal charges, invoice item charges, etc. It
will also show you any discount that is applicable to the customer.
<p>Note that when you are viewing an upcoming invoice, you are... | [
"At",
"any",
"time",
"you",
"can",
"preview",
"the",
"upcoming",
"invoice",
"for",
"a",
"customer",
".",
"This",
"will",
"show",
"you",
"all",
"the",
"charges",
"that",
"are",
"pending",
"including",
"subscription",
"renewal",
"charges",
"invoice",
"item",
"... | acfa8becef3e73bfe3e9d8880bea3f3f30dadeac | https://github.com/stripe/stripe-java/blob/acfa8becef3e73bfe3e9d8880bea3f3f30dadeac/src/main/java/com/stripe/model/Invoice.java#L590-L592 |
113,267 | stripe/stripe-java | src/main/java/com/stripe/model/Invoice.java | Invoice.retrieve | public static Invoice retrieve(String invoice) throws StripeException {
return retrieve(invoice, (Map<String, Object>) null, (RequestOptions) null);
} | java | public static Invoice retrieve(String invoice) throws StripeException {
return retrieve(invoice, (Map<String, Object>) null, (RequestOptions) null);
} | [
"public",
"static",
"Invoice",
"retrieve",
"(",
"String",
"invoice",
")",
"throws",
"StripeException",
"{",
"return",
"retrieve",
"(",
"invoice",
",",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
")",
"null",
",",
"(",
"RequestOptions",
")",
"null",
")",... | Retrieves the invoice with the given ID. | [
"Retrieves",
"the",
"invoice",
"with",
"the",
"given",
"ID",
"."
] | acfa8becef3e73bfe3e9d8880bea3f3f30dadeac | https://github.com/stripe/stripe-java/blob/acfa8becef3e73bfe3e9d8880bea3f3f30dadeac/src/main/java/com/stripe/model/Invoice.java#L731-L733 |
113,268 | stripe/stripe-java | src/main/java/com/stripe/model/Invoice.java | Invoice.markUncollectible | public Invoice markUncollectible() throws StripeException {
return markUncollectible((Map<String, Object>) null, (RequestOptions) null);
} | java | public Invoice markUncollectible() throws StripeException {
return markUncollectible((Map<String, Object>) null, (RequestOptions) null);
} | [
"public",
"Invoice",
"markUncollectible",
"(",
")",
"throws",
"StripeException",
"{",
"return",
"markUncollectible",
"(",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
")",
"null",
",",
"(",
"RequestOptions",
")",
"null",
")",
";",
"}"
] | Marking an invoice as uncollectible is useful for keeping track of bad debts that can be
written off for accounting purposes. | [
"Marking",
"an",
"invoice",
"as",
"uncollectible",
"is",
"useful",
"for",
"keeping",
"track",
"of",
"bad",
"debts",
"that",
"can",
"be",
"written",
"off",
"for",
"accounting",
"purposes",
"."
] | acfa8becef3e73bfe3e9d8880bea3f3f30dadeac | https://github.com/stripe/stripe-java/blob/acfa8becef3e73bfe3e9d8880bea3f3f30dadeac/src/main/java/com/stripe/model/Invoice.java#L1107-L1109 |
113,269 | stripe/stripe-java | src/main/java/com/stripe/model/Charge.java | Charge.retrieve | public static Charge retrieve(String charge) throws StripeException {
return retrieve(charge, (Map<String, Object>) null, (RequestOptions) null);
} | java | public static Charge retrieve(String charge) throws StripeException {
return retrieve(charge, (Map<String, Object>) null, (RequestOptions) null);
} | [
"public",
"static",
"Charge",
"retrieve",
"(",
"String",
"charge",
")",
"throws",
"StripeException",
"{",
"return",
"retrieve",
"(",
"charge",
",",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
")",
"null",
",",
"(",
"RequestOptions",
")",
"null",
")",
... | Retrieves the details of a charge that has previously been created. Supply the unique charge ID
that was returned from your previous request, and Stripe will return the corresponding charge
information. The same information is returned when creating or refunding the charge. | [
"Retrieves",
"the",
"details",
"of",
"a",
"charge",
"that",
"has",
"previously",
"been",
"created",
".",
"Supply",
"the",
"unique",
"charge",
"ID",
"that",
"was",
"returned",
"from",
"your",
"previous",
"request",
"and",
"Stripe",
"will",
"return",
"the",
"c... | acfa8becef3e73bfe3e9d8880bea3f3f30dadeac | https://github.com/stripe/stripe-java/blob/acfa8becef3e73bfe3e9d8880bea3f3f30dadeac/src/main/java/com/stripe/model/Charge.java#L609-L611 |
113,270 | stripe/stripe-java | src/main/java/com/stripe/model/ExchangeRate.java | ExchangeRate.retrieve | public static ExchangeRate retrieve(String currency) throws StripeException {
return retrieve(currency, (Map<String, Object>) null, (RequestOptions) null);
} | java | public static ExchangeRate retrieve(String currency) throws StripeException {
return retrieve(currency, (Map<String, Object>) null, (RequestOptions) null);
} | [
"public",
"static",
"ExchangeRate",
"retrieve",
"(",
"String",
"currency",
")",
"throws",
"StripeException",
"{",
"return",
"retrieve",
"(",
"currency",
",",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
")",
"null",
",",
"(",
"RequestOptions",
")",
"null",... | Retrieves the exchange rates from the given currency to every supported currency. | [
"Retrieves",
"the",
"exchange",
"rates",
"from",
"the",
"given",
"currency",
"to",
"every",
"supported",
"currency",
"."
] | acfa8becef3e73bfe3e9d8880bea3f3f30dadeac | https://github.com/stripe/stripe-java/blob/acfa8becef3e73bfe3e9d8880bea3f3f30dadeac/src/main/java/com/stripe/model/ExchangeRate.java#L78-L80 |
113,271 | stripe/stripe-java | src/main/java/com/stripe/model/ThreeDSecure.java | ThreeDSecure.retrieve | public static ThreeDSecure retrieve(String threeDSecure) throws StripeException {
return retrieve(threeDSecure, (Map<String, Object>) null, (RequestOptions) null);
} | java | public static ThreeDSecure retrieve(String threeDSecure) throws StripeException {
return retrieve(threeDSecure, (Map<String, Object>) null, (RequestOptions) null);
} | [
"public",
"static",
"ThreeDSecure",
"retrieve",
"(",
"String",
"threeDSecure",
")",
"throws",
"StripeException",
"{",
"return",
"retrieve",
"(",
"threeDSecure",
",",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
")",
"null",
",",
"(",
"RequestOptions",
")",
... | Retrieves a 3D Secure object. | [
"Retrieves",
"a",
"3D",
"Secure",
"object",
"."
] | acfa8becef3e73bfe3e9d8880bea3f3f30dadeac | https://github.com/stripe/stripe-java/blob/acfa8becef3e73bfe3e9d8880bea3f3f30dadeac/src/main/java/com/stripe/model/ThreeDSecure.java#L80-L82 |
113,272 | stripe/stripe-java | src/main/java/com/stripe/model/PaymentMethod.java | PaymentMethod.retrieve | public static PaymentMethod retrieve(String paymentMethod, RequestOptions options)
throws StripeException {
return retrieve(paymentMethod, (Map<String, Object>) null, options);
} | java | public static PaymentMethod retrieve(String paymentMethod, RequestOptions options)
throws StripeException {
return retrieve(paymentMethod, (Map<String, Object>) null, options);
} | [
"public",
"static",
"PaymentMethod",
"retrieve",
"(",
"String",
"paymentMethod",
",",
"RequestOptions",
"options",
")",
"throws",
"StripeException",
"{",
"return",
"retrieve",
"(",
"paymentMethod",
",",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
")",
"null",... | Retrieves a PaymentMethod object. | [
"Retrieves",
"a",
"PaymentMethod",
"object",
"."
] | acfa8becef3e73bfe3e9d8880bea3f3f30dadeac | https://github.com/stripe/stripe-java/blob/acfa8becef3e73bfe3e9d8880bea3f3f30dadeac/src/main/java/com/stripe/model/PaymentMethod.java#L143-L146 |
113,273 | stripe/stripe-java | src/main/java/com/stripe/model/PaymentMethod.java | PaymentMethod.attach | public PaymentMethod attach(Map<String, Object> params) throws StripeException {
return attach(params, (RequestOptions) null);
} | java | public PaymentMethod attach(Map<String, Object> params) throws StripeException {
return attach(params, (RequestOptions) null);
} | [
"public",
"PaymentMethod",
"attach",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"params",
")",
"throws",
"StripeException",
"{",
"return",
"attach",
"(",
"params",
",",
"(",
"RequestOptions",
")",
"null",
")",
";",
"}"
] | Attaches a PaymentMethod object to a Customer. | [
"Attaches",
"a",
"PaymentMethod",
"object",
"to",
"a",
"Customer",
"."
] | acfa8becef3e73bfe3e9d8880bea3f3f30dadeac | https://github.com/stripe/stripe-java/blob/acfa8becef3e73bfe3e9d8880bea3f3f30dadeac/src/main/java/com/stripe/model/PaymentMethod.java#L232-L234 |
113,274 | stripe/stripe-java | src/main/java/com/stripe/model/PaymentMethod.java | PaymentMethod.detach | public PaymentMethod detach(RequestOptions options) throws StripeException {
return detach((Map<String, Object>) null, options);
} | java | public PaymentMethod detach(RequestOptions options) throws StripeException {
return detach((Map<String, Object>) null, options);
} | [
"public",
"PaymentMethod",
"detach",
"(",
"RequestOptions",
"options",
")",
"throws",
"StripeException",
"{",
"return",
"detach",
"(",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
")",
"null",
",",
"options",
")",
";",
"}"
] | Detaches a PaymentMethod object from a Customer. | [
"Detaches",
"a",
"PaymentMethod",
"object",
"from",
"a",
"Customer",
"."
] | acfa8becef3e73bfe3e9d8880bea3f3f30dadeac | https://github.com/stripe/stripe-java/blob/acfa8becef3e73bfe3e9d8880bea3f3f30dadeac/src/main/java/com/stripe/model/PaymentMethod.java#L269-L271 |
113,275 | stripe/stripe-java | src/main/java/com/stripe/model/Transfer.java | Transfer.retrieve | public static Transfer retrieve(String transfer) throws StripeException {
return retrieve(transfer, (Map<String, Object>) null, (RequestOptions) null);
} | java | public static Transfer retrieve(String transfer) throws StripeException {
return retrieve(transfer, (Map<String, Object>) null, (RequestOptions) null);
} | [
"public",
"static",
"Transfer",
"retrieve",
"(",
"String",
"transfer",
")",
"throws",
"StripeException",
"{",
"return",
"retrieve",
"(",
"transfer",
",",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
")",
"null",
",",
"(",
"RequestOptions",
")",
"null",
"... | Retrieves the details of an existing transfer. Supply the unique transfer ID from either a
transfer creation request or the transfer list, and Stripe will return the corresponding
transfer information. | [
"Retrieves",
"the",
"details",
"of",
"an",
"existing",
"transfer",
".",
"Supply",
"the",
"unique",
"transfer",
"ID",
"from",
"either",
"a",
"transfer",
"creation",
"request",
"or",
"the",
"transfer",
"list",
"and",
"Stripe",
"will",
"return",
"the",
"correspon... | acfa8becef3e73bfe3e9d8880bea3f3f30dadeac | https://github.com/stripe/stripe-java/blob/acfa8becef3e73bfe3e9d8880bea3f3f30dadeac/src/main/java/com/stripe/model/Transfer.java#L283-L285 |
113,276 | stripe/stripe-java | src/main/java/com/stripe/model/Subscription.java | Subscription.retrieve | public static Subscription retrieve(String subscriptionExposedId) throws StripeException {
return retrieve(subscriptionExposedId, (Map<String, Object>) null, (RequestOptions) null);
} | java | public static Subscription retrieve(String subscriptionExposedId) throws StripeException {
return retrieve(subscriptionExposedId, (Map<String, Object>) null, (RequestOptions) null);
} | [
"public",
"static",
"Subscription",
"retrieve",
"(",
"String",
"subscriptionExposedId",
")",
"throws",
"StripeException",
"{",
"return",
"retrieve",
"(",
"subscriptionExposedId",
",",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
")",
"null",
",",
"(",
"Request... | Retrieves the subscription with the given ID. | [
"Retrieves",
"the",
"subscription",
"with",
"the",
"given",
"ID",
"."
] | acfa8becef3e73bfe3e9d8880bea3f3f30dadeac | https://github.com/stripe/stripe-java/blob/acfa8becef3e73bfe3e9d8880bea3f3f30dadeac/src/main/java/com/stripe/model/Subscription.java#L440-L442 |
113,277 | stripe/stripe-java | src/main/java/com/stripe/Stripe.java | Stripe.setAppInfo | public static void setAppInfo(String name, String version, String url, String partnerId) {
if (appInfo == null) {
appInfo = new HashMap<String, String>();
}
appInfo.put("name", name);
appInfo.put("version", version);
appInfo.put("url", url);
appInfo.put("partner_id", partnerId);
} | java | public static void setAppInfo(String name, String version, String url, String partnerId) {
if (appInfo == null) {
appInfo = new HashMap<String, String>();
}
appInfo.put("name", name);
appInfo.put("version", version);
appInfo.put("url", url);
appInfo.put("partner_id", partnerId);
} | [
"public",
"static",
"void",
"setAppInfo",
"(",
"String",
"name",
",",
"String",
"version",
",",
"String",
"url",
",",
"String",
"partnerId",
")",
"{",
"if",
"(",
"appInfo",
"==",
"null",
")",
"{",
"appInfo",
"=",
"new",
"HashMap",
"<",
"String",
",",
"... | Sets information about your application. The information is passed along to Stripe.
@param name Name of your application (e.g. "MyAwesomeApp")
@param version Version of your application (e.g. "1.2.34")
@param url Website for your application (e.g. "https://myawesomeapp.info")
@param partnerId Your Stripe Partner ID (e... | [
"Sets",
"information",
"about",
"your",
"application",
".",
"The",
"information",
"is",
"passed",
"along",
"to",
"Stripe",
"."
] | acfa8becef3e73bfe3e9d8880bea3f3f30dadeac | https://github.com/stripe/stripe-java/blob/acfa8becef3e73bfe3e9d8880bea3f3f30dadeac/src/main/java/com/stripe/Stripe.java#L170-L179 |
113,278 | stripe/stripe-java | src/main/java/com/stripe/model/TaxIdCollection.java | TaxIdCollection.list | public TaxIdCollection list(TaxIdCollectionListParams params, RequestOptions options)
throws StripeException {
String url = String.format("%s%s", Stripe.getApiBase(), this.getUrl());
return ApiResource.requestCollection(url, params, TaxIdCollection.class, options);
} | java | public TaxIdCollection list(TaxIdCollectionListParams params, RequestOptions options)
throws StripeException {
String url = String.format("%s%s", Stripe.getApiBase(), this.getUrl());
return ApiResource.requestCollection(url, params, TaxIdCollection.class, options);
} | [
"public",
"TaxIdCollection",
"list",
"(",
"TaxIdCollectionListParams",
"params",
",",
"RequestOptions",
"options",
")",
"throws",
"StripeException",
"{",
"String",
"url",
"=",
"String",
".",
"format",
"(",
"\"%s%s\"",
",",
"Stripe",
".",
"getApiBase",
"(",
")",
... | Returns a list of tax IDs for a customer. | [
"Returns",
"a",
"list",
"of",
"tax",
"IDs",
"for",
"a",
"customer",
"."
] | acfa8becef3e73bfe3e9d8880bea3f3f30dadeac | https://github.com/stripe/stripe-java/blob/acfa8becef3e73bfe3e9d8880bea3f3f30dadeac/src/main/java/com/stripe/model/TaxIdCollection.java#L88-L92 |
113,279 | stripe/stripe-java | src/main/java/com/stripe/model/Token.java | Token.retrieve | public static Token retrieve(String token) throws StripeException {
return retrieve(token, (Map<String, Object>) null, (RequestOptions) null);
} | java | public static Token retrieve(String token) throws StripeException {
return retrieve(token, (Map<String, Object>) null, (RequestOptions) null);
} | [
"public",
"static",
"Token",
"retrieve",
"(",
"String",
"token",
")",
"throws",
"StripeException",
"{",
"return",
"retrieve",
"(",
"token",
",",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
")",
"null",
",",
"(",
"RequestOptions",
")",
"null",
")",
";"... | Retrieves the token with the given ID. | [
"Retrieves",
"the",
"token",
"with",
"the",
"given",
"ID",
"."
] | acfa8becef3e73bfe3e9d8880bea3f3f30dadeac | https://github.com/stripe/stripe-java/blob/acfa8becef3e73bfe3e9d8880bea3f3f30dadeac/src/main/java/com/stripe/model/Token.java#L67-L69 |
113,280 | stripe/stripe-java | src/main/java/com/stripe/model/CreditNote.java | CreditNote.retrieve | public static CreditNote retrieve(String id, RequestOptions options) throws StripeException {
return retrieve(id, (Map<String, Object>) null, options);
} | java | public static CreditNote retrieve(String id, RequestOptions options) throws StripeException {
return retrieve(id, (Map<String, Object>) null, options);
} | [
"public",
"static",
"CreditNote",
"retrieve",
"(",
"String",
"id",
",",
"RequestOptions",
"options",
")",
"throws",
"StripeException",
"{",
"return",
"retrieve",
"(",
"id",
",",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
")",
"null",
",",
"options",
")... | Retrieves the credit note object with the given identifier. | [
"Retrieves",
"the",
"credit",
"note",
"object",
"with",
"the",
"given",
"identifier",
"."
] | acfa8becef3e73bfe3e9d8880bea3f3f30dadeac | https://github.com/stripe/stripe-java/blob/acfa8becef3e73bfe3e9d8880bea3f3f30dadeac/src/main/java/com/stripe/model/CreditNote.java#L282-L284 |
113,281 | stripe/stripe-java | src/main/java/com/stripe/model/EphemeralKey.java | EphemeralKey.delete | public EphemeralKey delete(RequestOptions options) throws StripeException {
return request(RequestMethod.DELETE, instanceUrl(EphemeralKey.class, this.id),
(Map<String,Object>) null, EphemeralKey.class, options);
} | java | public EphemeralKey delete(RequestOptions options) throws StripeException {
return request(RequestMethod.DELETE, instanceUrl(EphemeralKey.class, this.id),
(Map<String,Object>) null, EphemeralKey.class, options);
} | [
"public",
"EphemeralKey",
"delete",
"(",
"RequestOptions",
"options",
")",
"throws",
"StripeException",
"{",
"return",
"request",
"(",
"RequestMethod",
".",
"DELETE",
",",
"instanceUrl",
"(",
"EphemeralKey",
".",
"class",
",",
"this",
".",
"id",
")",
",",
"(",... | Invalidates an ephemeral API key for a given resource. | [
"Invalidates",
"an",
"ephemeral",
"API",
"key",
"for",
"a",
"given",
"resource",
"."
] | acfa8becef3e73bfe3e9d8880bea3f3f30dadeac | https://github.com/stripe/stripe-java/blob/acfa8becef3e73bfe3e9d8880bea3f3f30dadeac/src/main/java/com/stripe/model/EphemeralKey.java#L96-L99 |
113,282 | stripe/stripe-java | src/main/java/com/stripe/net/ApiResource.java | ApiResource.urlEncodeId | public static String urlEncodeId(String id) throws InvalidRequestException {
try {
return urlEncode(id);
} catch (UnsupportedEncodingException e) {
throw new InvalidRequestException(String.format(
"Unable to encode `%s` in the url to %s. "
+ "Please contact support@stripe.com for... | java | public static String urlEncodeId(String id) throws InvalidRequestException {
try {
return urlEncode(id);
} catch (UnsupportedEncodingException e) {
throw new InvalidRequestException(String.format(
"Unable to encode `%s` in the url to %s. "
+ "Please contact support@stripe.com for... | [
"public",
"static",
"String",
"urlEncodeId",
"(",
"String",
"id",
")",
"throws",
"InvalidRequestException",
"{",
"try",
"{",
"return",
"urlEncode",
"(",
"id",
")",
";",
"}",
"catch",
"(",
"UnsupportedEncodingException",
"e",
")",
"{",
"throw",
"new",
"InvalidR... | URL-encode a string ID in url path formatting. | [
"URL",
"-",
"encode",
"a",
"string",
"ID",
"in",
"url",
"path",
"formatting",
"."
] | acfa8becef3e73bfe3e9d8880bea3f3f30dadeac | https://github.com/stripe/stripe-java/blob/acfa8becef3e73bfe3e9d8880bea3f3f30dadeac/src/main/java/com/stripe/net/ApiResource.java#L162-L171 |
113,283 | stripe/stripe-java | src/main/java/com/stripe/net/ApiResource.java | ApiResource.checkNullTypedParams | public static void checkNullTypedParams(String url, ApiRequestParams params) {
if (params == null) {
throw new IllegalArgumentException(String.format("Found null params for %s. "
+ "Please pass empty params using param builder via `builder().build()` instead.", url
));
}
} | java | public static void checkNullTypedParams(String url, ApiRequestParams params) {
if (params == null) {
throw new IllegalArgumentException(String.format("Found null params for %s. "
+ "Please pass empty params using param builder via `builder().build()` instead.", url
));
}
} | [
"public",
"static",
"void",
"checkNullTypedParams",
"(",
"String",
"url",
",",
"ApiRequestParams",
"params",
")",
"{",
"if",
"(",
"params",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"String",
".",
"format",
"(",
"\"Found null param... | Invalidate null typed parameters.
@param url request url associated with the given parameters.
@param params typed parameters to check for null value. | [
"Invalidate",
"null",
"typed",
"parameters",
"."
] | acfa8becef3e73bfe3e9d8880bea3f3f30dadeac | https://github.com/stripe/stripe-java/blob/acfa8becef3e73bfe3e9d8880bea3f3f30dadeac/src/main/java/com/stripe/net/ApiResource.java#L228-L234 |
113,284 | stripe/stripe-java | src/main/java/com/stripe/net/ApiResource.java | ApiResource.setExpandableFieldId | public static <T extends HasId> ExpandableField<T> setExpandableFieldId(String newId,
ExpandableField<T> currentObject) {
if (currentObject == null
|| (currentObject.isExpanded() && !Objects.equals(currentObject.getId(), newId))) {
return new ExpandableField<>(newId, null);
}
return new... | java | public static <T extends HasId> ExpandableField<T> setExpandableFieldId(String newId,
ExpandableField<T> currentObject) {
if (currentObject == null
|| (currentObject.isExpanded() && !Objects.equals(currentObject.getId(), newId))) {
return new ExpandableField<>(newId, null);
}
return new... | [
"public",
"static",
"<",
"T",
"extends",
"HasId",
">",
"ExpandableField",
"<",
"T",
">",
"setExpandableFieldId",
"(",
"String",
"newId",
",",
"ExpandableField",
"<",
"T",
">",
"currentObject",
")",
"{",
"if",
"(",
"currentObject",
"==",
"null",
"||",
"(",
... | When setting a String ID for an ExpandableField, we need to be careful about keeping the String
ID and the expanded object in sync. If they specify a new String ID that is different from the
ID within the expanded object, we don't keep the object. | [
"When",
"setting",
"a",
"String",
"ID",
"for",
"an",
"ExpandableField",
"we",
"need",
"to",
"be",
"careful",
"about",
"keeping",
"the",
"String",
"ID",
"and",
"the",
"expanded",
"object",
"in",
"sync",
".",
"If",
"they",
"specify",
"a",
"new",
"String",
... | acfa8becef3e73bfe3e9d8880bea3f3f30dadeac | https://github.com/stripe/stripe-java/blob/acfa8becef3e73bfe3e9d8880bea3f3f30dadeac/src/main/java/com/stripe/net/ApiResource.java#L241-L249 |
113,285 | stripe/stripe-java | src/main/java/com/stripe/model/StripeCollection.java | StripeCollection.autoPagingIterable | public Iterable<T> autoPagingIterable(Map<String, Object> params, RequestOptions options) {
this.setRequestOptions(options);
this.setRequestParams(params);
return new PagingIterable<>(this);
} | java | public Iterable<T> autoPagingIterable(Map<String, Object> params, RequestOptions options) {
this.setRequestOptions(options);
this.setRequestParams(params);
return new PagingIterable<>(this);
} | [
"public",
"Iterable",
"<",
"T",
">",
"autoPagingIterable",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"params",
",",
"RequestOptions",
"options",
")",
"{",
"this",
".",
"setRequestOptions",
"(",
"options",
")",
";",
"this",
".",
"setRequestParams",
"(",
... | Constructs an iterable that can be used to iterate across all objects
across all pages. As page boundaries are encountered, the next page will
be fetched automatically for continued iteration.
@param params request parameters (will override the parameters from the initial list request)
@param options request options (... | [
"Constructs",
"an",
"iterable",
"that",
"can",
"be",
"used",
"to",
"iterate",
"across",
"all",
"objects",
"across",
"all",
"pages",
".",
"As",
"page",
"boundaries",
"are",
"encountered",
"the",
"next",
"page",
"will",
"be",
"fetched",
"automatically",
"for",
... | acfa8becef3e73bfe3e9d8880bea3f3f30dadeac | https://github.com/stripe/stripe-java/blob/acfa8becef3e73bfe3e9d8880bea3f3f30dadeac/src/main/java/com/stripe/model/StripeCollection.java#L80-L84 |
113,286 | stripe/stripe-java | src/main/java/com/stripe/net/MultipartProcessor.java | MultipartProcessor.addFileField | public void addFileField(String name, String fileName, InputStream inputStream)
throws IOException {
writer.append("--").append(boundary).append(LINE_BREAK);
writer.append("Content-Disposition: form-data; name=\"").append(name)
.append("\"; filename=\"").append(fileName).append("\"").append(LI... | java | public void addFileField(String name, String fileName, InputStream inputStream)
throws IOException {
writer.append("--").append(boundary).append(LINE_BREAK);
writer.append("Content-Disposition: form-data; name=\"").append(name)
.append("\"; filename=\"").append(fileName).append("\"").append(LI... | [
"public",
"void",
"addFileField",
"(",
"String",
"name",
",",
"String",
"fileName",
",",
"InputStream",
"inputStream",
")",
"throws",
"IOException",
"{",
"writer",
".",
"append",
"(",
"\"--\"",
")",
".",
"append",
"(",
"boundary",
")",
".",
"append",
"(",
... | Adds a file field to the multipart message, but takes in an InputStream instead of
just a file to read bytes from.
@param name Field name
@param fileName Name of the "file" being uploaded.
@param inputStream Stream of bytes to use in place of a file.
@throws IOException Thrown when writing / reading f... | [
"Adds",
"a",
"file",
"field",
"to",
"the",
"multipart",
"message",
"but",
"takes",
"in",
"an",
"InputStream",
"instead",
"of",
"just",
"a",
"file",
"to",
"read",
"bytes",
"from",
"."
] | acfa8becef3e73bfe3e9d8880bea3f3f30dadeac | https://github.com/stripe/stripe-java/blob/acfa8becef3e73bfe3e9d8880bea3f3f30dadeac/src/main/java/com/stripe/net/MultipartProcessor.java#L64-L80 |
113,287 | stripe/stripe-java | src/main/java/com/stripe/net/MultipartProcessor.java | MultipartProcessor.streamToOutput | private void streamToOutput(InputStream inputStream) throws IOException {
try {
byte[] buffer = new byte[4096];
int bytesRead = -1;
while ((bytesRead = inputStream.read(buffer)) != -1) {
outputStream.write(buffer, 0, bytesRead);
}
outputStream.flush();
} finally {
inp... | java | private void streamToOutput(InputStream inputStream) throws IOException {
try {
byte[] buffer = new byte[4096];
int bytesRead = -1;
while ((bytesRead = inputStream.read(buffer)) != -1) {
outputStream.write(buffer, 0, bytesRead);
}
outputStream.flush();
} finally {
inp... | [
"private",
"void",
"streamToOutput",
"(",
"InputStream",
"inputStream",
")",
"throws",
"IOException",
"{",
"try",
"{",
"byte",
"[",
"]",
"buffer",
"=",
"new",
"byte",
"[",
"4096",
"]",
";",
"int",
"bytesRead",
"=",
"-",
"1",
";",
"while",
"(",
"(",
"by... | Utility method to read all the bytes from an InputStream into the outputStream.
@param inputStream Stream of bytes to read from.
@throws IOException Thrown on errors reading / writing. | [
"Utility",
"method",
"to",
"read",
"all",
"the",
"bytes",
"from",
"an",
"InputStream",
"into",
"the",
"outputStream",
"."
] | acfa8becef3e73bfe3e9d8880bea3f3f30dadeac | https://github.com/stripe/stripe-java/blob/acfa8becef3e73bfe3e9d8880bea3f3f30dadeac/src/main/java/com/stripe/net/MultipartProcessor.java#L87-L98 |
113,288 | stripe/stripe-java | src/main/java/com/stripe/net/MultipartProcessor.java | MultipartProcessor.finish | public void finish() throws IOException {
writer.append("--" + boundary + "--").append(LINE_BREAK);
writer.flush();
writer.close();
outputStream.flush();
outputStream.close();
} | java | public void finish() throws IOException {
writer.append("--" + boundary + "--").append(LINE_BREAK);
writer.flush();
writer.close();
outputStream.flush();
outputStream.close();
} | [
"public",
"void",
"finish",
"(",
")",
"throws",
"IOException",
"{",
"writer",
".",
"append",
"(",
"\"--\"",
"+",
"boundary",
"+",
"\"--\"",
")",
".",
"append",
"(",
"LINE_BREAK",
")",
";",
"writer",
".",
"flush",
"(",
")",
";",
"writer",
".",
"close",
... | Adds the final boundary to the multipart message and closes streams. | [
"Adds",
"the",
"final",
"boundary",
"to",
"the",
"multipart",
"message",
"and",
"closes",
"streams",
"."
] | acfa8becef3e73bfe3e9d8880bea3f3f30dadeac | https://github.com/stripe/stripe-java/blob/acfa8becef3e73bfe3e9d8880bea3f3f30dadeac/src/main/java/com/stripe/net/MultipartProcessor.java#L103-L109 |
113,289 | stripe/stripe-java | src/main/java/com/stripe/net/OAuth.java | OAuth.authorizeUrl | public static String authorizeUrl(Map<String, Object> params, RequestOptions options)
throws AuthenticationException, InvalidRequestException {
final String base = Stripe.getConnectBase();
params.put("client_id", getClientId(params, options));
if (params.get("response_type") == null) {
params.p... | java | public static String authorizeUrl(Map<String, Object> params, RequestOptions options)
throws AuthenticationException, InvalidRequestException {
final String base = Stripe.getConnectBase();
params.put("client_id", getClientId(params, options));
if (params.get("response_type") == null) {
params.p... | [
"public",
"static",
"String",
"authorizeUrl",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"params",
",",
"RequestOptions",
"options",
")",
"throws",
"AuthenticationException",
",",
"InvalidRequestException",
"{",
"final",
"String",
"base",
"=",
"Stripe",
".",
... | Generates a URL to Stripe's OAuth form.
@param params the parameters to include in the URL.
@param options the request options.
@return the URL to Stripe's OAuth form. | [
"Generates",
"a",
"URL",
"to",
"Stripe",
"s",
"OAuth",
"form",
"."
] | acfa8becef3e73bfe3e9d8880bea3f3f30dadeac | https://github.com/stripe/stripe-java/blob/acfa8becef3e73bfe3e9d8880bea3f3f30dadeac/src/main/java/com/stripe/net/OAuth.java#L27-L47 |
113,290 | stripe/stripe-java | src/main/java/com/stripe/net/OAuth.java | OAuth.token | public static TokenResponse token(Map<String, Object> params, RequestOptions options)
throws StripeException {
String url = Stripe.getConnectBase() + "/oauth/token";
return OAuth.stripeResponseGetter.oauthRequest(ApiResource.RequestMethod.POST, url, params,
TokenResponse.class, ApiResource.Request... | java | public static TokenResponse token(Map<String, Object> params, RequestOptions options)
throws StripeException {
String url = Stripe.getConnectBase() + "/oauth/token";
return OAuth.stripeResponseGetter.oauthRequest(ApiResource.RequestMethod.POST, url, params,
TokenResponse.class, ApiResource.Request... | [
"public",
"static",
"TokenResponse",
"token",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"params",
",",
"RequestOptions",
"options",
")",
"throws",
"StripeException",
"{",
"String",
"url",
"=",
"Stripe",
".",
"getConnectBase",
"(",
")",
"+",
"\"/oauth/toke... | Uses an authorization code to connect an account to your platform and
fetch the user's credentials.
@param params the request parameters.
@param options the request options.
@return the TokenResponse instance containing the response from the OAuth
API. | [
"Uses",
"an",
"authorization",
"code",
"to",
"connect",
"an",
"account",
"to",
"your",
"platform",
"and",
"fetch",
"the",
"user",
"s",
"credentials",
"."
] | acfa8becef3e73bfe3e9d8880bea3f3f30dadeac | https://github.com/stripe/stripe-java/blob/acfa8becef3e73bfe3e9d8880bea3f3f30dadeac/src/main/java/com/stripe/net/OAuth.java#L59-L64 |
113,291 | stripe/stripe-java | src/main/java/com/stripe/net/OAuth.java | OAuth.deauthorize | public static DeauthorizedAccount deauthorize(Map<String, Object> params, RequestOptions options)
throws StripeException {
String url = Stripe.getConnectBase() + "/oauth/deauthorize";
params.put("client_id", getClientId(params, options));
return OAuth.stripeResponseGetter.oauthRequest(ApiResource.Requ... | java | public static DeauthorizedAccount deauthorize(Map<String, Object> params, RequestOptions options)
throws StripeException {
String url = Stripe.getConnectBase() + "/oauth/deauthorize";
params.put("client_id", getClientId(params, options));
return OAuth.stripeResponseGetter.oauthRequest(ApiResource.Requ... | [
"public",
"static",
"DeauthorizedAccount",
"deauthorize",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"params",
",",
"RequestOptions",
"options",
")",
"throws",
"StripeException",
"{",
"String",
"url",
"=",
"Stripe",
".",
"getConnectBase",
"(",
")",
"+",
"\... | Disconnects an account from your platform.
@param params the request parameters.
@param options the request options.
@return the DeauthorizedAccount instance containing the response from the
OAuth API. | [
"Disconnects",
"an",
"account",
"from",
"your",
"platform",
"."
] | acfa8becef3e73bfe3e9d8880bea3f3f30dadeac | https://github.com/stripe/stripe-java/blob/acfa8becef3e73bfe3e9d8880bea3f3f30dadeac/src/main/java/com/stripe/net/OAuth.java#L75-L81 |
113,292 | stripe/stripe-java | src/main/java/com/stripe/net/OAuth.java | OAuth.getClientId | private static String getClientId(Map<String, Object> params, RequestOptions options)
throws AuthenticationException {
String clientId = Stripe.clientId;
if ((options != null) && (options.getClientId() != null)) {
clientId = options.getClientId();
}
if ((params != null) && (params.get("clien... | java | private static String getClientId(Map<String, Object> params, RequestOptions options)
throws AuthenticationException {
String clientId = Stripe.clientId;
if ((options != null) && (options.getClientId() != null)) {
clientId = options.getClientId();
}
if ((params != null) && (params.get("clien... | [
"private",
"static",
"String",
"getClientId",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"params",
",",
"RequestOptions",
"options",
")",
"throws",
"AuthenticationException",
"{",
"String",
"clientId",
"=",
"Stripe",
".",
"clientId",
";",
"if",
"(",
"(",
... | Returns the client_id to use in OAuth requests.
@param params the request parameters.
@param options the request options.
@return the client_id. | [
"Returns",
"the",
"client_id",
"to",
"use",
"in",
"OAuth",
"requests",
"."
] | acfa8becef3e73bfe3e9d8880bea3f3f30dadeac | https://github.com/stripe/stripe-java/blob/acfa8becef3e73bfe3e9d8880bea3f3f30dadeac/src/main/java/com/stripe/net/OAuth.java#L90-L112 |
113,293 | stripe/stripe-java | src/main/java/com/stripe/model/FileLink.java | FileLink.retrieve | public static FileLink retrieve(String link) throws StripeException {
return retrieve(link, (Map<String, Object>) null, (RequestOptions) null);
} | java | public static FileLink retrieve(String link) throws StripeException {
return retrieve(link, (Map<String, Object>) null, (RequestOptions) null);
} | [
"public",
"static",
"FileLink",
"retrieve",
"(",
"String",
"link",
")",
"throws",
"StripeException",
"{",
"return",
"retrieve",
"(",
"link",
",",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
")",
"null",
",",
"(",
"RequestOptions",
")",
"null",
")",
";... | Retrieves the file link with the given ID. | [
"Retrieves",
"the",
"file",
"link",
"with",
"the",
"given",
"ID",
"."
] | acfa8becef3e73bfe3e9d8880bea3f3f30dadeac | https://github.com/stripe/stripe-java/blob/acfa8becef3e73bfe3e9d8880bea3f3f30dadeac/src/main/java/com/stripe/model/FileLink.java#L88-L90 |
113,294 | stripe/stripe-java | src/main/java/com/stripe/model/InvoiceItem.java | InvoiceItem.retrieve | public static InvoiceItem retrieve(String invoiceitem) throws StripeException {
return retrieve(invoiceitem, (Map<String, Object>) null, (RequestOptions) null);
} | java | public static InvoiceItem retrieve(String invoiceitem) throws StripeException {
return retrieve(invoiceitem, (Map<String, Object>) null, (RequestOptions) null);
} | [
"public",
"static",
"InvoiceItem",
"retrieve",
"(",
"String",
"invoiceitem",
")",
"throws",
"StripeException",
"{",
"return",
"retrieve",
"(",
"invoiceitem",
",",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
")",
"null",
",",
"(",
"RequestOptions",
")",
"n... | Retrieves the invoice item with the given ID. | [
"Retrieves",
"the",
"invoice",
"item",
"with",
"the",
"given",
"ID",
"."
] | acfa8becef3e73bfe3e9d8880bea3f3f30dadeac | https://github.com/stripe/stripe-java/blob/acfa8becef3e73bfe3e9d8880bea3f3f30dadeac/src/main/java/com/stripe/model/InvoiceItem.java#L261-L263 |
113,295 | stripe/stripe-java | src/main/java/com/stripe/model/ApplePayDomain.java | ApplePayDomain.retrieve | public static ApplePayDomain retrieve(String domain) throws StripeException {
return retrieve(domain, (Map<String, Object>) null, (RequestOptions) null);
} | java | public static ApplePayDomain retrieve(String domain) throws StripeException {
return retrieve(domain, (Map<String, Object>) null, (RequestOptions) null);
} | [
"public",
"static",
"ApplePayDomain",
"retrieve",
"(",
"String",
"domain",
")",
"throws",
"StripeException",
"{",
"return",
"retrieve",
"(",
"domain",
",",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
")",
"null",
",",
"(",
"RequestOptions",
")",
"null",
... | Retrieve an apple pay domain. | [
"Retrieve",
"an",
"apple",
"pay",
"domain",
"."
] | acfa8becef3e73bfe3e9d8880bea3f3f30dadeac | https://github.com/stripe/stripe-java/blob/acfa8becef3e73bfe3e9d8880bea3f3f30dadeac/src/main/java/com/stripe/model/ApplePayDomain.java#L99-L101 |
113,296 | stripe/stripe-java | src/main/java/com/stripe/model/Plan.java | Plan.retrieve | public static Plan retrieve(String plan) throws StripeException {
return retrieve(plan, (Map<String, Object>) null, (RequestOptions) null);
} | java | public static Plan retrieve(String plan) throws StripeException {
return retrieve(plan, (Map<String, Object>) null, (RequestOptions) null);
} | [
"public",
"static",
"Plan",
"retrieve",
"(",
"String",
"plan",
")",
"throws",
"StripeException",
"{",
"return",
"retrieve",
"(",
"plan",
",",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
")",
"null",
",",
"(",
"RequestOptions",
")",
"null",
")",
";",
... | Retrieves the plan with the given ID. | [
"Retrieves",
"the",
"plan",
"with",
"the",
"given",
"ID",
"."
] | acfa8becef3e73bfe3e9d8880bea3f3f30dadeac | https://github.com/stripe/stripe-java/blob/acfa8becef3e73bfe3e9d8880bea3f3f30dadeac/src/main/java/com/stripe/model/Plan.java#L232-L234 |
113,297 | spring-cloud/spring-cloud-bus | spring-cloud-bus/src/main/java/org/springframework/cloud/bus/jackson/RemoteApplicationEventRegistrar.java | RemoteApplicationEventRegistrar.registerBeanDefinitions | @Override
public void registerBeanDefinitions(final AnnotationMetadata importingClassMetadata,
final BeanDefinitionRegistry registry) {
Map<String, Object> componentScan = importingClassMetadata
.getAnnotationAttributes(RemoteApplicationEventScan.class.getName(),
false);
Set<String> basePackages = n... | java | @Override
public void registerBeanDefinitions(final AnnotationMetadata importingClassMetadata,
final BeanDefinitionRegistry registry) {
Map<String, Object> componentScan = importingClassMetadata
.getAnnotationAttributes(RemoteApplicationEventScan.class.getName(),
false);
Set<String> basePackages = n... | [
"@",
"Override",
"public",
"void",
"registerBeanDefinitions",
"(",
"final",
"AnnotationMetadata",
"importingClassMetadata",
",",
"final",
"BeanDefinitionRegistry",
"registry",
")",
"{",
"Map",
"<",
"String",
",",
"Object",
">",
"componentScan",
"=",
"importingClassMetad... | patterned after Spring Integration IntegrationComponentScanRegistrar | [
"patterned",
"after",
"Spring",
"Integration",
"IntegrationComponentScanRegistrar"
] | 3502c926f3213dac99039fbc6879530e461215f0 | https://github.com/spring-cloud/spring-cloud-bus/blob/3502c926f3213dac99039fbc6879530e461215f0/spring-cloud-bus/src/main/java/org/springframework/cloud/bus/jackson/RemoteApplicationEventRegistrar.java#L40-L77 |
113,298 | spring-cloud/spring-cloud-bus | spring-cloud-bus/src/main/java/org/springframework/cloud/bus/jackson/BusJacksonAutoConfiguration.java | BusJacksonAutoConfiguration.busJsonConverter | @Bean
@ConditionalOnMissingBean(name = "busJsonConverter")
@StreamMessageConverter
public AbstractMessageConverter busJsonConverter(
@Autowired(required = false) ObjectMapper objectMapper) {
return new BusJacksonMessageConverter(objectMapper);
} | java | @Bean
@ConditionalOnMissingBean(name = "busJsonConverter")
@StreamMessageConverter
public AbstractMessageConverter busJsonConverter(
@Autowired(required = false) ObjectMapper objectMapper) {
return new BusJacksonMessageConverter(objectMapper);
} | [
"@",
"Bean",
"@",
"ConditionalOnMissingBean",
"(",
"name",
"=",
"\"busJsonConverter\"",
")",
"@",
"StreamMessageConverter",
"public",
"AbstractMessageConverter",
"busJsonConverter",
"(",
"@",
"Autowired",
"(",
"required",
"=",
"false",
")",
"ObjectMapper",
"objectMapper... | otherwise RemoteApplicationEventRegistrar will register the bean | [
"otherwise",
"RemoteApplicationEventRegistrar",
"will",
"register",
"the",
"bean"
] | 3502c926f3213dac99039fbc6879530e461215f0 | https://github.com/spring-cloud/spring-cloud-bus/blob/3502c926f3213dac99039fbc6879530e461215f0/spring-cloud-bus/src/main/java/org/springframework/cloud/bus/jackson/BusJacksonAutoConfiguration.java#L65-L71 |
113,299 | undera/jmeter-plugins | infra/common/src/main/java/kg/apc/charting/GraphPanelChart.java | GraphPanelChart.computeChartSteps | private void computeChartSteps() {
//if special type
if (chartType == GraphPanelChart.CHART_PERCENTAGE) {
minYVal = 0;
maxYVal = 100;
return;
}
//try to find the best range...
//first, avoid special cases where maxY equal or close to minY
... | java | private void computeChartSteps() {
//if special type
if (chartType == GraphPanelChart.CHART_PERCENTAGE) {
minYVal = 0;
maxYVal = 100;
return;
}
//try to find the best range...
//first, avoid special cases where maxY equal or close to minY
... | [
"private",
"void",
"computeChartSteps",
"(",
")",
"{",
"//if special type",
"if",
"(",
"chartType",
"==",
"GraphPanelChart",
".",
"CHART_PERCENTAGE",
")",
"{",
"minYVal",
"=",
"0",
";",
"maxYVal",
"=",
"100",
";",
"return",
";",
"}",
"//try to find the best rang... | compute minY and step value to have better readable charts | [
"compute",
"minY",
"and",
"step",
"value",
"to",
"have",
"better",
"readable",
"charts"
] | 416d2a77249ab921c7e4134c3e6a9639901ef7e8 | https://github.com/undera/jmeter-plugins/blob/416d2a77249ab921c7e4134c3e6a9639901ef7e8/infra/common/src/main/java/kg/apc/charting/GraphPanelChart.java#L375-L433 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.