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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
149,700 | dhemery/hartley | src/main/java/com/dhemery/expressing/ImmediateExpressions.java | ImmediateExpressions.not | public static <S> Feature<S,Boolean> not(Feature<? super S, Boolean> feature) {
return FeatureExpressions.not(feature);
} | java | public static <S> Feature<S,Boolean> not(Feature<? super S, Boolean> feature) {
return FeatureExpressions.not(feature);
} | [
"public",
"static",
"<",
"S",
">",
"Feature",
"<",
"S",
",",
"Boolean",
">",
"not",
"(",
"Feature",
"<",
"?",
"super",
"S",
",",
"Boolean",
">",
"feature",
")",
"{",
"return",
"FeatureExpressions",
".",
"not",
"(",
"feature",
")",
";",
"}"
] | Decorate a boolean feature to yield its logical negation. | [
"Decorate",
"a",
"boolean",
"feature",
"to",
"yield",
"its",
"logical",
"negation",
"."
] | 7754bd6bc12695f2249601b8890da530a61fcf33 | https://github.com/dhemery/hartley/blob/7754bd6bc12695f2249601b8890da530a61fcf33/src/main/java/com/dhemery/expressing/ImmediateExpressions.java#L145-L147 |
149,701 | dhemery/hartley | src/main/java/com/dhemery/expressing/ImmediateExpressions.java | ImmediateExpressions.the | public static <V> boolean the(Sampler<V> variable, Matcher<? super V> criteria) {
variable.takeSample();
return criteria.matches(variable.sampledValue());
} | java | public static <V> boolean the(Sampler<V> variable, Matcher<? super V> criteria) {
variable.takeSample();
return criteria.matches(variable.sampledValue());
} | [
"public",
"static",
"<",
"V",
">",
"boolean",
"the",
"(",
"Sampler",
"<",
"V",
">",
"variable",
",",
"Matcher",
"<",
"?",
"super",
"V",
">",
"criteria",
")",
"{",
"variable",
".",
"takeSample",
"(",
")",
";",
"return",
"criteria",
".",
"matches",
"("... | Report whether a sample of the variable satisfies the criteria. | [
"Report",
"whether",
"a",
"sample",
"of",
"the",
"variable",
"satisfies",
"the",
"criteria",
"."
] | 7754bd6bc12695f2249601b8890da530a61fcf33 | https://github.com/dhemery/hartley/blob/7754bd6bc12695f2249601b8890da530a61fcf33/src/main/java/com/dhemery/expressing/ImmediateExpressions.java#L173-L176 |
149,702 | dhemery/hartley | src/main/java/com/dhemery/expressing/ImmediateExpressions.java | ImmediateExpressions.the | public static <S> boolean the(S subject, Matcher<? super S> criteria) {
return criteria.matches(subject);
} | java | public static <S> boolean the(S subject, Matcher<? super S> criteria) {
return criteria.matches(subject);
} | [
"public",
"static",
"<",
"S",
">",
"boolean",
"the",
"(",
"S",
"subject",
",",
"Matcher",
"<",
"?",
"super",
"S",
">",
"criteria",
")",
"{",
"return",
"criteria",
".",
"matches",
"(",
"subject",
")",
";",
"}"
] | Report whether the subject satisfies the criteria. | [
"Report",
"whether",
"the",
"subject",
"satisfies",
"the",
"criteria",
"."
] | 7754bd6bc12695f2249601b8890da530a61fcf33 | https://github.com/dhemery/hartley/blob/7754bd6bc12695f2249601b8890da530a61fcf33/src/main/java/com/dhemery/expressing/ImmediateExpressions.java#L188-L190 |
149,703 | dhemery/hartley | src/main/java/com/dhemery/expressing/ImmediateExpressions.java | ImmediateExpressions.the | public static <S,V> boolean the(S subject, Feature<? super S,V> feature, Matcher<? super V> criteria) {
return criteria.matches(feature.of(subject));
} | java | public static <S,V> boolean the(S subject, Feature<? super S,V> feature, Matcher<? super V> criteria) {
return criteria.matches(feature.of(subject));
} | [
"public",
"static",
"<",
"S",
",",
"V",
">",
"boolean",
"the",
"(",
"S",
"subject",
",",
"Feature",
"<",
"?",
"super",
"S",
",",
"V",
">",
"feature",
",",
"Matcher",
"<",
"?",
"super",
"V",
">",
"criteria",
")",
"{",
"return",
"criteria",
".",
"m... | Report whether a sample of the feature satisfies the criteria. | [
"Report",
"whether",
"a",
"sample",
"of",
"the",
"feature",
"satisfies",
"the",
"criteria",
"."
] | 7754bd6bc12695f2249601b8890da530a61fcf33 | https://github.com/dhemery/hartley/blob/7754bd6bc12695f2249601b8890da530a61fcf33/src/main/java/com/dhemery/expressing/ImmediateExpressions.java#L195-L197 |
149,704 | mlhartme/mork | src/main/java/net/oneandone/mork/reflect/Constant.java | Constant.fillParas | public static Function fillParas(Function func, int ofs, Object[] paras) {
int i;
if (func == null) {
throw new NullPointerException();
}
for (i = 0; i < paras.length; i++) {
// ofs is not changed!
func = Composition.create(func, ofs,
... | java | public static Function fillParas(Function func, int ofs, Object[] paras) {
int i;
if (func == null) {
throw new NullPointerException();
}
for (i = 0; i < paras.length; i++) {
// ofs is not changed!
func = Composition.create(func, ofs,
... | [
"public",
"static",
"Function",
"fillParas",
"(",
"Function",
"func",
",",
"int",
"ofs",
",",
"Object",
"[",
"]",
"paras",
")",
"{",
"int",
"i",
";",
"if",
"(",
"func",
"==",
"null",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
")",
";",
"}... | Replaces arguments to Functions by Constant Functions. Results in
Functions with fewer arguments.
@param func Functions whose arguments are filled in
@param ofs first argument to be filled
@param paras Values for Constants used to fill arguments
@return Function with filled arguments. | [
"Replaces",
"arguments",
"to",
"Functions",
"by",
"Constant",
"Functions",
".",
"Results",
"in",
"Functions",
"with",
"fewer",
"arguments",
"."
] | a069b087750c4133bfeebaf1f599c3bc96762113 | https://github.com/mlhartme/mork/blob/a069b087750c4133bfeebaf1f599c3bc96762113/src/main/java/net/oneandone/mork/reflect/Constant.java#L66-L84 |
149,705 | eurekaclinical/javautil | src/main/java/org/arp/javautil/sql/DataSourceInitialContextBinder.java | DataSourceInitialContextBinder.unbind | public void unbind(DataSource dataSource) throws NamingException {
if (dataSource == null) {
throw new IllegalArgumentException("dataSource cannot be null");
}
String jndiUrl = this.dataSourceBindings.get(dataSource);
if (jndiUrl == null) {
throw new NamingExcepti... | java | public void unbind(DataSource dataSource) throws NamingException {
if (dataSource == null) {
throw new IllegalArgumentException("dataSource cannot be null");
}
String jndiUrl = this.dataSourceBindings.get(dataSource);
if (jndiUrl == null) {
throw new NamingExcepti... | [
"public",
"void",
"unbind",
"(",
"DataSource",
"dataSource",
")",
"throws",
"NamingException",
"{",
"if",
"(",
"dataSource",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"dataSource cannot be null\"",
")",
";",
"}",
"String",
"jndiUrl... | Unbinds a data source.
@param dataSource the {@link DataSource} to unbind.
@throws NamingException if an error occurs during unbinding. | [
"Unbinds",
"a",
"data",
"source",
"."
] | 779bbc5bf096c75f8eed4f99ca45b99c1d44df43 | https://github.com/eurekaclinical/javautil/blob/779bbc5bf096c75f8eed4f99ca45b99c1d44df43/src/main/java/org/arp/javautil/sql/DataSourceInitialContextBinder.java#L91-L101 |
149,706 | trustathsh/ifmapj | src/main/java/util/DomHelpers.java | DomHelpers.prepareExtendedIdentifier | public static String prepareExtendedIdentifier(Document doc) throws MarshalException {
Transformer tf = null;
String res = null;
try {
tf = TRANSFORMER_FACTORY.newTransformer();
} catch (TransformerConfigurationException e) {
IfmapJLog.error("Oh oh.... [" + e.getMessage() + "]");
throw new MarshalExc... | java | public static String prepareExtendedIdentifier(Document doc) throws MarshalException {
Transformer tf = null;
String res = null;
try {
tf = TRANSFORMER_FACTORY.newTransformer();
} catch (TransformerConfigurationException e) {
IfmapJLog.error("Oh oh.... [" + e.getMessage() + "]");
throw new MarshalExc... | [
"public",
"static",
"String",
"prepareExtendedIdentifier",
"(",
"Document",
"doc",
")",
"throws",
"MarshalException",
"{",
"Transformer",
"tf",
"=",
"null",
";",
"String",
"res",
"=",
"null",
";",
"try",
"{",
"tf",
"=",
"TRANSFORMER_FACTORY",
".",
"newTransforme... | Prepare an extended identifier for publish by removing
namespace added by XSL transformation and encoding all
relevant XML entities.
@since 0.1.5
@param str
@return namespace ns0 stripped and encoded XML string
@throws MarshalException | [
"Prepare",
"an",
"extended",
"identifier",
"for",
"publish",
"by",
"removing",
"namespace",
"added",
"by",
"XSL",
"transformation",
"and",
"encoding",
"all",
"relevant",
"XML",
"entities",
"."
] | 44ece9e95a3d2a1b7019573ba6178598a6cbdaa3 | https://github.com/trustathsh/ifmapj/blob/44ece9e95a3d2a1b7019573ba6178598a6cbdaa3/src/main/java/util/DomHelpers.java#L257-L307 |
149,707 | trustathsh/ifmapj | src/main/java/util/DomHelpers.java | DomHelpers.removePrefixFromChildren | private static void removePrefixFromChildren(Element el, String prefix)
throws MarshalException {
NodeList nl = el.getChildNodes();
String localPrefix = null;
for (int i = 0; i < nl.getLength(); i++) {
Node n = nl.item(i);
if (n.getNodeType() != Node.ELEMENT_NODE) {
continue;
}
localPrefix =... | java | private static void removePrefixFromChildren(Element el, String prefix)
throws MarshalException {
NodeList nl = el.getChildNodes();
String localPrefix = null;
for (int i = 0; i < nl.getLength(); i++) {
Node n = nl.item(i);
if (n.getNodeType() != Node.ELEMENT_NODE) {
continue;
}
localPrefix =... | [
"private",
"static",
"void",
"removePrefixFromChildren",
"(",
"Element",
"el",
",",
"String",
"prefix",
")",
"throws",
"MarshalException",
"{",
"NodeList",
"nl",
"=",
"el",
".",
"getChildNodes",
"(",
")",
";",
"String",
"localPrefix",
"=",
"null",
";",
"for",
... | If any child of el has prefix as prefix, remove it. drop all namespace
decls on the way. If we find an element with a different prefix, go
crazy.
@param el
@param prefix
@throws MarshalException | [
"If",
"any",
"child",
"of",
"el",
"has",
"prefix",
"as",
"prefix",
"remove",
"it",
".",
"drop",
"all",
"namespace",
"decls",
"on",
"the",
"way",
".",
"If",
"we",
"find",
"an",
"element",
"with",
"a",
"different",
"prefix",
"go",
"crazy",
"."
] | 44ece9e95a3d2a1b7019573ba6178598a6cbdaa3 | https://github.com/trustathsh/ifmapj/blob/44ece9e95a3d2a1b7019573ba6178598a6cbdaa3/src/main/java/util/DomHelpers.java#L410-L440 |
149,708 | trustathsh/ifmapj | src/main/java/util/DomHelpers.java | DomHelpers.compare | public static boolean compare(Document d1, Document d2) throws MarshalException {
d1.normalize();
d2.normalize();
return d1.isEqualNode(d2);
} | java | public static boolean compare(Document d1, Document d2) throws MarshalException {
d1.normalize();
d2.normalize();
return d1.isEqualNode(d2);
} | [
"public",
"static",
"boolean",
"compare",
"(",
"Document",
"d1",
",",
"Document",
"d2",
")",
"throws",
"MarshalException",
"{",
"d1",
".",
"normalize",
"(",
")",
";",
"d2",
".",
"normalize",
"(",
")",
";",
"return",
"d1",
".",
"isEqualNode",
"(",
"d2",
... | Compare two DOM documents
@param d1 First DOM document
@param d2 Second DOM document
@return true if both are equal
@throws MarshalException | [
"Compare",
"two",
"DOM",
"documents"
] | 44ece9e95a3d2a1b7019573ba6178598a6cbdaa3 | https://github.com/trustathsh/ifmapj/blob/44ece9e95a3d2a1b7019573ba6178598a6cbdaa3/src/main/java/util/DomHelpers.java#L486-L490 |
149,709 | seedstack/audit-addon | core/src/main/java/org/seedstack/audit/internal/AuditConfigurer.java | AuditConfigurer.findTrailWriters | Set<Class<? extends TrailWriter>> findTrailWriters() {
Set<Class<? extends TrailWriter>> trailWriters = auditConfig.getWriters();
if (trailWriters.isEmpty()) {
LOGGER.info("No TrailWriter specified");
}
return trailWriters;
} | java | Set<Class<? extends TrailWriter>> findTrailWriters() {
Set<Class<? extends TrailWriter>> trailWriters = auditConfig.getWriters();
if (trailWriters.isEmpty()) {
LOGGER.info("No TrailWriter specified");
}
return trailWriters;
} | [
"Set",
"<",
"Class",
"<",
"?",
"extends",
"TrailWriter",
">",
">",
"findTrailWriters",
"(",
")",
"{",
"Set",
"<",
"Class",
"<",
"?",
"extends",
"TrailWriter",
">",
">",
"trailWriters",
"=",
"auditConfig",
".",
"getWriters",
"(",
")",
";",
"if",
"(",
"t... | Finds the trail writers as configured in the props.
@return a collection of trail writer classes. | [
"Finds",
"the",
"trail",
"writers",
"as",
"configured",
"in",
"the",
"props",
"."
] | a2a91da236727eecd9fcc3df328ae2081cfe115b | https://github.com/seedstack/audit-addon/blob/a2a91da236727eecd9fcc3df328ae2081cfe115b/core/src/main/java/org/seedstack/audit/internal/AuditConfigurer.java#L45-L51 |
149,710 | seedstack/audit-addon | core/src/main/java/org/seedstack/audit/internal/AuditConfigurer.java | AuditConfigurer.findTrailExceptionHandlers | @SuppressWarnings({"unchecked"})
Set<Class<? extends TrailExceptionHandler<?>>> findTrailExceptionHandlers() {
Set<Class<? extends TrailExceptionHandler<?>>> trailExceptionHandlers = auditConfig.getExceptionHandlers();
if (trailExceptionHandlers.isEmpty()) {
Collection<Class<?>> scannedT... | java | @SuppressWarnings({"unchecked"})
Set<Class<? extends TrailExceptionHandler<?>>> findTrailExceptionHandlers() {
Set<Class<? extends TrailExceptionHandler<?>>> trailExceptionHandlers = auditConfig.getExceptionHandlers();
if (trailExceptionHandlers.isEmpty()) {
Collection<Class<?>> scannedT... | [
"@",
"SuppressWarnings",
"(",
"{",
"\"unchecked\"",
"}",
")",
"Set",
"<",
"Class",
"<",
"?",
"extends",
"TrailExceptionHandler",
"<",
"?",
">",
">",
">",
"findTrailExceptionHandlers",
"(",
")",
"{",
"Set",
"<",
"Class",
"<",
"?",
"extends",
"TrailExceptionHa... | Finds the exception handlers as configured in the props.
@return a collection of exception handler classes. | [
"Finds",
"the",
"exception",
"handlers",
"as",
"configured",
"in",
"the",
"props",
"."
] | a2a91da236727eecd9fcc3df328ae2081cfe115b | https://github.com/seedstack/audit-addon/blob/a2a91da236727eecd9fcc3df328ae2081cfe115b/core/src/main/java/org/seedstack/audit/internal/AuditConfigurer.java#L58-L73 |
149,711 | mlhartme/mork | src/main/java/net/oneandone/mork/compiler/MapperCompiler.java | MapperCompiler.outputDir | public File outputDir(File src, File explicitOutputDir, String mapperName) throws IOException {
File outputDir;
int prev;
int idx;
File subDir;
if (explicitOutputDir == null) {
outputDir = src.getParentFile();
} else {
outputDir = explicitOutputDi... | java | public File outputDir(File src, File explicitOutputDir, String mapperName) throws IOException {
File outputDir;
int prev;
int idx;
File subDir;
if (explicitOutputDir == null) {
outputDir = src.getParentFile();
} else {
outputDir = explicitOutputDi... | [
"public",
"File",
"outputDir",
"(",
"File",
"src",
",",
"File",
"explicitOutputDir",
",",
"String",
"mapperName",
")",
"throws",
"IOException",
"{",
"File",
"outputDir",
";",
"int",
"prev",
";",
"int",
"idx",
";",
"File",
"subDir",
";",
"if",
"(",
"explici... | creates new directory if necessary. | [
"creates",
"new",
"directory",
"if",
"necessary",
"."
] | a069b087750c4133bfeebaf1f599c3bc96762113 | https://github.com/mlhartme/mork/blob/a069b087750c4133bfeebaf1f599c3bc96762113/src/main/java/net/oneandone/mork/compiler/MapperCompiler.java#L86-L111 |
149,712 | mlhartme/mork | src/main/java/net/oneandone/mork/compiler/ObjectCompiler.java | ObjectCompiler.run | private void run(Class<?> type, Object val, int limit) {
int initial;
initial = dest.getSize();
if (val == null) {
if (type.isPrimitive()) {
throw new IllegalArgumentException("primitive null");
}
// null is not a string, but otherwise it is ... | java | private void run(Class<?> type, Object val, int limit) {
int initial;
initial = dest.getSize();
if (val == null) {
if (type.isPrimitive()) {
throw new IllegalArgumentException("primitive null");
}
// null is not a string, but otherwise it is ... | [
"private",
"void",
"run",
"(",
"Class",
"<",
"?",
">",
"type",
",",
"Object",
"val",
",",
"int",
"limit",
")",
"{",
"int",
"initial",
";",
"initial",
"=",
"dest",
".",
"getSize",
"(",
")",
";",
"if",
"(",
"val",
"==",
"null",
")",
"{",
"if",
"(... | type is the static type. If type is primitive, the primitive
object wrapped by val is compiled.
@param limit max number of instactions the value may be compiled to. >= 1. | [
"type",
"is",
"the",
"static",
"type",
".",
"If",
"type",
"is",
"primitive",
"the",
"primitive",
"object",
"wrapped",
"by",
"val",
"is",
"compiled",
"."
] | a069b087750c4133bfeebaf1f599c3bc96762113 | https://github.com/mlhartme/mork/blob/a069b087750c4133bfeebaf1f599c3bc96762113/src/main/java/net/oneandone/mork/compiler/ObjectCompiler.java#L80-L105 |
149,713 | mlhartme/mork | src/main/java/net/oneandone/mork/compiler/ObjectCompiler.java | ObjectCompiler.primitive | private void primitive(int typeCode, Object obj) {
switch (typeCode) {
case T_BOOLEAN:
dest.emit(LDC, ((Boolean) obj).booleanValue()? 1 : 0);
break;
case T_CHAR:
dest.emit(LDC, ((Character) obj).charValue());
break;
case T_BYTE:
cas... | java | private void primitive(int typeCode, Object obj) {
switch (typeCode) {
case T_BOOLEAN:
dest.emit(LDC, ((Boolean) obj).booleanValue()? 1 : 0);
break;
case T_CHAR:
dest.emit(LDC, ((Character) obj).charValue());
break;
case T_BYTE:
cas... | [
"private",
"void",
"primitive",
"(",
"int",
"typeCode",
",",
"Object",
"obj",
")",
"{",
"switch",
"(",
"typeCode",
")",
"{",
"case",
"T_BOOLEAN",
":",
"dest",
".",
"emit",
"(",
"LDC",
",",
"(",
"(",
"Boolean",
")",
"obj",
")",
".",
"booleanValue",
"(... | generates exactly 1 instruction. | [
"generates",
"exactly",
"1",
"instruction",
"."
] | a069b087750c4133bfeebaf1f599c3bc96762113 | https://github.com/mlhartme/mork/blob/a069b087750c4133bfeebaf1f599c3bc96762113/src/main/java/net/oneandone/mork/compiler/ObjectCompiler.java#L110-L131 |
149,714 | mlhartme/mork | src/main/java/net/oneandone/mork/compiler/ObjectCompiler.java | ObjectCompiler.charArray | private void charArray(char[] vals, int limit) {
int len;
char c;
int left, right;
String str;
int instrsPerChunk = 6;
int maxLen;
int used;
left = 0;
len = vals.length;
// len/CHUNK + 1 is conservative because len % CHUNK may be 0
... | java | private void charArray(char[] vals, int limit) {
int len;
char c;
int left, right;
String str;
int instrsPerChunk = 6;
int maxLen;
int used;
left = 0;
len = vals.length;
// len/CHUNK + 1 is conservative because len % CHUNK may be 0
... | [
"private",
"void",
"charArray",
"(",
"char",
"[",
"]",
"vals",
",",
"int",
"limit",
")",
"{",
"int",
"len",
";",
"char",
"c",
";",
"int",
"left",
",",
"right",
";",
"String",
"str",
";",
"int",
"instrsPerChunk",
"=",
"6",
";",
"int",
"maxLen",
";",... | reference on the operand stack | [
"reference",
"on",
"the",
"operand",
"stack"
] | a069b087750c4133bfeebaf1f599c3bc96762113 | https://github.com/mlhartme/mork/blob/a069b087750c4133bfeebaf1f599c3bc96762113/src/main/java/net/oneandone/mork/compiler/ObjectCompiler.java#L235-L286 |
149,715 | seedstack/jms-addon | src/it/java/org/seedstack/jms/JmsBaseIT.java | JmsBaseIT.managed_send_and_receive_is_working | @Test
public void managed_send_and_receive_is_working() throws JMSException {
testSender1.send("MANAGED");
try {
managed.await(1, TimeUnit.SECONDS);
Assertions.assertThat(textManaged).isEqualTo("MANAGED");
} catch (InterruptedException e) {
fail("Thread ... | java | @Test
public void managed_send_and_receive_is_working() throws JMSException {
testSender1.send("MANAGED");
try {
managed.await(1, TimeUnit.SECONDS);
Assertions.assertThat(textManaged).isEqualTo("MANAGED");
} catch (InterruptedException e) {
fail("Thread ... | [
"@",
"Test",
"public",
"void",
"managed_send_and_receive_is_working",
"(",
")",
"throws",
"JMSException",
"{",
"testSender1",
".",
"send",
"(",
"\"MANAGED\"",
")",
";",
"try",
"{",
"managed",
".",
"await",
"(",
"1",
",",
"TimeUnit",
".",
"SECONDS",
")",
";",... | TestSender1 and TestMessageListener1. | [
"TestSender1",
"and",
"TestMessageListener1",
"."
] | d6014811daaac29f591b32bfd2358500fb25d804 | https://github.com/seedstack/jms-addon/blob/d6014811daaac29f591b32bfd2358500fb25d804/src/it/java/org/seedstack/jms/JmsBaseIT.java#L48-L59 |
149,716 | seedstack/jms-addon | src/it/java/org/seedstack/jms/JmsBaseIT.java | JmsBaseIT.unmanaged_send_and_receive_is_working | @Test
public void unmanaged_send_and_receive_is_working() throws JMSException {
testSender2.send("UNMANAGED");
try {
unmanaged.await(1, TimeUnit.SECONDS);
Assertions.assertThat(textUnmanaged).isEqualTo("UNMANAGED");
} catch (InterruptedException e) {
fa... | java | @Test
public void unmanaged_send_and_receive_is_working() throws JMSException {
testSender2.send("UNMANAGED");
try {
unmanaged.await(1, TimeUnit.SECONDS);
Assertions.assertThat(textUnmanaged).isEqualTo("UNMANAGED");
} catch (InterruptedException e) {
fa... | [
"@",
"Test",
"public",
"void",
"unmanaged_send_and_receive_is_working",
"(",
")",
"throws",
"JMSException",
"{",
"testSender2",
".",
"send",
"(",
"\"UNMANAGED\"",
")",
";",
"try",
"{",
"unmanaged",
".",
"await",
"(",
"1",
",",
"TimeUnit",
".",
"SECONDS",
")",
... | TestSender2 and TestMessageListener2. | [
"TestSender2",
"and",
"TestMessageListener2",
"."
] | d6014811daaac29f591b32bfd2358500fb25d804 | https://github.com/seedstack/jms-addon/blob/d6014811daaac29f591b32bfd2358500fb25d804/src/it/java/org/seedstack/jms/JmsBaseIT.java#L64-L76 |
149,717 | icoloma/simpleds | src/main/java/org/simpleds/metadata/ClassMetadata.java | ClassMetadata.datastoreToJava | public <T> T datastoreToJava(Entity entity) {
try {
if (entity == null) {
return null;
}
T result = (T) persistentClass.newInstance();
populate(entity, result);
return result;
} catch (InstantiationException e) {
throw new RuntimeException(e);
} catch (IllegalAccessException e) {
throw ne... | java | public <T> T datastoreToJava(Entity entity) {
try {
if (entity == null) {
return null;
}
T result = (T) persistentClass.newInstance();
populate(entity, result);
return result;
} catch (InstantiationException e) {
throw new RuntimeException(e);
} catch (IllegalAccessException e) {
throw ne... | [
"public",
"<",
"T",
">",
"T",
"datastoreToJava",
"(",
"Entity",
"entity",
")",
"{",
"try",
"{",
"if",
"(",
"entity",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"T",
"result",
"=",
"(",
"T",
")",
"persistentClass",
".",
"newInstance",
"(",
... | Convert a value from Google representation to a Java value
@param entity the persistent {@link Entity} from the google datastore | [
"Convert",
"a",
"value",
"from",
"Google",
"representation",
"to",
"a",
"Java",
"value"
] | b07763df98b9375b764e625f617a6c78df4b068d | https://github.com/icoloma/simpleds/blob/b07763df98b9375b764e625f617a6c78df4b068d/src/main/java/org/simpleds/metadata/ClassMetadata.java#L63-L76 |
149,718 | icoloma/simpleds | src/main/java/org/simpleds/metadata/ClassMetadata.java | ClassMetadata.populate | public void populate(Entity from, Object to) {
for (Entry<String, Object> property : from.getProperties().entrySet()) {
PropertyMetadata metadata = properties.get(property.getKey());
if (metadata != null) {
Object value = metadata.getConverter().datastoreToJava(property.getValue());
metadata.setValue(to... | java | public void populate(Entity from, Object to) {
for (Entry<String, Object> property : from.getProperties().entrySet()) {
PropertyMetadata metadata = properties.get(property.getKey());
if (metadata != null) {
Object value = metadata.getConverter().datastoreToJava(property.getValue());
metadata.setValue(to... | [
"public",
"void",
"populate",
"(",
"Entity",
"from",
",",
"Object",
"to",
")",
"{",
"for",
"(",
"Entry",
"<",
"String",
",",
"Object",
">",
"property",
":",
"from",
".",
"getProperties",
"(",
")",
".",
"entrySet",
"(",
")",
")",
"{",
"PropertyMetadata"... | Copy all properties from the datastore entity into the persistent class instance passed as an attribute.
@param from the entity read from the datastore
@param to the java object to populate. Cannot be null. | [
"Copy",
"all",
"properties",
"from",
"the",
"datastore",
"entity",
"into",
"the",
"persistent",
"class",
"instance",
"passed",
"as",
"an",
"attribute",
"."
] | b07763df98b9375b764e625f617a6c78df4b068d | https://github.com/icoloma/simpleds/blob/b07763df98b9375b764e625f617a6c78df4b068d/src/main/java/org/simpleds/metadata/ClassMetadata.java#L83-L96 |
149,719 | icoloma/simpleds | src/main/java/org/simpleds/metadata/ClassMetadata.java | ClassMetadata.validateConstraints | public void validateConstraints(Entity entity) {
for (String propertyName : requiredProperties) {
Object value = entity.getProperty(propertyName);
if (value == null || (value instanceof String && ((String) value).length() == 0)) {
throw new RequiredFieldException("Required property '" + this.persis... | java | public void validateConstraints(Entity entity) {
for (String propertyName : requiredProperties) {
Object value = entity.getProperty(propertyName);
if (value == null || (value instanceof String && ((String) value).length() == 0)) {
throw new RequiredFieldException("Required property '" + this.persis... | [
"public",
"void",
"validateConstraints",
"(",
"Entity",
"entity",
")",
"{",
"for",
"(",
"String",
"propertyName",
":",
"requiredProperties",
")",
"{",
"Object",
"value",
"=",
"entity",
".",
"getProperty",
"(",
"propertyName",
")",
";",
"if",
"(",
"value",
"=... | Validate the schema constraints on the provided Entity instance
@param entity the entity to validate | [
"Validate",
"the",
"schema",
"constraints",
"on",
"the",
"provided",
"Entity",
"instance"
] | b07763df98b9375b764e625f617a6c78df4b068d | https://github.com/icoloma/simpleds/blob/b07763df98b9375b764e625f617a6c78df4b068d/src/main/java/org/simpleds/metadata/ClassMetadata.java#L102-L109 |
149,720 | icoloma/simpleds | src/main/java/org/simpleds/metadata/ClassMetadata.java | ClassMetadata.validateParentKey | public void validateParentKey(Key parentKey) {
if (parents.isEmpty()) {
if (parentKey != null) {
throw new IllegalArgumentException("Specified parent key " + parentKey + ", but entity " + this.persistentClass.getSimpleName() + " is configured as a root class (missing @Id(parent)?)");
}
} else {
if (par... | java | public void validateParentKey(Key parentKey) {
if (parents.isEmpty()) {
if (parentKey != null) {
throw new IllegalArgumentException("Specified parent key " + parentKey + ", but entity " + this.persistentClass.getSimpleName() + " is configured as a root class (missing @Id(parent)?)");
}
} else {
if (par... | [
"public",
"void",
"validateParentKey",
"(",
"Key",
"parentKey",
")",
"{",
"if",
"(",
"parents",
".",
"isEmpty",
"(",
")",
")",
"{",
"if",
"(",
"parentKey",
"!=",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Specified parent key \"",
... | Validates the parent key when inserting | [
"Validates",
"the",
"parent",
"key",
"when",
"inserting"
] | b07763df98b9375b764e625f617a6c78df4b068d | https://github.com/icoloma/simpleds/blob/b07763df98b9375b764e625f617a6c78df4b068d/src/main/java/org/simpleds/metadata/ClassMetadata.java#L183-L196 |
149,721 | eurekaclinical/javautil | src/main/java/org/arp/javautil/collections/Collections.java | Collections.putSetAll | public static <K, V> void putSetAll(Map<K, Set<V>> map, Map<K, Set<V>> other) {
for (Map.Entry<K, Set<V>> me : other.entrySet()) {
putSetMult(map, me.getKey(), me.getValue());
}
} | java | public static <K, V> void putSetAll(Map<K, Set<V>> map, Map<K, Set<V>> other) {
for (Map.Entry<K, Set<V>> me : other.entrySet()) {
putSetMult(map, me.getKey(), me.getValue());
}
} | [
"public",
"static",
"<",
"K",
",",
"V",
">",
"void",
"putSetAll",
"(",
"Map",
"<",
"K",
",",
"Set",
"<",
"V",
">",
">",
"map",
",",
"Map",
"<",
"K",
",",
"Set",
"<",
"V",
">",
">",
"other",
")",
"{",
"for",
"(",
"Map",
".",
"Entry",
"<",
... | Copies all of the mappings from the second map to the first. The value
for each key is the union of the first and second maps' values for that
key.
@param <K>
@param <V>
@param map the first {@link Map}.
@param other the second {@link Map}. | [
"Copies",
"all",
"of",
"the",
"mappings",
"from",
"the",
"second",
"map",
"to",
"the",
"first",
".",
"The",
"value",
"for",
"each",
"key",
"is",
"the",
"union",
"of",
"the",
"first",
"and",
"second",
"maps",
"values",
"for",
"that",
"key",
"."
] | 779bbc5bf096c75f8eed4f99ca45b99c1d44df43 | https://github.com/eurekaclinical/javautil/blob/779bbc5bf096c75f8eed4f99ca45b99c1d44df43/src/main/java/org/arp/javautil/collections/Collections.java#L117-L121 |
149,722 | eurekaclinical/javautil | src/main/java/org/arp/javautil/collections/Collections.java | Collections.containsAny | public static <K> boolean containsAny(Set<K> aSet, K[] arr) {
for (K obj : arr) {
if (aSet.contains(obj)) {
return true;
}
}
return false;
} | java | public static <K> boolean containsAny(Set<K> aSet, K[] arr) {
for (K obj : arr) {
if (aSet.contains(obj)) {
return true;
}
}
return false;
} | [
"public",
"static",
"<",
"K",
">",
"boolean",
"containsAny",
"(",
"Set",
"<",
"K",
">",
"aSet",
",",
"K",
"[",
"]",
"arr",
")",
"{",
"for",
"(",
"K",
"obj",
":",
"arr",
")",
"{",
"if",
"(",
"aSet",
".",
"contains",
"(",
"obj",
")",
")",
"{",
... | Checks whether any of an array's elements are also in the provided set.
@param aSet a {@link Set}.
@param arr an array.
@return <code>true</code> or <code>false</code>. | [
"Checks",
"whether",
"any",
"of",
"an",
"array",
"s",
"elements",
"are",
"also",
"in",
"the",
"provided",
"set",
"."
] | 779bbc5bf096c75f8eed4f99ca45b99c1d44df43 | https://github.com/eurekaclinical/javautil/blob/779bbc5bf096c75f8eed4f99ca45b99c1d44df43/src/main/java/org/arp/javautil/collections/Collections.java#L130-L137 |
149,723 | qmetric/halreader | src/main/java/com/qmetric/hal/reader/HalReader.java | HalReader.read | public HalResource read(final Reader reader)
{
final ContentRepresentation readableRepresentation = representationFactory.readRepresentation(RepresentationFactory.HAL_JSON, reader);
return new HalResource(objectMapper, readableRepresentation);
} | java | public HalResource read(final Reader reader)
{
final ContentRepresentation readableRepresentation = representationFactory.readRepresentation(RepresentationFactory.HAL_JSON, reader);
return new HalResource(objectMapper, readableRepresentation);
} | [
"public",
"HalResource",
"read",
"(",
"final",
"Reader",
"reader",
")",
"{",
"final",
"ContentRepresentation",
"readableRepresentation",
"=",
"representationFactory",
".",
"readRepresentation",
"(",
"RepresentationFactory",
".",
"HAL_JSON",
",",
"reader",
")",
";",
"r... | Read and return HalResource
@param reader Reader
@return Hal resource | [
"Read",
"and",
"return",
"HalResource"
] | 584167b25ac7ae0559c6e3cdd300b8a02e59b00b | https://github.com/qmetric/halreader/blob/584167b25ac7ae0559c6e3cdd300b8a02e59b00b/src/main/java/com/qmetric/hal/reader/HalReader.java#L41-L46 |
149,724 | dhemery/hartley | src/main/java/com/dhemery/publishing/SubscriberInspector.java | SubscriberInspector.subscriptionsOn | public Set<Method> subscriptionsOn(Object subscriber) {
SubscriptionMethodFilter filter = new SubscriptionMethodFilter();
Class<?> subscriberClass = subscriber.getClass();
List<Method> methods = Arrays.asList(subscriberClass.getMethods());
Set<Method> subscriptions = new HashSet<Method>(... | java | public Set<Method> subscriptionsOn(Object subscriber) {
SubscriptionMethodFilter filter = new SubscriptionMethodFilter();
Class<?> subscriberClass = subscriber.getClass();
List<Method> methods = Arrays.asList(subscriberClass.getMethods());
Set<Method> subscriptions = new HashSet<Method>(... | [
"public",
"Set",
"<",
"Method",
">",
"subscriptionsOn",
"(",
"Object",
"subscriber",
")",
"{",
"SubscriptionMethodFilter",
"filter",
"=",
"new",
"SubscriptionMethodFilter",
"(",
")",
";",
"Class",
"<",
"?",
">",
"subscriberClass",
"=",
"subscriber",
".",
"getCla... | Report the subscription methods declared on the subscriber. | [
"Report",
"the",
"subscription",
"methods",
"declared",
"on",
"the",
"subscriber",
"."
] | 7754bd6bc12695f2249601b8890da530a61fcf33 | https://github.com/dhemery/hartley/blob/7754bd6bc12695f2249601b8890da530a61fcf33/src/main/java/com/dhemery/publishing/SubscriberInspector.java#L16-L27 |
149,725 | trustathsh/ifmapj | src/main/java/de/hshannover/f4/trust/ifmapj/identifier/Identifiers.java | Identifiers.getExtendedIdentifierHandlerFor | private static IdentifierHandler<? extends Identifier> getExtendedIdentifierHandlerFor(Element element) {
if (!checkExtendedIdentityElement(element)) {
return null;
}
String name = element.getAttribute(IfmapStrings.IDENTITY_ATTR_NAME);
Document extendedDocument;
try {
extendedDocument = DomHelpers.par... | java | private static IdentifierHandler<? extends Identifier> getExtendedIdentifierHandlerFor(Element element) {
if (!checkExtendedIdentityElement(element)) {
return null;
}
String name = element.getAttribute(IfmapStrings.IDENTITY_ATTR_NAME);
Document extendedDocument;
try {
extendedDocument = DomHelpers.par... | [
"private",
"static",
"IdentifierHandler",
"<",
"?",
"extends",
"Identifier",
">",
"getExtendedIdentifierHandlerFor",
"(",
"Element",
"element",
")",
"{",
"if",
"(",
"!",
"checkExtendedIdentityElement",
"(",
"element",
")",
")",
"{",
"return",
"null",
";",
"}",
"... | If the element argument is an extended identity Identifier then try to find the most specific handler for this
element. Used the Element-LocalName to find the right handler.
@param element
@return The {@link IdentifierHandler} for the element or null. | [
"If",
"the",
"element",
"argument",
"is",
"an",
"extended",
"identity",
"Identifier",
"then",
"try",
"to",
"find",
"the",
"most",
"specific",
"handler",
"for",
"this",
"element",
".",
"Used",
"the",
"Element",
"-",
"LocalName",
"to",
"find",
"the",
"right",
... | 44ece9e95a3d2a1b7019573ba6178598a6cbdaa3 | https://github.com/trustathsh/ifmapj/blob/44ece9e95a3d2a1b7019573ba6178598a6cbdaa3/src/main/java/de/hshannover/f4/trust/ifmapj/identifier/Identifiers.java#L213-L241 |
149,726 | trustathsh/ifmapj | src/main/java/de/hshannover/f4/trust/ifmapj/identifier/Identifiers.java | Identifiers.createArRandomUuid | public static AccessRequest createArRandomUuid(String admDom) {
return new AccessRequest(java.util.UUID.randomUUID().toString(), admDom);
} | java | public static AccessRequest createArRandomUuid(String admDom) {
return new AccessRequest(java.util.UUID.randomUUID().toString(), admDom);
} | [
"public",
"static",
"AccessRequest",
"createArRandomUuid",
"(",
"String",
"admDom",
")",
"{",
"return",
"new",
"AccessRequest",
"(",
"java",
".",
"util",
".",
"UUID",
".",
"randomUUID",
"(",
")",
".",
"toString",
"(",
")",
",",
"admDom",
")",
";",
"}"
] | Create an access-request identifier with an random UUID as name
and administrative-domain as given.
@return the new {@link AccessRequest} instance. | [
"Create",
"an",
"access",
"-",
"request",
"identifier",
"with",
"an",
"random",
"UUID",
"as",
"name",
"and",
"administrative",
"-",
"domain",
"as",
"given",
"."
] | 44ece9e95a3d2a1b7019573ba6178598a6cbdaa3 | https://github.com/trustathsh/ifmapj/blob/44ece9e95a3d2a1b7019573ba6178598a6cbdaa3/src/main/java/de/hshannover/f4/trust/ifmapj/identifier/Identifiers.java#L361-L363 |
149,727 | trustathsh/ifmapj | src/main/java/de/hshannover/f4/trust/ifmapj/identifier/Identifiers.java | Identifiers.createOtherIdentity | public static Identity createOtherIdentity(String name, String admDom,
String otherTypeDef) {
return createIdentity(IdentityType.other, name, admDom, otherTypeDef);
} | java | public static Identity createOtherIdentity(String name, String admDom,
String otherTypeDef) {
return createIdentity(IdentityType.other, name, admDom, otherTypeDef);
} | [
"public",
"static",
"Identity",
"createOtherIdentity",
"(",
"String",
"name",
",",
"String",
"admDom",
",",
"String",
"otherTypeDef",
")",
"{",
"return",
"createIdentity",
"(",
"IdentityType",
".",
"other",
",",
"name",
",",
"admDom",
",",
"otherTypeDef",
")",
... | Create an other identity identifier.
<b>Note: The type is set to {@link IdentityType#other} by default.</b>
@param name the name of the identity identifier
@param admDom the administrative-domain of the identity identifier
@param otherTypeDef vendor specific {@link String}
@return the new {@link Identity} instance | [
"Create",
"an",
"other",
"identity",
"identifier",
"."
] | 44ece9e95a3d2a1b7019573ba6178598a6cbdaa3 | https://github.com/trustathsh/ifmapj/blob/44ece9e95a3d2a1b7019573ba6178598a6cbdaa3/src/main/java/de/hshannover/f4/trust/ifmapj/identifier/Identifiers.java#L508-L511 |
149,728 | trustathsh/ifmapj | src/main/java/de/hshannover/f4/trust/ifmapj/identifier/Identifiers.java | Identifiers.createIp4 | public static IpAddress createIp4(String value, String admDom) {
return createIp(IpAddressType.IPv4, value, admDom);
} | java | public static IpAddress createIp4(String value, String admDom) {
return createIp(IpAddressType.IPv4, value, admDom);
} | [
"public",
"static",
"IpAddress",
"createIp4",
"(",
"String",
"value",
",",
"String",
"admDom",
")",
"{",
"return",
"createIp",
"(",
"IpAddressType",
".",
"IPv4",
",",
"value",
",",
"admDom",
")",
";",
"}"
] | Create an ip-address identifier for IPv4 with the given value and the
given administrative-domain.
@param value a {@link String} that represents a valid IPv4 address
@param admDom the administrative-domain
@return the new ip-address identifier | [
"Create",
"an",
"ip",
"-",
"address",
"identifier",
"for",
"IPv4",
"with",
"the",
"given",
"value",
"and",
"the",
"given",
"administrative",
"-",
"domain",
"."
] | 44ece9e95a3d2a1b7019573ba6178598a6cbdaa3 | https://github.com/trustathsh/ifmapj/blob/44ece9e95a3d2a1b7019573ba6178598a6cbdaa3/src/main/java/de/hshannover/f4/trust/ifmapj/identifier/Identifiers.java#L616-L618 |
149,729 | trustathsh/ifmapj | src/main/java/de/hshannover/f4/trust/ifmapj/identifier/Identifiers.java | Identifiers.createIp6 | public static IpAddress createIp6(String value, String admDom) {
return createIp(IpAddressType.IPv6, value, admDom);
} | java | public static IpAddress createIp6(String value, String admDom) {
return createIp(IpAddressType.IPv6, value, admDom);
} | [
"public",
"static",
"IpAddress",
"createIp6",
"(",
"String",
"value",
",",
"String",
"admDom",
")",
"{",
"return",
"createIp",
"(",
"IpAddressType",
".",
"IPv6",
",",
"value",
",",
"admDom",
")",
";",
"}"
] | Create an ip-address identifier for IPv6 with the given parameters.
@param value a {@link String} that represents a valid IPv4 address
@param admDom the administrative-domain
@return the new ip-address identifier | [
"Create",
"an",
"ip",
"-",
"address",
"identifier",
"for",
"IPv6",
"with",
"the",
"given",
"parameters",
"."
] | 44ece9e95a3d2a1b7019573ba6178598a6cbdaa3 | https://github.com/trustathsh/ifmapj/blob/44ece9e95a3d2a1b7019573ba6178598a6cbdaa3/src/main/java/de/hshannover/f4/trust/ifmapj/identifier/Identifiers.java#L637-L639 |
149,730 | trustathsh/ifmapj | src/main/java/de/hshannover/f4/trust/ifmapj/identifier/Identifiers.java | Identifiers.createIp | public static IpAddress createIp(IpAddressType type, String value, String admDom) {
return new IpAddress(type, value, admDom);
} | java | public static IpAddress createIp(IpAddressType type, String value, String admDom) {
return new IpAddress(type, value, admDom);
} | [
"public",
"static",
"IpAddress",
"createIp",
"(",
"IpAddressType",
"type",
",",
"String",
"value",
",",
"String",
"admDom",
")",
"{",
"return",
"new",
"IpAddress",
"(",
"type",
",",
"value",
",",
"admDom",
")",
";",
"}"
] | Create an ip-address identifier with the given parameters.
@param type the type of the ip-address identifier
@param value a {@link String} that represents a valid IPv4/6 address
@param admDom the administrative-domain
@return the new ip-address identifier | [
"Create",
"an",
"ip",
"-",
"address",
"identifier",
"with",
"the",
"given",
"parameters",
"."
] | 44ece9e95a3d2a1b7019573ba6178598a6cbdaa3 | https://github.com/trustathsh/ifmapj/blob/44ece9e95a3d2a1b7019573ba6178598a6cbdaa3/src/main/java/de/hshannover/f4/trust/ifmapj/identifier/Identifiers.java#L649-L651 |
149,731 | eurekaclinical/eurekaclinical-standard-apis | src/main/java/org/eurekaclinical/standardapis/dao/DatabaseSupport.java | DatabaseSupport.getAll | @SuppressWarnings("unchecked")
public <T> List<T> getAll(Class<T> entityCls) {
if (entityCls == null) {
throw new IllegalArgumentException("entityCls cannot be null");
}
EntityManager entityManager = this.entityManagerProvider.get();
CriteriaBuilder builder = entityManage... | java | @SuppressWarnings("unchecked")
public <T> List<T> getAll(Class<T> entityCls) {
if (entityCls == null) {
throw new IllegalArgumentException("entityCls cannot be null");
}
EntityManager entityManager = this.entityManagerProvider.get();
CriteriaBuilder builder = entityManage... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"<",
"T",
">",
"List",
"<",
"T",
">",
"getAll",
"(",
"Class",
"<",
"T",
">",
"entityCls",
")",
"{",
"if",
"(",
"entityCls",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
... | Gets every instance of the specified entity in the database.
@param <T> the type of the entity.
@param entityCls the class of the specified entity. Cannot be
<code>null</code>.
@return the instances requested. Guaranteed not <code>null</code>. | [
"Gets",
"every",
"instance",
"of",
"the",
"specified",
"entity",
"in",
"the",
"database",
"."
] | 690036dde82a4f2c2106d32403cdf1c713429377 | https://github.com/eurekaclinical/eurekaclinical-standard-apis/blob/690036dde82a4f2c2106d32403cdf1c713429377/src/main/java/org/eurekaclinical/standardapis/dao/DatabaseSupport.java#L129-L143 |
149,732 | eurekaclinical/eurekaclinical-standard-apis | src/main/java/org/eurekaclinical/standardapis/dao/DatabaseSupport.java | DatabaseSupport.getCurrent | public <T extends HistoricalEntity<?>> List<T> getCurrent(Class<T> historicalEntityCls) {
EntityManager entityManager = this.entityManagerProvider.get();
CriteriaBuilder builder = entityManager.getCriteriaBuilder();
CriteriaQuery<T> criteriaQuery = builder.createQuery(historicalEntityCls);
... | java | public <T extends HistoricalEntity<?>> List<T> getCurrent(Class<T> historicalEntityCls) {
EntityManager entityManager = this.entityManagerProvider.get();
CriteriaBuilder builder = entityManager.getCriteriaBuilder();
CriteriaQuery<T> criteriaQuery = builder.createQuery(historicalEntityCls);
... | [
"public",
"<",
"T",
"extends",
"HistoricalEntity",
"<",
"?",
">",
">",
"List",
"<",
"T",
">",
"getCurrent",
"(",
"Class",
"<",
"T",
">",
"historicalEntityCls",
")",
"{",
"EntityManager",
"entityManager",
"=",
"this",
".",
"entityManagerProvider",
".",
"get",... | Gets every instance of the specified historical entity in the database.
@param <T> the type of the entity.
@param historicalEntityCls the class of the specified historical entity.
The entity must be a subtype of {@link HistoricalEntity}. Cannot be
<code>null</code>.
@return the instances requested. Guaranteed not <cod... | [
"Gets",
"every",
"instance",
"of",
"the",
"specified",
"historical",
"entity",
"in",
"the",
"database",
"."
] | 690036dde82a4f2c2106d32403cdf1c713429377 | https://github.com/eurekaclinical/eurekaclinical-standard-apis/blob/690036dde82a4f2c2106d32403cdf1c713429377/src/main/java/org/eurekaclinical/standardapis/dao/DatabaseSupport.java#L182-L190 |
149,733 | eurekaclinical/eurekaclinical-standard-apis | src/main/java/org/eurekaclinical/standardapis/dao/DatabaseSupport.java | DatabaseSupport.getCurrentUniqueByAttribute | public <T extends HistoricalEntity<?>, Y> T getCurrentUniqueByAttribute(
Class<T> historicalEntityCls,
SingularAttribute<T, Y> attribute, Y value) {
EntityManager entityManager = this.entityManagerProvider.get();
CriteriaBuilder builder = entityManager.getCriteriaBuilder();
... | java | public <T extends HistoricalEntity<?>, Y> T getCurrentUniqueByAttribute(
Class<T> historicalEntityCls,
SingularAttribute<T, Y> attribute, Y value) {
EntityManager entityManager = this.entityManagerProvider.get();
CriteriaBuilder builder = entityManager.getCriteriaBuilder();
... | [
"public",
"<",
"T",
"extends",
"HistoricalEntity",
"<",
"?",
">",
",",
"Y",
">",
"T",
"getCurrentUniqueByAttribute",
"(",
"Class",
"<",
"T",
">",
"historicalEntityCls",
",",
"SingularAttribute",
"<",
"T",
",",
"Y",
">",
"attribute",
",",
"Y",
"value",
")",... | Gets the instance of the specified historical entity in the database
that has the given value of the given attribute.
@param <T> the type of the entity.The entity must be a subtype of
{@link HistoricalEntity}. Cannot be <code>null</code>.
@param <Y> the attribute's type.
@param historicalEntityCls the class of the spe... | [
"Gets",
"the",
"instance",
"of",
"the",
"specified",
"historical",
"entity",
"in",
"the",
"database",
"that",
"has",
"the",
"given",
"value",
"of",
"the",
"given",
"attribute",
"."
] | 690036dde82a4f2c2106d32403cdf1c713429377 | https://github.com/eurekaclinical/eurekaclinical-standard-apis/blob/690036dde82a4f2c2106d32403cdf1c713429377/src/main/java/org/eurekaclinical/standardapis/dao/DatabaseSupport.java#L205-L229 |
149,734 | eurekaclinical/eurekaclinical-standard-apis | src/main/java/org/eurekaclinical/standardapis/dao/DatabaseSupport.java | DatabaseSupport.getCurrentListByAttribute | public <T extends HistoricalEntity<?>, Y> List<T> getCurrentListByAttribute(
Class<T> historicalEntityCls,
SingularAttribute<T, Y> attribute, Y value) {
EntityManager entityManager = this.entityManagerProvider.get();
CriteriaBuilder builder = entityManager.getCriteriaBuilder();
... | java | public <T extends HistoricalEntity<?>, Y> List<T> getCurrentListByAttribute(
Class<T> historicalEntityCls,
SingularAttribute<T, Y> attribute, Y value) {
EntityManager entityManager = this.entityManagerProvider.get();
CriteriaBuilder builder = entityManager.getCriteriaBuilder();
... | [
"public",
"<",
"T",
"extends",
"HistoricalEntity",
"<",
"?",
">",
",",
"Y",
">",
"List",
"<",
"T",
">",
"getCurrentListByAttribute",
"(",
"Class",
"<",
"T",
">",
"historicalEntityCls",
",",
"SingularAttribute",
"<",
"T",
",",
"Y",
">",
"attribute",
",",
... | Gets every instance of the specified historical entity in the database
that has the given value of the given attribute.
@param <T> the type of the entity.The entity must be a subtype of
{@link HistoricalEntity}. Cannot be <code>null</code>.
@param <Y> the attribute's type.
@param historicalEntityCls the class of the s... | [
"Gets",
"every",
"instance",
"of",
"the",
"specified",
"historical",
"entity",
"in",
"the",
"database",
"that",
"has",
"the",
"given",
"value",
"of",
"the",
"given",
"attribute",
"."
] | 690036dde82a4f2c2106d32403cdf1c713429377 | https://github.com/eurekaclinical/eurekaclinical-standard-apis/blob/690036dde82a4f2c2106d32403cdf1c713429377/src/main/java/org/eurekaclinical/standardapis/dao/DatabaseSupport.java#L244-L257 |
149,735 | eurekaclinical/eurekaclinical-standard-apis | src/main/java/org/eurekaclinical/standardapis/dao/DatabaseSupport.java | DatabaseSupport.getUniqueByAttribute | public <T, Y> T getUniqueByAttribute(Class<T> entityCls,
String attributeName, Y value) {
if (entityCls == null) {
throw new IllegalArgumentException("entityCls cannot be null");
}
if (attributeName == null) {
throw new IllegalArgumentException("attributeName ... | java | public <T, Y> T getUniqueByAttribute(Class<T> entityCls,
String attributeName, Y value) {
if (entityCls == null) {
throw new IllegalArgumentException("entityCls cannot be null");
}
if (attributeName == null) {
throw new IllegalArgumentException("attributeName ... | [
"public",
"<",
"T",
",",
"Y",
">",
"T",
"getUniqueByAttribute",
"(",
"Class",
"<",
"T",
">",
"entityCls",
",",
"String",
"attributeName",
",",
"Y",
"value",
")",
"{",
"if",
"(",
"entityCls",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentExcepti... | Executes a query for the entity with the given attribute value. This
method assumes that at most one instance of the given entity will be a
match. This typically is used with attributes with a uniqueness
constraint.
@param <T> the type of the entity.
@param <Y> the type of the attribute.
@param entityCls the entity cl... | [
"Executes",
"a",
"query",
"for",
"the",
"entity",
"with",
"the",
"given",
"attribute",
"value",
".",
"This",
"method",
"assumes",
"that",
"at",
"most",
"one",
"instance",
"of",
"the",
"given",
"entity",
"will",
"be",
"a",
"match",
".",
"This",
"typically",... | 690036dde82a4f2c2106d32403cdf1c713429377 | https://github.com/eurekaclinical/eurekaclinical-standard-apis/blob/690036dde82a4f2c2106d32403cdf1c713429377/src/main/java/org/eurekaclinical/standardapis/dao/DatabaseSupport.java#L319-L340 |
149,736 | eurekaclinical/eurekaclinical-standard-apis | src/main/java/org/eurekaclinical/standardapis/dao/DatabaseSupport.java | DatabaseSupport.getListByAttribute | public <T, Y> List<T> getListByAttribute(
Class<T> entityCls, SingularAttribute<T, Y> attribute, Y value) {
if (entityCls == null) {
throw new IllegalArgumentException("entityCls cannot be null");
}
if (attribute == null) {
throw new IllegalArgumentException("... | java | public <T, Y> List<T> getListByAttribute(
Class<T> entityCls, SingularAttribute<T, Y> attribute, Y value) {
if (entityCls == null) {
throw new IllegalArgumentException("entityCls cannot be null");
}
if (attribute == null) {
throw new IllegalArgumentException("... | [
"public",
"<",
"T",
",",
"Y",
">",
"List",
"<",
"T",
">",
"getListByAttribute",
"(",
"Class",
"<",
"T",
">",
"entityCls",
",",
"SingularAttribute",
"<",
"T",
",",
"Y",
">",
"attribute",
",",
"Y",
"value",
")",
"{",
"if",
"(",
"entityCls",
"==",
"nu... | Executes a query for the entities that have the specified value of the
given attribute.
@param <T> the type of the entity.
@param <Y> the type of the attribute.
@param entityCls the entity class. Cannot be <code>null</code>.
@param attribute the attribute. Cannot be <code>null</code>.
@param value the value.
@return ... | [
"Executes",
"a",
"query",
"for",
"the",
"entities",
"that",
"have",
"the",
"specified",
"value",
"of",
"the",
"given",
"attribute",
"."
] | 690036dde82a4f2c2106d32403cdf1c713429377 | https://github.com/eurekaclinical/eurekaclinical-standard-apis/blob/690036dde82a4f2c2106d32403cdf1c713429377/src/main/java/org/eurekaclinical/standardapis/dao/DatabaseSupport.java#L354-L364 |
149,737 | eurekaclinical/eurekaclinical-standard-apis | src/main/java/org/eurekaclinical/standardapis/dao/DatabaseSupport.java | DatabaseSupport.getListByAttributeIn | public <T, Y> List<T> getListByAttributeIn(Class<T> entityCls,
SingularAttribute<T, Y> attribute, List<Y> values) {
if (entityCls == null) {
throw new IllegalArgumentException("entityCls cannot be null");
}
if (attribute == null) {
throw new IllegalArgumentExc... | java | public <T, Y> List<T> getListByAttributeIn(Class<T> entityCls,
SingularAttribute<T, Y> attribute, List<Y> values) {
if (entityCls == null) {
throw new IllegalArgumentException("entityCls cannot be null");
}
if (attribute == null) {
throw new IllegalArgumentExc... | [
"public",
"<",
"T",
",",
"Y",
">",
"List",
"<",
"T",
">",
"getListByAttributeIn",
"(",
"Class",
"<",
"T",
">",
"entityCls",
",",
"SingularAttribute",
"<",
"T",
",",
"Y",
">",
"attribute",
",",
"List",
"<",
"Y",
">",
"values",
")",
"{",
"if",
"(",
... | Executes a query for entities that have any of the given attribute
values.
@param <T> the type of the entity.
@param <Y> the type of the attribute.
@param entityCls the entity class. Cannot be <code>null</code>.
@param attribute the attribute. Cannot be <code>null</code>.
@param values the values.
@return the matchin... | [
"Executes",
"a",
"query",
"for",
"entities",
"that",
"have",
"any",
"of",
"the",
"given",
"attribute",
"values",
"."
] | 690036dde82a4f2c2106d32403cdf1c713429377 | https://github.com/eurekaclinical/eurekaclinical-standard-apis/blob/690036dde82a4f2c2106d32403cdf1c713429377/src/main/java/org/eurekaclinical/standardapis/dao/DatabaseSupport.java#L408-L419 |
149,738 | eurekaclinical/eurekaclinical-standard-apis | src/main/java/org/eurekaclinical/standardapis/dao/DatabaseSupport.java | DatabaseSupport.createTypedQueryIn | private <T, Y> TypedQuery<T> createTypedQueryIn(Class<T> entityCls,
SingularAttribute<T, Y> attribute, List<Y> values) {
EntityManager entityManager = this.entityManagerProvider.get();
CriteriaBuilder builder = entityManager.getCriteriaBuilder();
CriteriaQuery<T> criteriaQuery = buil... | java | private <T, Y> TypedQuery<T> createTypedQueryIn(Class<T> entityCls,
SingularAttribute<T, Y> attribute, List<Y> values) {
EntityManager entityManager = this.entityManagerProvider.get();
CriteriaBuilder builder = entityManager.getCriteriaBuilder();
CriteriaQuery<T> criteriaQuery = buil... | [
"private",
"<",
"T",
",",
"Y",
">",
"TypedQuery",
"<",
"T",
">",
"createTypedQueryIn",
"(",
"Class",
"<",
"T",
">",
"entityCls",
",",
"SingularAttribute",
"<",
"T",
",",
"Y",
">",
"attribute",
",",
"List",
"<",
"Y",
">",
"values",
")",
"{",
"EntityMa... | Creates a typed query for entities that match any of the specified values
of the given attribute.
@param <T> the type of the entity class.
@param <Y>
@param entityCls
@param attribute
@param values
@return | [
"Creates",
"a",
"typed",
"query",
"for",
"entities",
"that",
"match",
"any",
"of",
"the",
"specified",
"values",
"of",
"the",
"given",
"attribute",
"."
] | 690036dde82a4f2c2106d32403cdf1c713429377 | https://github.com/eurekaclinical/eurekaclinical-standard-apis/blob/690036dde82a4f2c2106d32403cdf1c713429377/src/main/java/org/eurekaclinical/standardapis/dao/DatabaseSupport.java#L542-L556 |
149,739 | eurekaclinical/eurekaclinical-standard-apis | src/main/java/org/eurekaclinical/standardapis/dao/DatabaseSupport.java | DatabaseSupport.createTypedQuery | private <T, Y> TypedQuery<T> createTypedQuery(Class<T> entityCls,
SingularAttribute<T, Y> attribute, Y value) {
EntityManager entityManager = this.entityManagerProvider.get();
CriteriaBuilder builder = entityManager.getCriteriaBuilder();
CriteriaQuery<T> criteriaQuery = builder.creat... | java | private <T, Y> TypedQuery<T> createTypedQuery(Class<T> entityCls,
SingularAttribute<T, Y> attribute, Y value) {
EntityManager entityManager = this.entityManagerProvider.get();
CriteriaBuilder builder = entityManager.getCriteriaBuilder();
CriteriaQuery<T> criteriaQuery = builder.creat... | [
"private",
"<",
"T",
",",
"Y",
">",
"TypedQuery",
"<",
"T",
">",
"createTypedQuery",
"(",
"Class",
"<",
"T",
">",
"entityCls",
",",
"SingularAttribute",
"<",
"T",
",",
"Y",
">",
"attribute",
",",
"Y",
"value",
")",
"{",
"EntityManager",
"entityManager",
... | Creates a typed query for entities that have the given attribute value.
@param <T> the type of the entity class.
@param <Y> the type of the target attribute and target value.
@param attribute the attribute to compare.
@param value the target value for the given attribute.
@return a typed query that contains the given ... | [
"Creates",
"a",
"typed",
"query",
"for",
"entities",
"that",
"have",
"the",
"given",
"attribute",
"value",
"."
] | 690036dde82a4f2c2106d32403cdf1c713429377 | https://github.com/eurekaclinical/eurekaclinical-standard-apis/blob/690036dde82a4f2c2106d32403cdf1c713429377/src/main/java/org/eurekaclinical/standardapis/dao/DatabaseSupport.java#L567-L576 |
149,740 | eurekaclinical/eurekaclinical-standard-apis | src/main/java/org/eurekaclinical/standardapis/dao/DatabaseSupport.java | DatabaseSupport.createTypedQuery | private <T, Y extends Number> TypedQuery<T> createTypedQuery(
Class<T> entityCls, SingularAttribute<T, Y> attribute,
SqlComparator comparator, Y value) {
EntityManager entityManager = this.entityManagerProvider.get();
CriteriaBuilder builder = entityManager.getCriteriaBuilder();
... | java | private <T, Y extends Number> TypedQuery<T> createTypedQuery(
Class<T> entityCls, SingularAttribute<T, Y> attribute,
SqlComparator comparator, Y value) {
EntityManager entityManager = this.entityManagerProvider.get();
CriteriaBuilder builder = entityManager.getCriteriaBuilder();
... | [
"private",
"<",
"T",
",",
"Y",
"extends",
"Number",
">",
"TypedQuery",
"<",
"T",
">",
"createTypedQuery",
"(",
"Class",
"<",
"T",
">",
"entityCls",
",",
"SingularAttribute",
"<",
"T",
",",
"Y",
">",
"attribute",
",",
"SqlComparator",
"comparator",
",",
"... | Creates a typed query for entities with the given numerical attribute
value.
@param <T> the type of the entity to return.
@param <Y> the type of the attribute.
@param entityCls the entity's class.
@param attribute the attribute.
@param comparator the comparator.
@param value the value or value threshold.
@return a typ... | [
"Creates",
"a",
"typed",
"query",
"for",
"entities",
"with",
"the",
"given",
"numerical",
"attribute",
"value",
"."
] | 690036dde82a4f2c2106d32403cdf1c713429377 | https://github.com/eurekaclinical/eurekaclinical-standard-apis/blob/690036dde82a4f2c2106d32403cdf1c713429377/src/main/java/org/eurekaclinical/standardapis/dao/DatabaseSupport.java#L610-L643 |
149,741 | datoin/http-requests | src/main/java/org/datoin/net/http/Request.java | Request.get | protected Response get() {
RequestBuilder getRequest = RequestBuilder.get().setUri(url);
return executeHttpRequest(getRequest);
} | java | protected Response get() {
RequestBuilder getRequest = RequestBuilder.get().setUri(url);
return executeHttpRequest(getRequest);
} | [
"protected",
"Response",
"get",
"(",
")",
"{",
"RequestBuilder",
"getRequest",
"=",
"RequestBuilder",
".",
"get",
"(",
")",
".",
"setUri",
"(",
"url",
")",
";",
"return",
"executeHttpRequest",
"(",
"getRequest",
")",
";",
"}"
] | execute a get request from the Request object configuration
@return : a formatted Response object | [
"execute",
"a",
"get",
"request",
"from",
"the",
"Request",
"object",
"configuration"
] | 660a4bc516c594f321019df94451fead4dea19b6 | https://github.com/datoin/http-requests/blob/660a4bc516c594f321019df94451fead4dea19b6/src/main/java/org/datoin/net/http/Request.java#L105-L108 |
149,742 | datoin/http-requests | src/main/java/org/datoin/net/http/Request.java | Request.post | protected Response post() {
RequestBuilder builder = RequestBuilder.post().setUri(url);
return getResponseAfterDetectingType(builder);
} | java | protected Response post() {
RequestBuilder builder = RequestBuilder.post().setUri(url);
return getResponseAfterDetectingType(builder);
} | [
"protected",
"Response",
"post",
"(",
")",
"{",
"RequestBuilder",
"builder",
"=",
"RequestBuilder",
".",
"post",
"(",
")",
".",
"setUri",
"(",
"url",
")",
";",
"return",
"getResponseAfterDetectingType",
"(",
"builder",
")",
";",
"}"
] | execute a post request for this Request object
@return : Response object built from the http resposne | [
"execute",
"a",
"post",
"request",
"for",
"this",
"Request",
"object"
] | 660a4bc516c594f321019df94451fead4dea19b6 | https://github.com/datoin/http-requests/blob/660a4bc516c594f321019df94451fead4dea19b6/src/main/java/org/datoin/net/http/Request.java#L124-L127 |
149,743 | datoin/http-requests | src/main/java/org/datoin/net/http/Request.java | Request.setHeader | public Request setHeader(String name, String value) {
this.headers.put(name, value);
return this;
} | java | public Request setHeader(String name, String value) {
this.headers.put(name, value);
return this;
} | [
"public",
"Request",
"setHeader",
"(",
"String",
"name",
",",
"String",
"value",
")",
"{",
"this",
".",
"headers",
".",
"put",
"(",
"name",
",",
"value",
")",
";",
"return",
"this",
";",
"}"
] | seat a header and return modified request
@param name : header name
@param value : header value
@return : Request Object with header value set | [
"seat",
"a",
"header",
"and",
"return",
"modified",
"request"
] | 660a4bc516c594f321019df94451fead4dea19b6 | https://github.com/datoin/http-requests/blob/660a4bc516c594f321019df94451fead4dea19b6/src/main/java/org/datoin/net/http/Request.java#L183-L186 |
149,744 | datoin/http-requests | src/main/java/org/datoin/net/http/Request.java | Request.accept | public Request accept(String headerValue){
final String accept = RequestHeaderFields.ACCEPT.getName();
String acceptValue = headers.get(accept);
if (acceptValue == null){
acceptValue = headerValue;
} else {
acceptValue = acceptValue + ", " + headerValue;
}... | java | public Request accept(String headerValue){
final String accept = RequestHeaderFields.ACCEPT.getName();
String acceptValue = headers.get(accept);
if (acceptValue == null){
acceptValue = headerValue;
} else {
acceptValue = acceptValue + ", " + headerValue;
}... | [
"public",
"Request",
"accept",
"(",
"String",
"headerValue",
")",
"{",
"final",
"String",
"accept",
"=",
"RequestHeaderFields",
".",
"ACCEPT",
".",
"getName",
"(",
")",
";",
"String",
"acceptValue",
"=",
"headers",
".",
"get",
"(",
"accept",
")",
";",
"if"... | sets the accept header for the request, if exists then appends
@param headerValue : header field value to add
@return : Request Object with accept header value set | [
"sets",
"the",
"accept",
"header",
"for",
"the",
"request",
"if",
"exists",
"then",
"appends"
] | 660a4bc516c594f321019df94451fead4dea19b6 | https://github.com/datoin/http-requests/blob/660a4bc516c594f321019df94451fead4dea19b6/src/main/java/org/datoin/net/http/Request.java#L193-L202 |
149,745 | datoin/http-requests | src/main/java/org/datoin/net/http/Request.java | Request.acceptEncoding | public Request acceptEncoding(String encoding){
final String acceptEncoding = RequestHeaderFields.ACCEPT_ENCODING.getName();
String encodingValue = headers.get(acceptEncoding);
if (encodingValue == null){
encodingValue = encoding;
} else {
encodingValue = encoding... | java | public Request acceptEncoding(String encoding){
final String acceptEncoding = RequestHeaderFields.ACCEPT_ENCODING.getName();
String encodingValue = headers.get(acceptEncoding);
if (encodingValue == null){
encodingValue = encoding;
} else {
encodingValue = encoding... | [
"public",
"Request",
"acceptEncoding",
"(",
"String",
"encoding",
")",
"{",
"final",
"String",
"acceptEncoding",
"=",
"RequestHeaderFields",
".",
"ACCEPT_ENCODING",
".",
"getName",
"(",
")",
";",
"String",
"encodingValue",
"=",
"headers",
".",
"get",
"(",
"accep... | sets the accept encoding header for the request, if exists then appends
@param encoding : header field value to add
@return : Request Object with accept encoding header value set | [
"sets",
"the",
"accept",
"encoding",
"header",
"for",
"the",
"request",
"if",
"exists",
"then",
"appends"
] | 660a4bc516c594f321019df94451fead4dea19b6 | https://github.com/datoin/http-requests/blob/660a4bc516c594f321019df94451fead4dea19b6/src/main/java/org/datoin/net/http/Request.java#L209-L218 |
149,746 | datoin/http-requests | src/main/java/org/datoin/net/http/Request.java | Request.acceptLanguage | public Request acceptLanguage(String language){
final String acceptLanguage = RequestHeaderFields.ACCEPT_LANGUAGE.getName();
String languageValue = headers.get(acceptLanguage);
if (languageValue == null){
languageValue = language;
} else {
languageValue = language... | java | public Request acceptLanguage(String language){
final String acceptLanguage = RequestHeaderFields.ACCEPT_LANGUAGE.getName();
String languageValue = headers.get(acceptLanguage);
if (languageValue == null){
languageValue = language;
} else {
languageValue = language... | [
"public",
"Request",
"acceptLanguage",
"(",
"String",
"language",
")",
"{",
"final",
"String",
"acceptLanguage",
"=",
"RequestHeaderFields",
".",
"ACCEPT_LANGUAGE",
".",
"getName",
"(",
")",
";",
"String",
"languageValue",
"=",
"headers",
".",
"get",
"(",
"accep... | sets the accept language header for the request, if exists then appends
@param language : header field value to add
@return : Request Object with accept language header value set | [
"sets",
"the",
"accept",
"language",
"header",
"for",
"the",
"request",
"if",
"exists",
"then",
"appends"
] | 660a4bc516c594f321019df94451fead4dea19b6 | https://github.com/datoin/http-requests/blob/660a4bc516c594f321019df94451fead4dea19b6/src/main/java/org/datoin/net/http/Request.java#L225-L234 |
149,747 | datoin/http-requests | src/main/java/org/datoin/net/http/Request.java | Request.userAgent | public Request userAgent(String userAgentValue){
final String userAgent = RequestHeaderFields.USER_AGENT.getName();
String agent = headers.get(userAgent);
if (agent == null){
agent = userAgentValue;
} else {
agent = agent + " " + userAgentValue;
}
... | java | public Request userAgent(String userAgentValue){
final String userAgent = RequestHeaderFields.USER_AGENT.getName();
String agent = headers.get(userAgent);
if (agent == null){
agent = userAgentValue;
} else {
agent = agent + " " + userAgentValue;
}
... | [
"public",
"Request",
"userAgent",
"(",
"String",
"userAgentValue",
")",
"{",
"final",
"String",
"userAgent",
"=",
"RequestHeaderFields",
".",
"USER_AGENT",
".",
"getName",
"(",
")",
";",
"String",
"agent",
"=",
"headers",
".",
"get",
"(",
"userAgent",
")",
"... | sets the user agent header for the request, if exists then appends
@param userAgentValue : header field value to add
@return : Request Object with userAgent header value set | [
"sets",
"the",
"user",
"agent",
"header",
"for",
"the",
"request",
"if",
"exists",
"then",
"appends"
] | 660a4bc516c594f321019df94451fead4dea19b6 | https://github.com/datoin/http-requests/blob/660a4bc516c594f321019df94451fead4dea19b6/src/main/java/org/datoin/net/http/Request.java#L241-L250 |
149,748 | datoin/http-requests | src/main/java/org/datoin/net/http/Request.java | Request.referer | public Request referer(String refererValue){
final String referer = RequestHeaderFields.REFERER.getName();
return this.setHeader(referer, refererValue);
} | java | public Request referer(String refererValue){
final String referer = RequestHeaderFields.REFERER.getName();
return this.setHeader(referer, refererValue);
} | [
"public",
"Request",
"referer",
"(",
"String",
"refererValue",
")",
"{",
"final",
"String",
"referer",
"=",
"RequestHeaderFields",
".",
"REFERER",
".",
"getName",
"(",
")",
";",
"return",
"this",
".",
"setHeader",
"(",
"referer",
",",
"refererValue",
")",
";... | sets the Referer header for the request
@param refererValue : header field value to add
@return : Request Object with referer header value set | [
"sets",
"the",
"Referer",
"header",
"for",
"the",
"request"
] | 660a4bc516c594f321019df94451fead4dea19b6 | https://github.com/datoin/http-requests/blob/660a4bc516c594f321019df94451fead4dea19b6/src/main/java/org/datoin/net/http/Request.java#L257-L260 |
149,749 | datoin/http-requests | src/main/java/org/datoin/net/http/Request.java | Request.authorization | public Request authorization(String authorizationValue){
final String authorization = RequestHeaderFields.AUTHORIZATION.getName();
return this.setHeader(authorization, authorizationValue);
} | java | public Request authorization(String authorizationValue){
final String authorization = RequestHeaderFields.AUTHORIZATION.getName();
return this.setHeader(authorization, authorizationValue);
} | [
"public",
"Request",
"authorization",
"(",
"String",
"authorizationValue",
")",
"{",
"final",
"String",
"authorization",
"=",
"RequestHeaderFields",
".",
"AUTHORIZATION",
".",
"getName",
"(",
")",
";",
"return",
"this",
".",
"setHeader",
"(",
"authorization",
",",... | sets the Authorization header for the request
@param authorizationValue : header field value to add
@return : Request Object with authorization header value set | [
"sets",
"the",
"Authorization",
"header",
"for",
"the",
"request"
] | 660a4bc516c594f321019df94451fead4dea19b6 | https://github.com/datoin/http-requests/blob/660a4bc516c594f321019df94451fead4dea19b6/src/main/java/org/datoin/net/http/Request.java#L267-L270 |
149,750 | datoin/http-requests | src/main/java/org/datoin/net/http/Request.java | Request.authorize | public Request authorize(String name, String password){
String authString = name + ":" + password;
System.out.println("auth string: " + authString);
byte[] authEncBytes = Base64.encodeBase64(authString.getBytes());
String authStringEnc = new String(authEncBytes);
System.out.print... | java | public Request authorize(String name, String password){
String authString = name + ":" + password;
System.out.println("auth string: " + authString);
byte[] authEncBytes = Base64.encodeBase64(authString.getBytes());
String authStringEnc = new String(authEncBytes);
System.out.print... | [
"public",
"Request",
"authorize",
"(",
"String",
"name",
",",
"String",
"password",
")",
"{",
"String",
"authString",
"=",
"name",
"+",
"\":\"",
"+",
"password",
";",
"System",
".",
"out",
".",
"println",
"(",
"\"auth string: \"",
"+",
"authString",
")",
"... | method to set authorization header after computing digest from user and pasword
@param name : username
@param password : password
@return : Request Object with authorization header value set | [
"method",
"to",
"set",
"authorization",
"header",
"after",
"computing",
"digest",
"from",
"user",
"and",
"pasword"
] | 660a4bc516c594f321019df94451fead4dea19b6 | https://github.com/datoin/http-requests/blob/660a4bc516c594f321019df94451fead4dea19b6/src/main/java/org/datoin/net/http/Request.java#L278-L286 |
149,751 | datoin/http-requests | src/main/java/org/datoin/net/http/Request.java | Request.addInputStream | public Request addInputStream(String name , File file) throws FileNotFoundException {
this.postStreams.put(name, new FileInputStream(file));
return this;
} | java | public Request addInputStream(String name , File file) throws FileNotFoundException {
this.postStreams.put(name, new FileInputStream(file));
return this;
} | [
"public",
"Request",
"addInputStream",
"(",
"String",
"name",
",",
"File",
"file",
")",
"throws",
"FileNotFoundException",
"{",
"this",
".",
"postStreams",
".",
"put",
"(",
"name",
",",
"new",
"FileInputStream",
"(",
"file",
")",
")",
";",
"return",
"this",
... | for post only | [
"for",
"post",
"only"
] | 660a4bc516c594f321019df94451fead4dea19b6 | https://github.com/datoin/http-requests/blob/660a4bc516c594f321019df94451fead4dea19b6/src/main/java/org/datoin/net/http/Request.java#L360-L363 |
149,752 | datoin/http-requests | src/main/java/org/datoin/net/http/Request.java | Request.setContent | public Request setContent(String text, ContentType contentType) {
entity = new StringEntity(text, contentType);
return this;
} | java | public Request setContent(String text, ContentType contentType) {
entity = new StringEntity(text, contentType);
return this;
} | [
"public",
"Request",
"setContent",
"(",
"String",
"text",
",",
"ContentType",
"contentType",
")",
"{",
"entity",
"=",
"new",
"StringEntity",
"(",
"text",
",",
"contentType",
")",
";",
"return",
"this",
";",
"}"
] | set request content from input text string with given content type
@param text : text to be sent as http content
@param contentType : type of content set in header
@return : Request Object with content type header and conetnt entity value set | [
"set",
"request",
"content",
"from",
"input",
"text",
"string",
"with",
"given",
"content",
"type"
] | 660a4bc516c594f321019df94451fead4dea19b6 | https://github.com/datoin/http-requests/blob/660a4bc516c594f321019df94451fead4dea19b6/src/main/java/org/datoin/net/http/Request.java#L400-L403 |
149,753 | datoin/http-requests | src/main/java/org/datoin/net/http/Request.java | Request.setContent | public Request setContent(InputStream stream, ContentType contentType) {
entity = new InputStreamEntity(stream, contentType);
return this;
} | java | public Request setContent(InputStream stream, ContentType contentType) {
entity = new InputStreamEntity(stream, contentType);
return this;
} | [
"public",
"Request",
"setContent",
"(",
"InputStream",
"stream",
",",
"ContentType",
"contentType",
")",
"{",
"entity",
"=",
"new",
"InputStreamEntity",
"(",
"stream",
",",
"contentType",
")",
";",
"return",
"this",
";",
"}"
] | set request content from input stream with given content type
@param stream : teh input stream to be used as http content
@param contentType : type of content set in header
@return modified Request object with http content entity set | [
"set",
"request",
"content",
"from",
"input",
"stream",
"with",
"given",
"content",
"type"
] | 660a4bc516c594f321019df94451fead4dea19b6 | https://github.com/datoin/http-requests/blob/660a4bc516c594f321019df94451fead4dea19b6/src/main/java/org/datoin/net/http/Request.java#L411-L414 |
149,754 | datoin/http-requests | src/main/java/org/datoin/net/http/Request.java | Request.getFirstParam | public String getFirstParam(String paramName) {
Collection<String> values = this.params.get(paramName);
if(values == null || values.isEmpty()) {
return null;
} else {
return values.iterator().next();
}
} | java | public String getFirstParam(String paramName) {
Collection<String> values = this.params.get(paramName);
if(values == null || values.isEmpty()) {
return null;
} else {
return values.iterator().next();
}
} | [
"public",
"String",
"getFirstParam",
"(",
"String",
"paramName",
")",
"{",
"Collection",
"<",
"String",
">",
"values",
"=",
"this",
".",
"params",
".",
"get",
"(",
"paramName",
")",
";",
"if",
"(",
"values",
"==",
"null",
"||",
"values",
".",
"isEmpty",
... | gets first value of specific param.
@param paramName : name of the param to fetch value for
@return : first value in the collection corresponding param name if found, otherwise <code>null</code> | [
"gets",
"first",
"value",
"of",
"specific",
"param",
"."
] | 660a4bc516c594f321019df94451fead4dea19b6 | https://github.com/datoin/http-requests/blob/660a4bc516c594f321019df94451fead4dea19b6/src/main/java/org/datoin/net/http/Request.java#L431-L438 |
149,755 | datoin/http-requests | src/main/java/org/datoin/net/http/Request.java | Request.getParam | public java.util.Collection<String> getParam(String paramName) {
return this.params.get(paramName);
} | java | public java.util.Collection<String> getParam(String paramName) {
return this.params.get(paramName);
} | [
"public",
"java",
".",
"util",
".",
"Collection",
"<",
"String",
">",
"getParam",
"(",
"String",
"paramName",
")",
"{",
"return",
"this",
".",
"params",
".",
"get",
"(",
"paramName",
")",
";",
"}"
] | get specific param value
@param paramName : name of the param to fetch value for
@return : value of corresponding param name | [
"get",
"specific",
"param",
"value"
] | 660a4bc516c594f321019df94451fead4dea19b6 | https://github.com/datoin/http-requests/blob/660a4bc516c594f321019df94451fead4dea19b6/src/main/java/org/datoin/net/http/Request.java#L445-L447 |
149,756 | datoin/http-requests | src/main/java/org/datoin/net/http/Request.java | Request.getResponse | protected Response getResponse(HttpEntity entity, RequestBuilder req) {
CloseableHttpClient client = getClient();
initHeaders(req);
req.setEntity(entity);
CloseableHttpResponse resp = null;
Response response = null;
try {
final HttpUriRequest uriRequest = req.... | java | protected Response getResponse(HttpEntity entity, RequestBuilder req) {
CloseableHttpClient client = getClient();
initHeaders(req);
req.setEntity(entity);
CloseableHttpResponse resp = null;
Response response = null;
try {
final HttpUriRequest uriRequest = req.... | [
"protected",
"Response",
"getResponse",
"(",
"HttpEntity",
"entity",
",",
"RequestBuilder",
"req",
")",
"{",
"CloseableHttpClient",
"client",
"=",
"getClient",
"(",
")",
";",
"initHeaders",
"(",
"req",
")",
";",
"req",
".",
"setEntity",
"(",
"entity",
")",
"... | get response from preconfigured http entity and request builder
@param entity : http entity to be used in request
@param req : request builder object to build the http request
@return : Response object prepared after executing the request | [
"get",
"response",
"from",
"preconfigured",
"http",
"entity",
"and",
"request",
"builder"
] | 660a4bc516c594f321019df94451fead4dea19b6 | https://github.com/datoin/http-requests/blob/660a4bc516c594f321019df94451fead4dea19b6/src/main/java/org/datoin/net/http/Request.java#L455-L478 |
149,757 | likethecolor/Alchemy-API | src/main/java/com/likethecolor/alchemy/api/parser/json/AbstractParser.java | AbstractParser.getBoolean | protected Boolean getBoolean(final String key, final JSONObject jsonObject) {
Boolean value = null;
if(hasKey(key, jsonObject)) {
try {
value = jsonObject.getBoolean(key);
}
catch(JSONException e) {
LOGGER.debug("Could not get boolean from JSONObject for key: " + key, e);
... | java | protected Boolean getBoolean(final String key, final JSONObject jsonObject) {
Boolean value = null;
if(hasKey(key, jsonObject)) {
try {
value = jsonObject.getBoolean(key);
}
catch(JSONException e) {
LOGGER.debug("Could not get boolean from JSONObject for key: " + key, e);
... | [
"protected",
"Boolean",
"getBoolean",
"(",
"final",
"String",
"key",
",",
"final",
"JSONObject",
"jsonObject",
")",
"{",
"Boolean",
"value",
"=",
"null",
";",
"if",
"(",
"hasKey",
"(",
"key",
",",
"jsonObject",
")",
")",
"{",
"try",
"{",
"value",
"=",
... | Check to make sure the JSONObject has the specified key and if so return
the value as a boolean. If no key is found null is returned.
If the value is not JSON boolean (true/false) then {@link #getNonStandardBoolean(String, JSONObject)}
is called.
@param key name of the field to fetch from the json object
@param jsonO... | [
"Check",
"to",
"make",
"sure",
"the",
"JSONObject",
"has",
"the",
"specified",
"key",
"and",
"if",
"so",
"return",
"the",
"value",
"as",
"a",
"boolean",
".",
"If",
"no",
"key",
"is",
"found",
"null",
"is",
"returned",
"."
] | 5208cfc92a878ceeaff052787af29da92d98db7e | https://github.com/likethecolor/Alchemy-API/blob/5208cfc92a878ceeaff052787af29da92d98db7e/src/main/java/com/likethecolor/alchemy/api/parser/json/AbstractParser.java#L80-L93 |
149,758 | likethecolor/Alchemy-API | src/main/java/com/likethecolor/alchemy/api/parser/json/AbstractParser.java | AbstractParser.getDouble | protected Double getDouble(final String key, final JSONObject jsonObject) {
Double value = null;
if(hasKey(key, jsonObject)) {
try {
value = jsonObject.getDouble(key);
}
catch(JSONException e) {
LOGGER.error("Could not get Double from JSONObject for key: " + key, e);
}
... | java | protected Double getDouble(final String key, final JSONObject jsonObject) {
Double value = null;
if(hasKey(key, jsonObject)) {
try {
value = jsonObject.getDouble(key);
}
catch(JSONException e) {
LOGGER.error("Could not get Double from JSONObject for key: " + key, e);
}
... | [
"protected",
"Double",
"getDouble",
"(",
"final",
"String",
"key",
",",
"final",
"JSONObject",
"jsonObject",
")",
"{",
"Double",
"value",
"=",
"null",
";",
"if",
"(",
"hasKey",
"(",
"key",
",",
"jsonObject",
")",
")",
"{",
"try",
"{",
"value",
"=",
"js... | Check to make sure the JSONObject has the specified key and if so return
the value as a double. If no key is found null is returned.
@param key name of the field to fetch from the json object
@param jsonObject object from which to fetch the value
@return double value corresponding to the key or null if key not found | [
"Check",
"to",
"make",
"sure",
"the",
"JSONObject",
"has",
"the",
"specified",
"key",
"and",
"if",
"so",
"return",
"the",
"value",
"as",
"a",
"double",
".",
"If",
"no",
"key",
"is",
"found",
"null",
"is",
"returned",
"."
] | 5208cfc92a878ceeaff052787af29da92d98db7e | https://github.com/likethecolor/Alchemy-API/blob/5208cfc92a878ceeaff052787af29da92d98db7e/src/main/java/com/likethecolor/alchemy/api/parser/json/AbstractParser.java#L142-L153 |
149,759 | likethecolor/Alchemy-API | src/main/java/com/likethecolor/alchemy/api/parser/json/AbstractParser.java | AbstractParser.getInteger | protected Integer getInteger(final String key, final JSONObject jsonObject) {
Integer value = null;
if(hasKey(key, jsonObject)) {
try {
value = jsonObject.getInt(key);
}
catch(JSONException e) {
LOGGER.error("Could not get Integer from JSONObject for key: " + key, e);
}
... | java | protected Integer getInteger(final String key, final JSONObject jsonObject) {
Integer value = null;
if(hasKey(key, jsonObject)) {
try {
value = jsonObject.getInt(key);
}
catch(JSONException e) {
LOGGER.error("Could not get Integer from JSONObject for key: " + key, e);
}
... | [
"protected",
"Integer",
"getInteger",
"(",
"final",
"String",
"key",
",",
"final",
"JSONObject",
"jsonObject",
")",
"{",
"Integer",
"value",
"=",
"null",
";",
"if",
"(",
"hasKey",
"(",
"key",
",",
"jsonObject",
")",
")",
"{",
"try",
"{",
"value",
"=",
... | Check to make sure the JSONObject has the specified key and if so return
the value as a integer. If no key is found null is returned.
@param key name of the field to fetch from the json object
@param jsonObject object from which to fetch the value
@return integer value corresponding to the key or null if key not foun... | [
"Check",
"to",
"make",
"sure",
"the",
"JSONObject",
"has",
"the",
"specified",
"key",
"and",
"if",
"so",
"return",
"the",
"value",
"as",
"a",
"integer",
".",
"If",
"no",
"key",
"is",
"found",
"null",
"is",
"returned",
"."
] | 5208cfc92a878ceeaff052787af29da92d98db7e | https://github.com/likethecolor/Alchemy-API/blob/5208cfc92a878ceeaff052787af29da92d98db7e/src/main/java/com/likethecolor/alchemy/api/parser/json/AbstractParser.java#L164-L175 |
149,760 | likethecolor/Alchemy-API | src/main/java/com/likethecolor/alchemy/api/parser/json/AbstractParser.java | AbstractParser.getLong | protected Long getLong(final String key, final JSONObject jsonObject) {
Long value = null;
if(hasKey(key, jsonObject)) {
try {
value = jsonObject.getLong(key);
}
catch(JSONException e) {
LOGGER.error("Could not get Long from JSONObject for key: " + key, e);
}
}
re... | java | protected Long getLong(final String key, final JSONObject jsonObject) {
Long value = null;
if(hasKey(key, jsonObject)) {
try {
value = jsonObject.getLong(key);
}
catch(JSONException e) {
LOGGER.error("Could not get Long from JSONObject for key: " + key, e);
}
}
re... | [
"protected",
"Long",
"getLong",
"(",
"final",
"String",
"key",
",",
"final",
"JSONObject",
"jsonObject",
")",
"{",
"Long",
"value",
"=",
"null",
";",
"if",
"(",
"hasKey",
"(",
"key",
",",
"jsonObject",
")",
")",
"{",
"try",
"{",
"value",
"=",
"jsonObje... | Check to make sure the JSONObject has the specified key and if so return
the value as a long. If no key is found null is returned.
@param key name of the field to fetch from the json object
@param jsonObject object from which to fetch the value
@return long value corresponding to the key or null if key not found | [
"Check",
"to",
"make",
"sure",
"the",
"JSONObject",
"has",
"the",
"specified",
"key",
"and",
"if",
"so",
"return",
"the",
"value",
"as",
"a",
"long",
".",
"If",
"no",
"key",
"is",
"found",
"null",
"is",
"returned",
"."
] | 5208cfc92a878ceeaff052787af29da92d98db7e | https://github.com/likethecolor/Alchemy-API/blob/5208cfc92a878ceeaff052787af29da92d98db7e/src/main/java/com/likethecolor/alchemy/api/parser/json/AbstractParser.java#L186-L197 |
149,761 | likethecolor/Alchemy-API | src/main/java/com/likethecolor/alchemy/api/parser/json/AbstractParser.java | AbstractParser.getJSONArray | protected JSONArray getJSONArray(final String key, final JSONObject jsonObject) {
JSONArray value = new JSONArray();
if(hasKey(key, jsonObject)) {
try {
value = jsonObject.getJSONArray(key);
}
catch(JSONException e) {
LOGGER.error("Could not get JSONArray from JSONObject for ke... | java | protected JSONArray getJSONArray(final String key, final JSONObject jsonObject) {
JSONArray value = new JSONArray();
if(hasKey(key, jsonObject)) {
try {
value = jsonObject.getJSONArray(key);
}
catch(JSONException e) {
LOGGER.error("Could not get JSONArray from JSONObject for ke... | [
"protected",
"JSONArray",
"getJSONArray",
"(",
"final",
"String",
"key",
",",
"final",
"JSONObject",
"jsonObject",
")",
"{",
"JSONArray",
"value",
"=",
"new",
"JSONArray",
"(",
")",
";",
"if",
"(",
"hasKey",
"(",
"key",
",",
"jsonObject",
")",
")",
"{",
... | Check to make sure the JSONObject has the specified key and if so return
the value as a JSONArray. If no key is found an empty JSONArray is
returned.
@param key name of the field to fetch from the json object
@param jsonObject object from which to fetch the value
@return json array value corresponding to the key or "... | [
"Check",
"to",
"make",
"sure",
"the",
"JSONObject",
"has",
"the",
"specified",
"key",
"and",
"if",
"so",
"return",
"the",
"value",
"as",
"a",
"JSONArray",
".",
"If",
"no",
"key",
"is",
"found",
"an",
"empty",
"JSONArray",
"is",
"returned",
"."
] | 5208cfc92a878ceeaff052787af29da92d98db7e | https://github.com/likethecolor/Alchemy-API/blob/5208cfc92a878ceeaff052787af29da92d98db7e/src/main/java/com/likethecolor/alchemy/api/parser/json/AbstractParser.java#L256-L267 |
149,762 | likethecolor/Alchemy-API | src/main/java/com/likethecolor/alchemy/api/parser/json/AbstractParser.java | AbstractParser.getJSONObject | protected JSONObject getJSONObject(final String key, final JSONObject jsonObject) {
JSONObject json = null;
try {
if(hasKey(key, jsonObject)) {
json = jsonObject.getJSONObject(key);
}
}
catch(JSONException e) {
LOGGER.error("Could not get JSONObject from JSONObject for key: " +... | java | protected JSONObject getJSONObject(final String key, final JSONObject jsonObject) {
JSONObject json = null;
try {
if(hasKey(key, jsonObject)) {
json = jsonObject.getJSONObject(key);
}
}
catch(JSONException e) {
LOGGER.error("Could not get JSONObject from JSONObject for key: " +... | [
"protected",
"JSONObject",
"getJSONObject",
"(",
"final",
"String",
"key",
",",
"final",
"JSONObject",
"jsonObject",
")",
"{",
"JSONObject",
"json",
"=",
"null",
";",
"try",
"{",
"if",
"(",
"hasKey",
"(",
"key",
",",
"jsonObject",
")",
")",
"{",
"json",
... | Check to make sure the JSONObject has the specified key and if so return
the value as a JSONObject. If no key is found null is returned.
@param key name of the field to fetch from the json object
@param jsonObject object from which to fetch the value
@return json object value corresponding to the key or null if key n... | [
"Check",
"to",
"make",
"sure",
"the",
"JSONObject",
"has",
"the",
"specified",
"key",
"and",
"if",
"so",
"return",
"the",
"value",
"as",
"a",
"JSONObject",
".",
"If",
"no",
"key",
"is",
"found",
"null",
"is",
"returned",
"."
] | 5208cfc92a878ceeaff052787af29da92d98db7e | https://github.com/likethecolor/Alchemy-API/blob/5208cfc92a878ceeaff052787af29da92d98db7e/src/main/java/com/likethecolor/alchemy/api/parser/json/AbstractParser.java#L278-L289 |
149,763 | likethecolor/Alchemy-API | src/main/java/com/likethecolor/alchemy/api/parser/json/AbstractParser.java | AbstractParser.getJSONObject | protected JSONObject getJSONObject(final JSONArray jsonArray, final int index) {
JSONObject object = new JSONObject();
try {
object = (JSONObject) jsonArray.get(index);
}
catch(JSONException e) {
e.printStackTrace();
}
return object;
} | java | protected JSONObject getJSONObject(final JSONArray jsonArray, final int index) {
JSONObject object = new JSONObject();
try {
object = (JSONObject) jsonArray.get(index);
}
catch(JSONException e) {
e.printStackTrace();
}
return object;
} | [
"protected",
"JSONObject",
"getJSONObject",
"(",
"final",
"JSONArray",
"jsonArray",
",",
"final",
"int",
"index",
")",
"{",
"JSONObject",
"object",
"=",
"new",
"JSONObject",
"(",
")",
";",
"try",
"{",
"object",
"=",
"(",
"JSONObject",
")",
"jsonArray",
".",
... | Return a json object from the provided array. Return an empty object if
there is any problems fetching the named entity data.
@param jsonArray array of data
@param index of the object to fetch
@return json object from the provided array | [
"Return",
"a",
"json",
"object",
"from",
"the",
"provided",
"array",
".",
"Return",
"an",
"empty",
"object",
"if",
"there",
"is",
"any",
"problems",
"fetching",
"the",
"named",
"entity",
"data",
"."
] | 5208cfc92a878ceeaff052787af29da92d98db7e | https://github.com/likethecolor/Alchemy-API/blob/5208cfc92a878ceeaff052787af29da92d98db7e/src/main/java/com/likethecolor/alchemy/api/parser/json/AbstractParser.java#L300-L309 |
149,764 | likethecolor/Alchemy-API | src/main/java/com/likethecolor/alchemy/api/parser/json/AbstractParser.java | AbstractParser.getJSONObject | protected JSONObject getJSONObject(final String jsonString) {
JSONObject json = new JSONObject();
try {
json = new JSONObject(jsonString);
}
catch(NullPointerException e) {
LOGGER.error("JSON string cannot be null.", e);
}
catch(JSONException e) {
LOGGER.error("Could not parse ... | java | protected JSONObject getJSONObject(final String jsonString) {
JSONObject json = new JSONObject();
try {
json = new JSONObject(jsonString);
}
catch(NullPointerException e) {
LOGGER.error("JSON string cannot be null.", e);
}
catch(JSONException e) {
LOGGER.error("Could not parse ... | [
"protected",
"JSONObject",
"getJSONObject",
"(",
"final",
"String",
"jsonString",
")",
"{",
"JSONObject",
"json",
"=",
"new",
"JSONObject",
"(",
")",
";",
"try",
"{",
"json",
"=",
"new",
"JSONObject",
"(",
"jsonString",
")",
";",
"}",
"catch",
"(",
"NullPo... | Fetch a JSONObject from the provided string.
@param jsonString json string
@return json object representing the string or null if there is an exception | [
"Fetch",
"a",
"JSONObject",
"from",
"the",
"provided",
"string",
"."
] | 5208cfc92a878ceeaff052787af29da92d98db7e | https://github.com/likethecolor/Alchemy-API/blob/5208cfc92a878ceeaff052787af29da92d98db7e/src/main/java/com/likethecolor/alchemy/api/parser/json/AbstractParser.java#L318-L330 |
149,765 | likethecolor/Alchemy-API | src/main/java/com/likethecolor/alchemy/api/parser/json/AbstractParser.java | AbstractParser.hasKey | protected boolean hasKey(final String key, final JSONObject jsonObject) {
return jsonObject != null
&& jsonObject.has(key);
} | java | protected boolean hasKey(final String key, final JSONObject jsonObject) {
return jsonObject != null
&& jsonObject.has(key);
} | [
"protected",
"boolean",
"hasKey",
"(",
"final",
"String",
"key",
",",
"final",
"JSONObject",
"jsonObject",
")",
"{",
"return",
"jsonObject",
"!=",
"null",
"&&",
"jsonObject",
".",
"has",
"(",
"key",
")",
";",
"}"
] | Does the JSONObject have a specified key?
@param key key to check
@param jsonObject object to check
@return true if the key exists | [
"Does",
"the",
"JSONObject",
"have",
"a",
"specified",
"key?"
] | 5208cfc92a878ceeaff052787af29da92d98db7e | https://github.com/likethecolor/Alchemy-API/blob/5208cfc92a878ceeaff052787af29da92d98db7e/src/main/java/com/likethecolor/alchemy/api/parser/json/AbstractParser.java#L340-L343 |
149,766 | likethecolor/Alchemy-API | src/main/java/com/likethecolor/alchemy/api/entity/ConceptAlchemyEntity.java | ConceptAlchemyEntity.setConcept | public void setConcept(String concept) {
if(concept != null) {
concept = concept.trim();
}
this.concept = concept;
} | java | public void setConcept(String concept) {
if(concept != null) {
concept = concept.trim();
}
this.concept = concept;
} | [
"public",
"void",
"setConcept",
"(",
"String",
"concept",
")",
"{",
"if",
"(",
"concept",
"!=",
"null",
")",
"{",
"concept",
"=",
"concept",
".",
"trim",
"(",
")",
";",
"}",
"this",
".",
"concept",
"=",
"concept",
";",
"}"
] | Set the detected concept tag.
@param concept detected concept tag | [
"Set",
"the",
"detected",
"concept",
"tag",
"."
] | 5208cfc92a878ceeaff052787af29da92d98db7e | https://github.com/likethecolor/Alchemy-API/blob/5208cfc92a878ceeaff052787af29da92d98db7e/src/main/java/com/likethecolor/alchemy/api/entity/ConceptAlchemyEntity.java#L86-L91 |
149,767 | gondor/kbop | src/main/java/org/pacesys/kbop/internal/AbstractKeyedObjectPool.java | AbstractKeyedObjectPool.createFuture | protected PoolWaitFuture<E> createFuture(final PoolKey<K> key) {
return new PoolWaitFuture<E>(lock) {
protected E getPoolObject(long timeout, TimeUnit unit) throws IOException, InterruptedException, TimeoutException {
return getBlockingUntilAvailableOrTimeout(key, timeout, unit, this);
}
};
} | java | protected PoolWaitFuture<E> createFuture(final PoolKey<K> key) {
return new PoolWaitFuture<E>(lock) {
protected E getPoolObject(long timeout, TimeUnit unit) throws IOException, InterruptedException, TimeoutException {
return getBlockingUntilAvailableOrTimeout(key, timeout, unit, this);
}
};
} | [
"protected",
"PoolWaitFuture",
"<",
"E",
">",
"createFuture",
"(",
"final",
"PoolKey",
"<",
"K",
">",
"key",
")",
"{",
"return",
"new",
"PoolWaitFuture",
"<",
"E",
">",
"(",
"lock",
")",
"{",
"protected",
"E",
"getPoolObject",
"(",
"long",
"timeout",
","... | Creates a Future which will wait for the Keyed Object to become available or timeout
@param key the Pool Key
@return PoolWaitFuture | [
"Creates",
"a",
"Future",
"which",
"will",
"wait",
"for",
"the",
"Keyed",
"Object",
"to",
"become",
"available",
"or",
"timeout"
] | a176fd845f1e146610f03a1cb3cb0d661ebf4faa | https://github.com/gondor/kbop/blob/a176fd845f1e146610f03a1cb3cb0d661ebf4faa/src/main/java/org/pacesys/kbop/internal/AbstractKeyedObjectPool.java#L89-L95 |
149,768 | gondor/kbop | src/main/java/org/pacesys/kbop/internal/AbstractKeyedObjectPool.java | AbstractKeyedObjectPool.createOrAttemptToBorrow | protected E createOrAttemptToBorrow(final PoolKey<K> key) {
E entry = null;
if (!pool.containsKey(key))
{
entry = create(key).initialize(key, this);
pool.put(key, entry);
borrowed.add(entry);
return entry;
}
entry = pool.get(key);
if (borrowed.add(entry))
{
factory.activate(entry.get());
... | java | protected E createOrAttemptToBorrow(final PoolKey<K> key) {
E entry = null;
if (!pool.containsKey(key))
{
entry = create(key).initialize(key, this);
pool.put(key, entry);
borrowed.add(entry);
return entry;
}
entry = pool.get(key);
if (borrowed.add(entry))
{
factory.activate(entry.get());
... | [
"protected",
"E",
"createOrAttemptToBorrow",
"(",
"final",
"PoolKey",
"<",
"K",
">",
"key",
")",
"{",
"E",
"entry",
"=",
"null",
";",
"if",
"(",
"!",
"pool",
".",
"containsKey",
"(",
"key",
")",
")",
"{",
"entry",
"=",
"create",
"(",
"key",
")",
".... | Default Single Key to Single Object implementation. Advanced Pools extending this class can override this behavior. If the key does not exist then
an entry should be created and returned. If the key exists and is not borrowed then the entry should be returned.
If the key exists and is already borrowed then null shou... | [
"Default",
"Single",
"Key",
"to",
"Single",
"Object",
"implementation",
".",
"Advanced",
"Pools",
"extending",
"this",
"class",
"can",
"override",
"this",
"behavior",
".",
"If",
"the",
"key",
"does",
"not",
"exist",
"then",
"an",
"entry",
"should",
"be",
"cr... | a176fd845f1e146610f03a1cb3cb0d661ebf4faa | https://github.com/gondor/kbop/blob/a176fd845f1e146610f03a1cb3cb0d661ebf4faa/src/main/java/org/pacesys/kbop/internal/AbstractKeyedObjectPool.java#L185-L204 |
149,769 | gondor/kbop | src/main/java/org/pacesys/kbop/internal/AbstractKeyedObjectPool.java | AbstractKeyedObjectPool.await | protected boolean await(final PoolWaitFuture<E> future, final PoolKey<K> key, Date deadline) throws InterruptedException {
try
{
waiting.add(future);
return future.await(deadline);
}
finally {
waiting.remove(future);
}
} | java | protected boolean await(final PoolWaitFuture<E> future, final PoolKey<K> key, Date deadline) throws InterruptedException {
try
{
waiting.add(future);
return future.await(deadline);
}
finally {
waiting.remove(future);
}
} | [
"protected",
"boolean",
"await",
"(",
"final",
"PoolWaitFuture",
"<",
"E",
">",
"future",
",",
"final",
"PoolKey",
"<",
"K",
">",
"key",
",",
"Date",
"deadline",
")",
"throws",
"InterruptedException",
"{",
"try",
"{",
"waiting",
".",
"add",
"(",
"future",
... | Adds the current PoolWaitFuture into the waiting list. The future will wait up until the specified deadline. If the future is woken up before the
specified deadline then true is returned otherwise false. The future will always be removed from the wait list regardless
of the outcome.
@param future the PoolWaitFuture... | [
"Adds",
"the",
"current",
"PoolWaitFuture",
"into",
"the",
"waiting",
"list",
".",
"The",
"future",
"will",
"wait",
"up",
"until",
"the",
"specified",
"deadline",
".",
"If",
"the",
"future",
"is",
"woken",
"up",
"before",
"the",
"specified",
"deadline",
"the... | a176fd845f1e146610f03a1cb3cb0d661ebf4faa | https://github.com/gondor/kbop/blob/a176fd845f1e146610f03a1cb3cb0d661ebf4faa/src/main/java/org/pacesys/kbop/internal/AbstractKeyedObjectPool.java#L217-L226 |
149,770 | dhemery/hartley | src/main/java/com/dhemery/core/Lazily.java | Lazily.get | public static <T> Lazy<T> get(Supplier<? extends T> supplier) {
return new SuppliedLazy<T>(supplier);
} | java | public static <T> Lazy<T> get(Supplier<? extends T> supplier) {
return new SuppliedLazy<T>(supplier);
} | [
"public",
"static",
"<",
"T",
">",
"Lazy",
"<",
"T",
">",
"get",
"(",
"Supplier",
"<",
"?",
"extends",
"T",
">",
"supplier",
")",
"{",
"return",
"new",
"SuppliedLazy",
"<",
"T",
">",
"(",
"supplier",
")",
";",
"}"
] | Create a lazy supplier that will obtain its value from another supplier.
@param supplier the supplier from which to obtain the value
@param <T> the type of value to supply
@return a lazy supplier that will obtain its value from the given supplier | [
"Create",
"a",
"lazy",
"supplier",
"that",
"will",
"obtain",
"its",
"value",
"from",
"another",
"supplier",
"."
] | 7754bd6bc12695f2249601b8890da530a61fcf33 | https://github.com/dhemery/hartley/blob/7754bd6bc12695f2249601b8890da530a61fcf33/src/main/java/com/dhemery/core/Lazily.java#L15-L17 |
149,771 | dhemery/hartley | src/main/java/com/dhemery/core/Lazily.java | Lazily.build | public static <T> Lazy<T> build(final Builder<? extends T> builder) {
return new SuppliedLazy<T>(new Supplier<T>() {
@Override
public T get() {
return builder.build();
}
});
} | java | public static <T> Lazy<T> build(final Builder<? extends T> builder) {
return new SuppliedLazy<T>(new Supplier<T>() {
@Override
public T get() {
return builder.build();
}
});
} | [
"public",
"static",
"<",
"T",
">",
"Lazy",
"<",
"T",
">",
"build",
"(",
"final",
"Builder",
"<",
"?",
"extends",
"T",
">",
"builder",
")",
"{",
"return",
"new",
"SuppliedLazy",
"<",
"T",
">",
"(",
"new",
"Supplier",
"<",
"T",
">",
"(",
")",
"{",
... | Create a lazy supplier that will obtain its value from a builder.
@param builder the builder from which to obtain the value
@param <T> the type of value to supply
@return a lazy supplier that will obtain its value from the given builder | [
"Create",
"a",
"lazy",
"supplier",
"that",
"will",
"obtain",
"its",
"value",
"from",
"a",
"builder",
"."
] | 7754bd6bc12695f2249601b8890da530a61fcf33 | https://github.com/dhemery/hartley/blob/7754bd6bc12695f2249601b8890da530a61fcf33/src/main/java/com/dhemery/core/Lazily.java#L25-L32 |
149,772 | nhurion/vaadin-for-heroku | src/main/java/eu/hurion/vaadin/heroku/VaadinForHeroku.java | VaadinForHeroku.localServer | public static VaadinForHeroku localServer(final VaadinForHeroku server) {
return server.withHttpPort(VaadinForHeroku.DEFAULT_PORT)
.withProductionMode(false)
.openBrowser(true);
} | java | public static VaadinForHeroku localServer(final VaadinForHeroku server) {
return server.withHttpPort(VaadinForHeroku.DEFAULT_PORT)
.withProductionMode(false)
.openBrowser(true);
} | [
"public",
"static",
"VaadinForHeroku",
"localServer",
"(",
"final",
"VaadinForHeroku",
"server",
")",
"{",
"return",
"server",
".",
"withHttpPort",
"(",
"VaadinForHeroku",
".",
"DEFAULT_PORT",
")",
".",
"withProductionMode",
"(",
"false",
")",
".",
"openBrowser",
... | Configures the given server for local development
@param server the server to be configured for local development
@since 0.3 | [
"Configures",
"the",
"given",
"server",
"for",
"local",
"development"
] | 51b1c22827934eb6105b0cfb0254cc15df23e991 | https://github.com/nhurion/vaadin-for-heroku/blob/51b1c22827934eb6105b0cfb0254cc15df23e991/src/main/java/eu/hurion/vaadin/heroku/VaadinForHeroku.java#L69-L74 |
149,773 | nhurion/vaadin-for-heroku | src/main/java/eu/hurion/vaadin/heroku/VaadinForHeroku.java | VaadinForHeroku.herokuServer | public static VaadinForHeroku herokuServer(final VaadinForHeroku server) {
return server
.withMemcachedSessionManager(MemcachedManagerBuilder.memcacheAddOn())
.withHttpPort(Integer.parseInt(System.getenv(VaadinForHeroku.PORT)))
.withProductionMode(true)
... | java | public static VaadinForHeroku herokuServer(final VaadinForHeroku server) {
return server
.withMemcachedSessionManager(MemcachedManagerBuilder.memcacheAddOn())
.withHttpPort(Integer.parseInt(System.getenv(VaadinForHeroku.PORT)))
.withProductionMode(true)
... | [
"public",
"static",
"VaadinForHeroku",
"herokuServer",
"(",
"final",
"VaadinForHeroku",
"server",
")",
"{",
"return",
"server",
".",
"withMemcachedSessionManager",
"(",
"MemcachedManagerBuilder",
".",
"memcacheAddOn",
"(",
")",
")",
".",
"withHttpPort",
"(",
"Integer"... | Configures the given server for Heroku
@param server the server to be configured for heroku environment
@since 0.3 | [
"Configures",
"the",
"given",
"server",
"for",
"Heroku"
] | 51b1c22827934eb6105b0cfb0254cc15df23e991 | https://github.com/nhurion/vaadin-for-heroku/blob/51b1c22827934eb6105b0cfb0254cc15df23e991/src/main/java/eu/hurion/vaadin/heroku/VaadinForHeroku.java#L82-L89 |
149,774 | nhurion/vaadin-for-heroku | src/main/java/eu/hurion/vaadin/heroku/VaadinForHeroku.java | VaadinForHeroku.withFilterDefinition | public VaadinForHeroku withFilterDefinition(final FilterDefinitionBuilder... filterDefs){
checkVarArgsArguments(filterDefs);
this.filterDefinitions.addAll(Arrays.asList(filterDefs));
return self();
} | java | public VaadinForHeroku withFilterDefinition(final FilterDefinitionBuilder... filterDefs){
checkVarArgsArguments(filterDefs);
this.filterDefinitions.addAll(Arrays.asList(filterDefs));
return self();
} | [
"public",
"VaadinForHeroku",
"withFilterDefinition",
"(",
"final",
"FilterDefinitionBuilder",
"...",
"filterDefs",
")",
"{",
"checkVarArgsArguments",
"(",
"filterDefs",
")",
";",
"this",
".",
"filterDefinitions",
".",
"addAll",
"(",
"Arrays",
".",
"asList",
"(",
"fi... | Add filter definitions to the server configuration.
@param filterDefs the filter definition(s) to add.
@since 0.3 | [
"Add",
"filter",
"definitions",
"to",
"the",
"server",
"configuration",
"."
] | 51b1c22827934eb6105b0cfb0254cc15df23e991 | https://github.com/nhurion/vaadin-for-heroku/blob/51b1c22827934eb6105b0cfb0254cc15df23e991/src/main/java/eu/hurion/vaadin/heroku/VaadinForHeroku.java#L163-L167 |
149,775 | nhurion/vaadin-for-heroku | src/main/java/eu/hurion/vaadin/heroku/VaadinForHeroku.java | VaadinForHeroku.withApplicationListener | public VaadinForHeroku withApplicationListener(final String... listeners){
checkVarArgsArguments(listeners);
this.applicationListeners.addAll(Arrays.asList(listeners));
return self();
} | java | public VaadinForHeroku withApplicationListener(final String... listeners){
checkVarArgsArguments(listeners);
this.applicationListeners.addAll(Arrays.asList(listeners));
return self();
} | [
"public",
"VaadinForHeroku",
"withApplicationListener",
"(",
"final",
"String",
"...",
"listeners",
")",
"{",
"checkVarArgsArguments",
"(",
"listeners",
")",
";",
"this",
".",
"applicationListeners",
".",
"addAll",
"(",
"Arrays",
".",
"asList",
"(",
"listeners",
"... | Add an application listener to the configuration of the server.
@param listeners the application listener(s) to add to the server configuration.
@since 0.3 | [
"Add",
"an",
"application",
"listener",
"to",
"the",
"configuration",
"of",
"the",
"server",
"."
] | 51b1c22827934eb6105b0cfb0254cc15df23e991 | https://github.com/nhurion/vaadin-for-heroku/blob/51b1c22827934eb6105b0cfb0254cc15df23e991/src/main/java/eu/hurion/vaadin/heroku/VaadinForHeroku.java#L189-L193 |
149,776 | Terradue/jcatalogue-client | core/src/main/java/com/terradue/jcatalogue/client/CatalogueClient.java | CatalogueClient.invoke | <CE extends CatalogueEntity> CE invoke( final DigesterLoader digesterLoader, String uri, Parameter...parameters )
{
uri = checkNotNull( uri, "Input URI cannot be null" );
try
{
return invoke( digesterLoader, new URI( uri ), parameters );
}
catch ( URISyntaxExcept... | java | <CE extends CatalogueEntity> CE invoke( final DigesterLoader digesterLoader, String uri, Parameter...parameters )
{
uri = checkNotNull( uri, "Input URI cannot be null" );
try
{
return invoke( digesterLoader, new URI( uri ), parameters );
}
catch ( URISyntaxExcept... | [
"<",
"CE",
"extends",
"CatalogueEntity",
">",
"CE",
"invoke",
"(",
"final",
"DigesterLoader",
"digesterLoader",
",",
"String",
"uri",
",",
"Parameter",
"...",
"parameters",
")",
"{",
"uri",
"=",
"checkNotNull",
"(",
"uri",
",",
"\"Input URI cannot be null\"",
")... | generic internal methods | [
"generic",
"internal",
"methods"
] | 1f24c4da952d8ad2373c4fa97eed48b0b8a88d21 | https://github.com/Terradue/jcatalogue-client/blob/1f24c4da952d8ad2373c4fa97eed48b0b8a88d21/core/src/main/java/com/terradue/jcatalogue/client/CatalogueClient.java#L180-L192 |
149,777 | mlhartme/mork | src/main/java/net/oneandone/mork/semantics/Alternative.java | Alternative.compare | public int compare(Alternative ab) {
if (production != ab.production) {
throw new IllegalArgumentException();
}
// TODO: compare two ups
if (resultOfs != -1 || ab.resultOfs != -1) {
return NE;
}
if (argsOfs.size() == 0 && ab.argsOfs.size() == 0) {
... | java | public int compare(Alternative ab) {
if (production != ab.production) {
throw new IllegalArgumentException();
}
// TODO: compare two ups
if (resultOfs != -1 || ab.resultOfs != -1) {
return NE;
}
if (argsOfs.size() == 0 && ab.argsOfs.size() == 0) {
... | [
"public",
"int",
"compare",
"(",
"Alternative",
"ab",
")",
"{",
"if",
"(",
"production",
"!=",
"ab",
".",
"production",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
")",
";",
"}",
"// TODO: compare two ups",
"if",
"(",
"resultOfs",
"!=",
"-",
... | Compares functions.
@return NE: neither LT nor GT. EQ: maybe. ALT: equal, but don't add follow states | [
"Compares",
"functions",
"."
] | a069b087750c4133bfeebaf1f599c3bc96762113 | https://github.com/mlhartme/mork/blob/a069b087750c4133bfeebaf1f599c3bc96762113/src/main/java/net/oneandone/mork/semantics/Alternative.java#L72-L100 |
149,778 | likethecolor/Alchemy-API | src/main/java/com/likethecolor/alchemy/api/entity/AlchemyVerb.java | AlchemyVerb.setIsNegated | public void setIsNegated(final Integer isNegated) {
if(isNegated != null) {
if(isNegated == 1) {
setIsNegated(true);
}
if(isNegated == 0) {
setIsNegated(false);
}
}
} | java | public void setIsNegated(final Integer isNegated) {
if(isNegated != null) {
if(isNegated == 1) {
setIsNegated(true);
}
if(isNegated == 0) {
setIsNegated(false);
}
}
} | [
"public",
"void",
"setIsNegated",
"(",
"final",
"Integer",
"isNegated",
")",
"{",
"if",
"(",
"isNegated",
"!=",
"null",
")",
"{",
"if",
"(",
"isNegated",
"==",
"1",
")",
"{",
"setIsNegated",
"(",
"true",
")",
";",
"}",
"if",
"(",
"isNegated",
"==",
"... | Set whether this action verb was negated.
@param isNegated whether this action verb was negated | [
"Set",
"whether",
"this",
"action",
"verb",
"was",
"negated",
"."
] | 5208cfc92a878ceeaff052787af29da92d98db7e | https://github.com/likethecolor/Alchemy-API/blob/5208cfc92a878ceeaff052787af29da92d98db7e/src/main/java/com/likethecolor/alchemy/api/entity/AlchemyVerb.java#L65-L74 |
149,779 | cnery/cgateinterface | src/com/daveoxley/cbus/CGateInterface.java | CGateInterface.connect | public static CGateSession connect(InetAddress cgate_server, int command_port, int event_port, int status_change_port)
{
return new CGateSession(cgate_server, command_port, event_port, status_change_port);
} | java | public static CGateSession connect(InetAddress cgate_server, int command_port, int event_port, int status_change_port)
{
return new CGateSession(cgate_server, command_port, event_port, status_change_port);
} | [
"public",
"static",
"CGateSession",
"connect",
"(",
"InetAddress",
"cgate_server",
",",
"int",
"command_port",
",",
"int",
"event_port",
",",
"int",
"status_change_port",
")",
"{",
"return",
"new",
"CGateSession",
"(",
"cgate_server",
",",
"command_port",
",",
"ev... | Connect to a C-Gate server using the supplied cgate_server and cgate_port.
@param cgate_server The <code>InetAddress</code> of the C-Gate server
@param command_port The command port for the C-Gate server
@param event_port The event port for the C-Gate server
@param status_change_port The status change port for the C-G... | [
"Connect",
"to",
"a",
"C",
"-",
"Gate",
"server",
"using",
"the",
"supplied",
"cgate_server",
"and",
"cgate_port",
"."
] | faef84f60b31601240ab4cbf026670822a782b0b | https://github.com/cnery/cgateinterface/blob/faef84f60b31601240ab4cbf026670822a782b0b/src/com/daveoxley/cbus/CGateInterface.java#L65-L68 |
149,780 | bi-geek/flink-connector-ethereum | src/main/java/com/bigeek/flink/utils/EthereumUtils.java | EthereumUtils.createOkHttpClient | private static OkHttpClient createOkHttpClient(Long timeoutSeconds) {
OkHttpClient.Builder builder = new OkHttpClient.Builder();
if (timeoutSeconds != null) {
builder.connectTimeout(timeoutSeconds, TimeUnit.SECONDS);
builder.readTimeout(timeoutSeconds, TimeUnit.SECONDS);
... | java | private static OkHttpClient createOkHttpClient(Long timeoutSeconds) {
OkHttpClient.Builder builder = new OkHttpClient.Builder();
if (timeoutSeconds != null) {
builder.connectTimeout(timeoutSeconds, TimeUnit.SECONDS);
builder.readTimeout(timeoutSeconds, TimeUnit.SECONDS);
... | [
"private",
"static",
"OkHttpClient",
"createOkHttpClient",
"(",
"Long",
"timeoutSeconds",
")",
"{",
"OkHttpClient",
".",
"Builder",
"builder",
"=",
"new",
"OkHttpClient",
".",
"Builder",
"(",
")",
";",
"if",
"(",
"timeoutSeconds",
"!=",
"null",
")",
"{",
"buil... | Create OkHttpClient client for Web3j.
@param timeoutSeconds, can be null
@return OkHttpClient. | [
"Create",
"OkHttpClient",
"client",
"for",
"Web3j",
"."
] | 9ecedbf999fc410e50225c3f69b5041df4c61a33 | https://github.com/bi-geek/flink-connector-ethereum/blob/9ecedbf999fc410e50225c3f69b5041df4c61a33/src/main/java/com/bigeek/flink/utils/EthereumUtils.java#L29-L37 |
149,781 | bi-geek/flink-connector-ethereum | src/main/java/com/bigeek/flink/utils/EthereumUtils.java | EthereumUtils.generateClient | public static Web3j generateClient(String clientAddress, Long timeoutSeconds) {
if (isEmpty(clientAddress)) {
throw new IllegalArgumentException("You have to define client address, use constructor or environment variable 'web3j.clientAddress'");
}
Web3jService web3jService;
... | java | public static Web3j generateClient(String clientAddress, Long timeoutSeconds) {
if (isEmpty(clientAddress)) {
throw new IllegalArgumentException("You have to define client address, use constructor or environment variable 'web3j.clientAddress'");
}
Web3jService web3jService;
... | [
"public",
"static",
"Web3j",
"generateClient",
"(",
"String",
"clientAddress",
",",
"Long",
"timeoutSeconds",
")",
"{",
"if",
"(",
"isEmpty",
"(",
"clientAddress",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"You have to define client address, us... | Generate Ethereum client.
@param clientAddress
@param timeoutSeconds
@return Web3j client | [
"Generate",
"Ethereum",
"client",
"."
] | 9ecedbf999fc410e50225c3f69b5041df4c61a33 | https://github.com/bi-geek/flink-connector-ethereum/blob/9ecedbf999fc410e50225c3f69b5041df4c61a33/src/main/java/com/bigeek/flink/utils/EthereumUtils.java#L46-L68 |
149,782 | bwkimmel/jdcp | jdcp-worker-app/src/main/java/ca/eandb/jdcp/worker/ConnectionDialog.java | ConnectionDialog.getMainPanel | private JPanel getMainPanel() {
if (mainPanel == null) {
mainPanel = new JPanel();
mainPanel.setLayout(new GridBagLayout());
GridBagConstraints c = new GridBagConstraints();
c.insets = new Insets(5, 5, 5, 5);
c.fill = GridBagConstraints.HORIZONTAL;
c.gridx = 0;
c.gridy = ... | java | private JPanel getMainPanel() {
if (mainPanel == null) {
mainPanel = new JPanel();
mainPanel.setLayout(new GridBagLayout());
GridBagConstraints c = new GridBagConstraints();
c.insets = new Insets(5, 5, 5, 5);
c.fill = GridBagConstraints.HORIZONTAL;
c.gridx = 0;
c.gridy = ... | [
"private",
"JPanel",
"getMainPanel",
"(",
")",
"{",
"if",
"(",
"mainPanel",
"==",
"null",
")",
"{",
"mainPanel",
"=",
"new",
"JPanel",
"(",
")",
";",
"mainPanel",
".",
"setLayout",
"(",
"new",
"GridBagLayout",
"(",
")",
")",
";",
"GridBagConstraints",
"c... | This method initializes mainPanel
@return javax.swing.JPanel | [
"This",
"method",
"initializes",
"mainPanel"
] | 630c5150c245054e2556ff370f4bad2ec793dfb7 | https://github.com/bwkimmel/jdcp/blob/630c5150c245054e2556ff370f4bad2ec793dfb7/jdcp-worker-app/src/main/java/ca/eandb/jdcp/worker/ConnectionDialog.java#L162-L212 |
149,783 | bwkimmel/jdcp | jdcp-worker-app/src/main/java/ca/eandb/jdcp/worker/ConnectionDialog.java | ConnectionDialog.getButtonPanel | private JPanel getButtonPanel() {
if (buttonPanel == null) {
buttonPanel = new JPanel();
buttonPanel.setLayout(new GridBagLayout());
GridBagConstraints c1 = new GridBagConstraints();
c1.anchor = GridBagConstraints.EAST;
c1.gridx = 0;
c1.gridy = 0;
c1.weightx = 1.0D;
... | java | private JPanel getButtonPanel() {
if (buttonPanel == null) {
buttonPanel = new JPanel();
buttonPanel.setLayout(new GridBagLayout());
GridBagConstraints c1 = new GridBagConstraints();
c1.anchor = GridBagConstraints.EAST;
c1.gridx = 0;
c1.gridy = 0;
c1.weightx = 1.0D;
... | [
"private",
"JPanel",
"getButtonPanel",
"(",
")",
"{",
"if",
"(",
"buttonPanel",
"==",
"null",
")",
"{",
"buttonPanel",
"=",
"new",
"JPanel",
"(",
")",
";",
"buttonPanel",
".",
"setLayout",
"(",
"new",
"GridBagLayout",
"(",
")",
")",
";",
"GridBagConstraint... | This method initializes buttonPanel
@return javax.swing.JPanel | [
"This",
"method",
"initializes",
"buttonPanel"
] | 630c5150c245054e2556ff370f4bad2ec793dfb7 | https://github.com/bwkimmel/jdcp/blob/630c5150c245054e2556ff370f4bad2ec793dfb7/jdcp-worker-app/src/main/java/ca/eandb/jdcp/worker/ConnectionDialog.java#L219-L240 |
149,784 | bwkimmel/jdcp | jdcp-worker-app/src/main/java/ca/eandb/jdcp/worker/ConnectionDialog.java | ConnectionDialog.getCancelButton | private JButton getCancelButton() {
if (cancelButton == null) {
cancelButton = new JButton();
cancelButton.setText("Cancel");
cancelButton.setMnemonic('C');
cancelButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent e) ... | java | private JButton getCancelButton() {
if (cancelButton == null) {
cancelButton = new JButton();
cancelButton.setText("Cancel");
cancelButton.setMnemonic('C');
cancelButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent e) ... | [
"private",
"JButton",
"getCancelButton",
"(",
")",
"{",
"if",
"(",
"cancelButton",
"==",
"null",
")",
"{",
"cancelButton",
"=",
"new",
"JButton",
"(",
")",
";",
"cancelButton",
".",
"setText",
"(",
"\"Cancel\"",
")",
";",
"cancelButton",
".",
"setMnemonic",
... | This method initializes cancelButton
@return javax.swing.JButton | [
"This",
"method",
"initializes",
"cancelButton"
] | 630c5150c245054e2556ff370f4bad2ec793dfb7 | https://github.com/bwkimmel/jdcp/blob/630c5150c245054e2556ff370f4bad2ec793dfb7/jdcp-worker-app/src/main/java/ca/eandb/jdcp/worker/ConnectionDialog.java#L269-L284 |
149,785 | bwkimmel/jdcp | jdcp-worker-app/src/main/java/ca/eandb/jdcp/worker/ConnectionDialog.java | ConnectionDialog.save | private void save() {
Preferences pref = Preferences
.userNodeForPackage(ConnectionDialog.class);
pref.put("host", getHost());
pref.put("user", getUser());
boolean remember = getRememberPasswordCheckBox().isSelected();
if (remember) {
try {
Cipher cipher = Cipher.getInstance(... | java | private void save() {
Preferences pref = Preferences
.userNodeForPackage(ConnectionDialog.class);
pref.put("host", getHost());
pref.put("user", getUser());
boolean remember = getRememberPasswordCheckBox().isSelected();
if (remember) {
try {
Cipher cipher = Cipher.getInstance(... | [
"private",
"void",
"save",
"(",
")",
"{",
"Preferences",
"pref",
"=",
"Preferences",
".",
"userNodeForPackage",
"(",
"ConnectionDialog",
".",
"class",
")",
";",
"pref",
".",
"put",
"(",
"\"host\"",
",",
"getHost",
"(",
")",
")",
";",
"pref",
".",
"put",
... | Saves field values to preferences. | [
"Saves",
"field",
"values",
"to",
"preferences",
"."
] | 630c5150c245054e2556ff370f4bad2ec793dfb7 | https://github.com/bwkimmel/jdcp/blob/630c5150c245054e2556ff370f4bad2ec793dfb7/jdcp-worker-app/src/main/java/ca/eandb/jdcp/worker/ConnectionDialog.java#L405-L439 |
149,786 | bwkimmel/jdcp | jdcp-worker-app/src/main/java/ca/eandb/jdcp/worker/ConnectionDialog.java | ConnectionDialog.restore | private void restore() {
Preferences pref = Preferences
.userNodeForPackage(ConnectionDialog.class);
getHostField().setText(pref.get("host", "localhost"));
getUserField().setText(pref.get("user", "guest"));
boolean remember = pref.getBoolean("remember", false);
boolean passwordSet = false;... | java | private void restore() {
Preferences pref = Preferences
.userNodeForPackage(ConnectionDialog.class);
getHostField().setText(pref.get("host", "localhost"));
getUserField().setText(pref.get("user", "guest"));
boolean remember = pref.getBoolean("remember", false);
boolean passwordSet = false;... | [
"private",
"void",
"restore",
"(",
")",
"{",
"Preferences",
"pref",
"=",
"Preferences",
".",
"userNodeForPackage",
"(",
"ConnectionDialog",
".",
"class",
")",
";",
"getHostField",
"(",
")",
".",
"setText",
"(",
"pref",
".",
"get",
"(",
"\"host\"",
",",
"\"... | Restores persisted field values from preferences. | [
"Restores",
"persisted",
"field",
"values",
"from",
"preferences",
"."
] | 630c5150c245054e2556ff370f4bad2ec793dfb7 | https://github.com/bwkimmel/jdcp/blob/630c5150c245054e2556ff370f4bad2ec793dfb7/jdcp-worker-app/src/main/java/ca/eandb/jdcp/worker/ConnectionDialog.java#L444-L481 |
149,787 | Metrink/croquet | croquet-core/src/main/java/com/metrink/croquet/CroquetRestBuilder.java | CroquetRestBuilder.addJpaEntity | public CroquetRestBuilder<T> addJpaEntity(final Class<? extends Serializable> entity) {
// check to ensure the class has the @Entity annotation
if(entity.getAnnotation(Entity.class) == null) {
throw new IllegalArgumentException("Only classes marked with @Entity can be added");
}
... | java | public CroquetRestBuilder<T> addJpaEntity(final Class<? extends Serializable> entity) {
// check to ensure the class has the @Entity annotation
if(entity.getAnnotation(Entity.class) == null) {
throw new IllegalArgumentException("Only classes marked with @Entity can be added");
}
... | [
"public",
"CroquetRestBuilder",
"<",
"T",
">",
"addJpaEntity",
"(",
"final",
"Class",
"<",
"?",
"extends",
"Serializable",
">",
"entity",
")",
"{",
"// check to ensure the class has the @Entity annotation",
"if",
"(",
"entity",
".",
"getAnnotation",
"(",
"Entity",
"... | Adds a JPA entity to Croquet.
@param entity the entity to add.
@return the {@link CroquetRestBuilder}. | [
"Adds",
"a",
"JPA",
"entity",
"to",
"Croquet",
"."
] | 1b0ed1327a104cf1f809ce4c3c5bf30a3d95384b | https://github.com/Metrink/croquet/blob/1b0ed1327a104cf1f809ce4c3c5bf30a3d95384b/croquet-core/src/main/java/com/metrink/croquet/CroquetRestBuilder.java#L168-L176 |
149,788 | Metrink/croquet | croquet-core/src/main/java/com/metrink/croquet/CroquetRestBuilder.java | CroquetRestBuilder.addDbProperty | public CroquetRestBuilder<T> addDbProperty(final String property, final Object value) {
settings.getDatabaseSettings().addProperty(property, value);
return this;
} | java | public CroquetRestBuilder<T> addDbProperty(final String property, final Object value) {
settings.getDatabaseSettings().addProperty(property, value);
return this;
} | [
"public",
"CroquetRestBuilder",
"<",
"T",
">",
"addDbProperty",
"(",
"final",
"String",
"property",
",",
"final",
"Object",
"value",
")",
"{",
"settings",
".",
"getDatabaseSettings",
"(",
")",
".",
"addProperty",
"(",
"property",
",",
"value",
")",
";",
"ret... | Adds a property to the database configuration.
<b>Only used when configuring the DB via the YAML file.</b>
@param property the DB property to set.
@param value the value of the property.
@return the {@link CroquetRestBuilder}. | [
"Adds",
"a",
"property",
"to",
"the",
"database",
"configuration",
"."
] | 1b0ed1327a104cf1f809ce4c3c5bf30a3d95384b | https://github.com/Metrink/croquet/blob/1b0ed1327a104cf1f809ce4c3c5bf30a3d95384b/croquet-core/src/main/java/com/metrink/croquet/CroquetRestBuilder.java#L186-L189 |
149,789 | Metrink/croquet | croquet-core/src/main/java/com/metrink/croquet/CroquetRestBuilder.java | CroquetRestBuilder.setSqlDialect | public CroquetRestBuilder<T> setSqlDialect(final Class<? extends Dialect> dialectClass) {
settings.getDatabaseSettings().setDialectClass(dialectClass);
return this;
} | java | public CroquetRestBuilder<T> setSqlDialect(final Class<? extends Dialect> dialectClass) {
settings.getDatabaseSettings().setDialectClass(dialectClass);
return this;
} | [
"public",
"CroquetRestBuilder",
"<",
"T",
">",
"setSqlDialect",
"(",
"final",
"Class",
"<",
"?",
"extends",
"Dialect",
">",
"dialectClass",
")",
"{",
"settings",
".",
"getDatabaseSettings",
"(",
")",
".",
"setDialectClass",
"(",
"dialectClass",
")",
";",
"retu... | Sets the hibernate.dialect class.
@param dialectClass the dialect class to use.
@return the {@link CroquetRestBuilder}. | [
"Sets",
"the",
"hibernate",
".",
"dialect",
"class",
"."
] | 1b0ed1327a104cf1f809ce4c3c5bf30a3d95384b | https://github.com/Metrink/croquet/blob/1b0ed1327a104cf1f809ce4c3c5bf30a3d95384b/croquet-core/src/main/java/com/metrink/croquet/CroquetRestBuilder.java#L196-L199 |
149,790 | craterdog/java-general-utilities | src/main/java/craterdog/utils/ByteUtils.java | ByteUtils.shortToBytes | static public int shortToBytes(short s, byte[] buffer, int index) {
int length = 2;
for (int i = 0; i < length; i++) {
buffer[index + length - i - 1] = (byte) (s >> (i * 8));
}
return length;
} | java | static public int shortToBytes(short s, byte[] buffer, int index) {
int length = 2;
for (int i = 0; i < length; i++) {
buffer[index + length - i - 1] = (byte) (s >> (i * 8));
}
return length;
} | [
"static",
"public",
"int",
"shortToBytes",
"(",
"short",
"s",
",",
"byte",
"[",
"]",
"buffer",
",",
"int",
"index",
")",
"{",
"int",
"length",
"=",
"2",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"length",
";",
"i",
"++",
")",
"{",
... | This function converts a short into its corresponding byte format and inserts
it into the specified buffer at the specified index.
@param s The short to be converted.
@param buffer The byte array.
@param index The index in the array to begin inserting bytes.
@return The number of bytes inserted. | [
"This",
"function",
"converts",
"a",
"short",
"into",
"its",
"corresponding",
"byte",
"format",
"and",
"inserts",
"it",
"into",
"the",
"specified",
"buffer",
"at",
"the",
"specified",
"index",
"."
] | a3ff45eaa00c2b8ed5c53efe9fe5166065fc1f57 | https://github.com/craterdog/java-general-utilities/blob/a3ff45eaa00c2b8ed5c53efe9fe5166065fc1f57/src/main/java/craterdog/utils/ByteUtils.java#L128-L134 |
149,791 | craterdog/java-general-utilities | src/main/java/craterdog/utils/ByteUtils.java | ByteUtils.bytesToShort | static public short bytesToShort(byte[] buffer, int index) {
int length = 2;
short integer = 0;
for (int i = 0; i < length; i++) {
integer |= ((buffer[index + length - i - 1] & 0xFF) << (i * 8));
}
return integer;
} | java | static public short bytesToShort(byte[] buffer, int index) {
int length = 2;
short integer = 0;
for (int i = 0; i < length; i++) {
integer |= ((buffer[index + length - i - 1] & 0xFF) << (i * 8));
}
return integer;
} | [
"static",
"public",
"short",
"bytesToShort",
"(",
"byte",
"[",
"]",
"buffer",
",",
"int",
"index",
")",
"{",
"int",
"length",
"=",
"2",
";",
"short",
"integer",
"=",
"0",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"length",
";",
"i",
... | This function converts the bytes in a byte array at the specified index to its
corresponding short value.
@param buffer The byte array containing the short.
@param index The index for the first byte in the byte array.
@return The corresponding short value. | [
"This",
"function",
"converts",
"the",
"bytes",
"in",
"a",
"byte",
"array",
"at",
"the",
"specified",
"index",
"to",
"its",
"corresponding",
"short",
"value",
"."
] | a3ff45eaa00c2b8ed5c53efe9fe5166065fc1f57 | https://github.com/craterdog/java-general-utilities/blob/a3ff45eaa00c2b8ed5c53efe9fe5166065fc1f57/src/main/java/craterdog/utils/ByteUtils.java#L156-L163 |
149,792 | craterdog/java-general-utilities | src/main/java/craterdog/utils/ByteUtils.java | ByteUtils.intToBytes | static public int intToBytes(int i, byte[] buffer, int index) {
int length = buffer.length - index;
if (length > 4) length = 4;
for (int j = 0; j < length; j++) {
buffer[index + length - j - 1] = (byte) (i >> (j * 8));
}
return length;
} | java | static public int intToBytes(int i, byte[] buffer, int index) {
int length = buffer.length - index;
if (length > 4) length = 4;
for (int j = 0; j < length; j++) {
buffer[index + length - j - 1] = (byte) (i >> (j * 8));
}
return length;
} | [
"static",
"public",
"int",
"intToBytes",
"(",
"int",
"i",
",",
"byte",
"[",
"]",
"buffer",
",",
"int",
"index",
")",
"{",
"int",
"length",
"=",
"buffer",
".",
"length",
"-",
"index",
";",
"if",
"(",
"length",
">",
"4",
")",
"length",
"=",
"4",
";... | This function converts a integer into its corresponding byte format and inserts
it into the specified buffer at the specified index.
@param i The integer to be converted.
@param buffer The byte array.
@param index The index in the array to begin inserting bytes.
@return The number of bytes inserted. | [
"This",
"function",
"converts",
"a",
"integer",
"into",
"its",
"corresponding",
"byte",
"format",
"and",
"inserts",
"it",
"into",
"the",
"specified",
"buffer",
"at",
"the",
"specified",
"index",
"."
] | a3ff45eaa00c2b8ed5c53efe9fe5166065fc1f57 | https://github.com/craterdog/java-general-utilities/blob/a3ff45eaa00c2b8ed5c53efe9fe5166065fc1f57/src/main/java/craterdog/utils/ByteUtils.java#L203-L210 |
149,793 | craterdog/java-general-utilities | src/main/java/craterdog/utils/ByteUtils.java | ByteUtils.bytesToInt | static public int bytesToInt(byte[] buffer, int index) {
int length = buffer.length - index;
if (length > 4) length = 4;
int integer = 0;
for (int i = 0; i < length; i++) {
integer |= ((buffer[index + length - i - 1] & 0xFF) << (i * 8));
}
return integer;
... | java | static public int bytesToInt(byte[] buffer, int index) {
int length = buffer.length - index;
if (length > 4) length = 4;
int integer = 0;
for (int i = 0; i < length; i++) {
integer |= ((buffer[index + length - i - 1] & 0xFF) << (i * 8));
}
return integer;
... | [
"static",
"public",
"int",
"bytesToInt",
"(",
"byte",
"[",
"]",
"buffer",
",",
"int",
"index",
")",
"{",
"int",
"length",
"=",
"buffer",
".",
"length",
"-",
"index",
";",
"if",
"(",
"length",
">",
"4",
")",
"length",
"=",
"4",
";",
"int",
"integer"... | This function converts the bytes in a byte array at the specified index to its
corresponding integer value.
@param buffer The byte array containing the integer.
@param index The index for the first byte in the byte array.
@return The corresponding integer value. | [
"This",
"function",
"converts",
"the",
"bytes",
"in",
"a",
"byte",
"array",
"at",
"the",
"specified",
"index",
"to",
"its",
"corresponding",
"integer",
"value",
"."
] | a3ff45eaa00c2b8ed5c53efe9fe5166065fc1f57 | https://github.com/craterdog/java-general-utilities/blob/a3ff45eaa00c2b8ed5c53efe9fe5166065fc1f57/src/main/java/craterdog/utils/ByteUtils.java#L232-L240 |
149,794 | craterdog/java-general-utilities | src/main/java/craterdog/utils/ByteUtils.java | ByteUtils.longToBytes | static public int longToBytes(long l, byte[] buffer, int index) {
int length = buffer.length - index;
if (length > 8) length = 8;
for (int i = 0; i < length; i++) {
buffer[index + length - i - 1] = (byte) (l >> (i * 8));
}
return length;
} | java | static public int longToBytes(long l, byte[] buffer, int index) {
int length = buffer.length - index;
if (length > 8) length = 8;
for (int i = 0; i < length; i++) {
buffer[index + length - i - 1] = (byte) (l >> (i * 8));
}
return length;
} | [
"static",
"public",
"int",
"longToBytes",
"(",
"long",
"l",
",",
"byte",
"[",
"]",
"buffer",
",",
"int",
"index",
")",
"{",
"int",
"length",
"=",
"buffer",
".",
"length",
"-",
"index",
";",
"if",
"(",
"length",
">",
"8",
")",
"length",
"=",
"8",
... | This function converts a long into its corresponding byte format and inserts
it into the specified buffer at the specified index.
@param l The long to be converted.
@param buffer The byte array.
@param index The index in the array to begin inserting bytes.
@return The number of bytes inserted. | [
"This",
"function",
"converts",
"a",
"long",
"into",
"its",
"corresponding",
"byte",
"format",
"and",
"inserts",
"it",
"into",
"the",
"specified",
"buffer",
"at",
"the",
"specified",
"index",
"."
] | a3ff45eaa00c2b8ed5c53efe9fe5166065fc1f57 | https://github.com/craterdog/java-general-utilities/blob/a3ff45eaa00c2b8ed5c53efe9fe5166065fc1f57/src/main/java/craterdog/utils/ByteUtils.java#L280-L287 |
149,795 | craterdog/java-general-utilities | src/main/java/craterdog/utils/ByteUtils.java | ByteUtils.bytesToLong | static public long bytesToLong(byte[] buffer, int index) {
int length = buffer.length - index;
if (length > 8) length = 8;
long l = 0;
for (int i = 0; i < length; i++) {
l |= ((buffer[index + length - i - 1] & 0xFFL) << (i * 8));
}
return l;
} | java | static public long bytesToLong(byte[] buffer, int index) {
int length = buffer.length - index;
if (length > 8) length = 8;
long l = 0;
for (int i = 0; i < length; i++) {
l |= ((buffer[index + length - i - 1] & 0xFFL) << (i * 8));
}
return l;
} | [
"static",
"public",
"long",
"bytesToLong",
"(",
"byte",
"[",
"]",
"buffer",
",",
"int",
"index",
")",
"{",
"int",
"length",
"=",
"buffer",
".",
"length",
"-",
"index",
";",
"if",
"(",
"length",
">",
"8",
")",
"length",
"=",
"8",
";",
"long",
"l",
... | This function converts the bytes in a byte array at the specified index to its
corresponding long value.
@param buffer The byte array containing the long.
@param index The index for the first byte in the byte array.
@return The corresponding long value. | [
"This",
"function",
"converts",
"the",
"bytes",
"in",
"a",
"byte",
"array",
"at",
"the",
"specified",
"index",
"to",
"its",
"corresponding",
"long",
"value",
"."
] | a3ff45eaa00c2b8ed5c53efe9fe5166065fc1f57 | https://github.com/craterdog/java-general-utilities/blob/a3ff45eaa00c2b8ed5c53efe9fe5166065fc1f57/src/main/java/craterdog/utils/ByteUtils.java#L309-L317 |
149,796 | craterdog/java-general-utilities | src/main/java/craterdog/utils/ByteUtils.java | ByteUtils.bigIntegerToBytes | static public int bigIntegerToBytes(BigInteger integer, byte[] buffer, int index) {
int length = 4 + (integer.bitLength() + 8) / 8;
System.arraycopy(intToBytes(length), 0, buffer, index, 4); // copy in the length
index += 4;
System.arraycopy(integer.toByteArray(), 0, buffer, index, leng... | java | static public int bigIntegerToBytes(BigInteger integer, byte[] buffer, int index) {
int length = 4 + (integer.bitLength() + 8) / 8;
System.arraycopy(intToBytes(length), 0, buffer, index, 4); // copy in the length
index += 4;
System.arraycopy(integer.toByteArray(), 0, buffer, index, leng... | [
"static",
"public",
"int",
"bigIntegerToBytes",
"(",
"BigInteger",
"integer",
",",
"byte",
"[",
"]",
"buffer",
",",
"int",
"index",
")",
"{",
"int",
"length",
"=",
"4",
"+",
"(",
"integer",
".",
"bitLength",
"(",
")",
"+",
"8",
")",
"/",
"8",
";",
... | This function converts a big integer into its corresponding byte format and inserts
it into the specified buffer at the specified index.
@param integer The big integer to be converted.
@param buffer The byte array.
@param index The index in the array to begin inserting bytes.
@return The number of bytes inserted. | [
"This",
"function",
"converts",
"a",
"big",
"integer",
"into",
"its",
"corresponding",
"byte",
"format",
"and",
"inserts",
"it",
"into",
"the",
"specified",
"buffer",
"at",
"the",
"specified",
"index",
"."
] | a3ff45eaa00c2b8ed5c53efe9fe5166065fc1f57 | https://github.com/craterdog/java-general-utilities/blob/a3ff45eaa00c2b8ed5c53efe9fe5166065fc1f57/src/main/java/craterdog/utils/ByteUtils.java#L355-L361 |
149,797 | craterdog/java-general-utilities | src/main/java/craterdog/utils/ByteUtils.java | ByteUtils.bytesToBigInteger | static public BigInteger bytesToBigInteger(byte[] buffer, int index) {
int length = bytesToInt(buffer, index); // pull out the length of the big integer
index += 4;
byte[] bytes = new byte[length];
System.arraycopy(buffer, index, bytes, 0, length); // pull out the bytes for the big int... | java | static public BigInteger bytesToBigInteger(byte[] buffer, int index) {
int length = bytesToInt(buffer, index); // pull out the length of the big integer
index += 4;
byte[] bytes = new byte[length];
System.arraycopy(buffer, index, bytes, 0, length); // pull out the bytes for the big int... | [
"static",
"public",
"BigInteger",
"bytesToBigInteger",
"(",
"byte",
"[",
"]",
"buffer",
",",
"int",
"index",
")",
"{",
"int",
"length",
"=",
"bytesToInt",
"(",
"buffer",
",",
"index",
")",
";",
"// pull out the length of the big integer",
"index",
"+=",
"4",
"... | This function converts the bytes in a byte array at the specified index to its
corresponding big integer value.
@param buffer The byte array containing the big integer.
@param index The index for the first byte in the byte array.
@return The corresponding big integer value. | [
"This",
"function",
"converts",
"the",
"bytes",
"in",
"a",
"byte",
"array",
"at",
"the",
"specified",
"index",
"to",
"its",
"corresponding",
"big",
"integer",
"value",
"."
] | a3ff45eaa00c2b8ed5c53efe9fe5166065fc1f57 | https://github.com/craterdog/java-general-utilities/blob/a3ff45eaa00c2b8ed5c53efe9fe5166065fc1f57/src/main/java/craterdog/utils/ByteUtils.java#L383-L389 |
149,798 | craterdog/java-general-utilities | src/main/java/craterdog/utils/ByteUtils.java | ByteUtils.doubleToBytes | static public int doubleToBytes(double s, byte[] buffer, int index) {
long bits = Double.doubleToRawLongBits(s);
int length = longToBytes(bits, buffer, index);
return length;
} | java | static public int doubleToBytes(double s, byte[] buffer, int index) {
long bits = Double.doubleToRawLongBits(s);
int length = longToBytes(bits, buffer, index);
return length;
} | [
"static",
"public",
"int",
"doubleToBytes",
"(",
"double",
"s",
",",
"byte",
"[",
"]",
"buffer",
",",
"int",
"index",
")",
"{",
"long",
"bits",
"=",
"Double",
".",
"doubleToRawLongBits",
"(",
"s",
")",
";",
"int",
"length",
"=",
"longToBytes",
"(",
"bi... | This function converts a double into its corresponding byte format and inserts
it into the specified buffer at the specified index.
@param s The double to be converted.
@param buffer The byte array.
@param index The index in the array to begin inserting bytes.
@return The number of bytes inserted. | [
"This",
"function",
"converts",
"a",
"double",
"into",
"its",
"corresponding",
"byte",
"format",
"and",
"inserts",
"it",
"into",
"the",
"specified",
"buffer",
"at",
"the",
"specified",
"index",
"."
] | a3ff45eaa00c2b8ed5c53efe9fe5166065fc1f57 | https://github.com/craterdog/java-general-utilities/blob/a3ff45eaa00c2b8ed5c53efe9fe5166065fc1f57/src/main/java/craterdog/utils/ByteUtils.java#L429-L433 |
149,799 | craterdog/java-general-utilities | src/main/java/craterdog/utils/ByteUtils.java | ByteUtils.bytesToDouble | static public double bytesToDouble(byte[] buffer, int index) {
double real;
long bits = bytesToLong(buffer, index);
real = Double.longBitsToDouble(bits);
return real;
} | java | static public double bytesToDouble(byte[] buffer, int index) {
double real;
long bits = bytesToLong(buffer, index);
real = Double.longBitsToDouble(bits);
return real;
} | [
"static",
"public",
"double",
"bytesToDouble",
"(",
"byte",
"[",
"]",
"buffer",
",",
"int",
"index",
")",
"{",
"double",
"real",
";",
"long",
"bits",
"=",
"bytesToLong",
"(",
"buffer",
",",
"index",
")",
";",
"real",
"=",
"Double",
".",
"longBitsToDouble... | This function converts the bytes in a byte array at the specified index to its
corresponding double value.
@param buffer The byte array containing the double.
@param index The index for the first byte in the byte array.
@return The corresponding double value. | [
"This",
"function",
"converts",
"the",
"bytes",
"in",
"a",
"byte",
"array",
"at",
"the",
"specified",
"index",
"to",
"its",
"corresponding",
"double",
"value",
"."
] | a3ff45eaa00c2b8ed5c53efe9fe5166065fc1f57 | https://github.com/craterdog/java-general-utilities/blob/a3ff45eaa00c2b8ed5c53efe9fe5166065fc1f57/src/main/java/craterdog/utils/ByteUtils.java#L455-L460 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.