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 | partition stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|
mgm-tp/jfunk | jfunk-data-generator/src/main/java/com/mgmtp/jfunk/data/generator/util/GeneratingExpression.java | GeneratingExpression.chooseAlternations | private String chooseAlternations(final String expression) {
StrBuilder sb = new StrBuilder(expression);
int i = 0;
// Loop until an unescaped pipe symbol appears.
while (UNESCAPED_PIPE_PATTERN.matcher(sb.toString()).find()) {
for (; i < sb.length(); ++i) {
if (sb.charAt(i) == '|') {
if (sb.charAt(i - 1) == '\\') {
// escapet
continue;
}
int start = i;
// Backtrack until an opening bracket is found
// to limit the context of alternatives.
for (int closingCount = 0; start >= 0; --start) {
char c = sb.charAt(start);
if (c == '(') {
if (closingCount == 0) {
break;
}
--closingCount;
} else if (c == ')') {
++closingCount;
}
}
if (start >= 0) {
// If an opening brace was found
// search for a closing bracket.
int end = i;
for (int openingCount = 0; end < sb.length(); ++end) {
char c = sb.charAt(end);
if (c == '(') {
++openingCount;
} else if (c == ')') {
if (openingCount == 0) {
break;
}
--openingCount;
}
}
String alternative = random.getBoolean() ? sb.substring(start + 1, i) : sb.substring(i + 1, end);
sb.replace(start, end + 1, alternative);
i = start + alternative.length();
break;
}
String alternative = random.getBoolean() ? sb.substring(0, i) : sb.substring(i + 1);
sb.replace(0, sb.length() + 1, alternative);
break;
}
}
}
return sb.toString();
} | java | private String chooseAlternations(final String expression) {
StrBuilder sb = new StrBuilder(expression);
int i = 0;
// Loop until an unescaped pipe symbol appears.
while (UNESCAPED_PIPE_PATTERN.matcher(sb.toString()).find()) {
for (; i < sb.length(); ++i) {
if (sb.charAt(i) == '|') {
if (sb.charAt(i - 1) == '\\') {
// escapet
continue;
}
int start = i;
// Backtrack until an opening bracket is found
// to limit the context of alternatives.
for (int closingCount = 0; start >= 0; --start) {
char c = sb.charAt(start);
if (c == '(') {
if (closingCount == 0) {
break;
}
--closingCount;
} else if (c == ')') {
++closingCount;
}
}
if (start >= 0) {
// If an opening brace was found
// search for a closing bracket.
int end = i;
for (int openingCount = 0; end < sb.length(); ++end) {
char c = sb.charAt(end);
if (c == '(') {
++openingCount;
} else if (c == ')') {
if (openingCount == 0) {
break;
}
--openingCount;
}
}
String alternative = random.getBoolean() ? sb.substring(start + 1, i) : sb.substring(i + 1, end);
sb.replace(start, end + 1, alternative);
i = start + alternative.length();
break;
}
String alternative = random.getBoolean() ? sb.substring(0, i) : sb.substring(i + 1);
sb.replace(0, sb.length() + 1, alternative);
break;
}
}
}
return sb.toString();
} | [
"private",
"String",
"chooseAlternations",
"(",
"final",
"String",
"expression",
")",
"{",
"StrBuilder",
"sb",
"=",
"new",
"StrBuilder",
"(",
"expression",
")",
";",
"int",
"i",
"=",
"0",
";",
"// Loop until an unescaped pipe symbol appears.\r",
"while",
"(",
"UNE... | Resolves alternations by randomly choosing one at a time and adapting the pattern accordingly
@param expression
the pattern
@return the reduced pattern | [
"Resolves",
"alternations",
"by",
"randomly",
"choosing",
"one",
"at",
"a",
"time",
"and",
"adapting",
"the",
"pattern",
"accordingly"
] | 5b9fecac5778b988bb458085ded39ea9a4c7c2ae | https://github.com/mgm-tp/jfunk/blob/5b9fecac5778b988bb458085ded39ea9a4c7c2ae/jfunk-data-generator/src/main/java/com/mgmtp/jfunk/data/generator/util/GeneratingExpression.java#L85-L140 | train |
mgm-tp/jfunk | jfunk-data-generator/src/main/java/com/mgmtp/jfunk/data/generator/util/GeneratingExpression.java | GeneratingExpression.negateString | public String negateString(final String input, int bad) {
int length = input.length();
Range[] ranges = getRanges();
int[] lengths = new int[ranges.length];
// arrange lengths
for (int i = 0; i < lengths.length; i++) {
Range r = ranges[i];
lengths[i] = r.getMin();
length -= r.getMin();
}
/**
* distribute remaining lengths
*/
int i = 0;
// only 1000 tries otherwise break as it just does not work
while (length > 0 && i < 1000) {
int index = i % lengths.length;
Range r = ranges[index];
if (lengths[index] < r.getMax()) {
lengths[index] += 1;
length--;
}
i++;
}
// generate completely negative string
String replaceString = generate(lengths, -2);
if (replaceString.length() == 0) {
log.warn("No negative characters possible in this expression. All characters are allowed.");
return input;
}
// now replace the #bad character in the input string
List<Integer> l = new ArrayList<Integer>(input.length());
for (i = 0; i < input.length(); i++) {
l.add(i);
}
if (bad == -2) {
// all false
bad = input.length();
} else if (bad == -1) {
bad = 1 + random.getInt(input.length() - 1);
}
Collections.shuffle(l);
StringBuffer base = new StringBuffer(input);
int j = 0;
for (i = 0; i < bad; i++) {
int index = l.remove(0);
char replaceChar = ' ';
if (index < replaceString.length()) {
replaceChar = replaceString.charAt(index);
}
while ((index == 0 || index >= replaceString.length() || index == input.length() - 1) && Character.isSpaceChar(replaceChar)) {
replaceChar = replaceString.charAt(j);
j = (j + 1) % replaceString.length();
}
base.setCharAt(index, replaceChar);
}
if (log.isDebugEnabled()) {
log.debug("False characters in string; " + input + " became " + base);
}
return base.toString();
} | java | public String negateString(final String input, int bad) {
int length = input.length();
Range[] ranges = getRanges();
int[] lengths = new int[ranges.length];
// arrange lengths
for (int i = 0; i < lengths.length; i++) {
Range r = ranges[i];
lengths[i] = r.getMin();
length -= r.getMin();
}
/**
* distribute remaining lengths
*/
int i = 0;
// only 1000 tries otherwise break as it just does not work
while (length > 0 && i < 1000) {
int index = i % lengths.length;
Range r = ranges[index];
if (lengths[index] < r.getMax()) {
lengths[index] += 1;
length--;
}
i++;
}
// generate completely negative string
String replaceString = generate(lengths, -2);
if (replaceString.length() == 0) {
log.warn("No negative characters possible in this expression. All characters are allowed.");
return input;
}
// now replace the #bad character in the input string
List<Integer> l = new ArrayList<Integer>(input.length());
for (i = 0; i < input.length(); i++) {
l.add(i);
}
if (bad == -2) {
// all false
bad = input.length();
} else if (bad == -1) {
bad = 1 + random.getInt(input.length() - 1);
}
Collections.shuffle(l);
StringBuffer base = new StringBuffer(input);
int j = 0;
for (i = 0; i < bad; i++) {
int index = l.remove(0);
char replaceChar = ' ';
if (index < replaceString.length()) {
replaceChar = replaceString.charAt(index);
}
while ((index == 0 || index >= replaceString.length() || index == input.length() - 1) && Character.isSpaceChar(replaceChar)) {
replaceChar = replaceString.charAt(j);
j = (j + 1) % replaceString.length();
}
base.setCharAt(index, replaceChar);
}
if (log.isDebugEnabled()) {
log.debug("False characters in string; " + input + " became " + base);
}
return base.toString();
} | [
"public",
"String",
"negateString",
"(",
"final",
"String",
"input",
",",
"int",
"bad",
")",
"{",
"int",
"length",
"=",
"input",
".",
"length",
"(",
")",
";",
"Range",
"[",
"]",
"ranges",
"=",
"getRanges",
"(",
")",
";",
"int",
"[",
"]",
"lengths",
... | Replaces randomly selected characters in the given string with forbidden characters according
to the given expression.
@param bad
if bad = -2 all characters are replaced, if bad = -1 1 - (all - 1) are replaced,
if bad > 0 the exact number of characters is replaced
@param input
the input string
@return input with <code>bad</code> replaced characters | [
"Replaces",
"randomly",
"selected",
"characters",
"in",
"the",
"given",
"string",
"with",
"forbidden",
"characters",
"according",
"to",
"the",
"given",
"expression",
"."
] | 5b9fecac5778b988bb458085ded39ea9a4c7c2ae | https://github.com/mgm-tp/jfunk/blob/5b9fecac5778b988bb458085ded39ea9a4c7c2ae/jfunk-data-generator/src/main/java/com/mgmtp/jfunk/data/generator/util/GeneratingExpression.java#L153-L214 | train |
mgm-tp/jfunk | jfunk-data-generator/src/main/java/com/mgmtp/jfunk/data/generator/util/GeneratingExpression.java | GeneratingExpression.getRanges | public Range[] getRanges() {
Range[] ranges = new Range[nodes.size()];
for (int i = 0; i < ranges.length; i++) {
ranges[i] = nodes.get(i).getRange();
}
return ranges;
} | java | public Range[] getRanges() {
Range[] ranges = new Range[nodes.size()];
for (int i = 0; i < ranges.length; i++) {
ranges[i] = nodes.get(i).getRange();
}
return ranges;
} | [
"public",
"Range",
"[",
"]",
"getRanges",
"(",
")",
"{",
"Range",
"[",
"]",
"ranges",
"=",
"new",
"Range",
"[",
"nodes",
".",
"size",
"(",
")",
"]",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"ranges",
".",
"length",
";",
"i",
"++"... | As the regular expression was distributed in separate node, every node has its own range.
This method returns an array containing all range objects.
@return the separate range objects for all sub-nodes of this expression | [
"As",
"the",
"regular",
"expression",
"was",
"distributed",
"in",
"separate",
"node",
"every",
"node",
"has",
"its",
"own",
"range",
".",
"This",
"method",
"returns",
"an",
"array",
"containing",
"all",
"range",
"objects",
"."
] | 5b9fecac5778b988bb458085ded39ea9a4c7c2ae | https://github.com/mgm-tp/jfunk/blob/5b9fecac5778b988bb458085ded39ea9a4c7c2ae/jfunk-data-generator/src/main/java/com/mgmtp/jfunk/data/generator/util/GeneratingExpression.java#L232-L238 | train |
mgm-tp/jfunk | jfunk-data-generator/src/main/java/com/mgmtp/jfunk/data/generator/util/GeneratingExpression.java | GeneratingExpression.generate | public String generate(final int[] nodeSizes, final int bad) {
buf.setLength(0);
for (int i = 0; i < nodes.size() && i < nodeSizes.length; i++) {
buf.append(nodes.get(i).getCharacters(nodeSizes[i], bad));
}
String value = buf.toString();
buf.setLength(0);
return value;
} | java | public String generate(final int[] nodeSizes, final int bad) {
buf.setLength(0);
for (int i = 0; i < nodes.size() && i < nodeSizes.length; i++) {
buf.append(nodes.get(i).getCharacters(nodeSizes[i], bad));
}
String value = buf.toString();
buf.setLength(0);
return value;
} | [
"public",
"String",
"generate",
"(",
"final",
"int",
"[",
"]",
"nodeSizes",
",",
"final",
"int",
"bad",
")",
"{",
"buf",
".",
"setLength",
"(",
"0",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"nodes",
".",
"size",
"(",
")",
"&&"... | Generates a string containing subject to the parameter value only allowed or one half of
forbidden characters.
@param nodeSizes
Array with the desire string lengths. For every node there must be only one length
@param bad
if 0, only good characters are generated, if 1, 1 - (all - 1) characters are
generated false, if 2 all characters are generated false.
@return a string | [
"Generates",
"a",
"string",
"containing",
"subject",
"to",
"the",
"parameter",
"value",
"only",
"allowed",
"or",
"one",
"half",
"of",
"forbidden",
"characters",
"."
] | 5b9fecac5778b988bb458085ded39ea9a4c7c2ae | https://github.com/mgm-tp/jfunk/blob/5b9fecac5778b988bb458085ded39ea9a4c7c2ae/jfunk-data-generator/src/main/java/com/mgmtp/jfunk/data/generator/util/GeneratingExpression.java#L251-L259 | train |
mgm-tp/jfunk | jfunk-data-generator/src/main/java/com/mgmtp/jfunk/data/generator/util/GeneratingExpression.java | GeneratingExpression.generate | public String generate(final int bad) {
int[] sizes = new int[nodes.size()];
for (int i = 0; i < sizes.length; i++) {
Range r = nodes.get(i).getRange();
sizes[i] = r.getMin() + r.getRange() / 2;
}
return generate(sizes, bad);
} | java | public String generate(final int bad) {
int[] sizes = new int[nodes.size()];
for (int i = 0; i < sizes.length; i++) {
Range r = nodes.get(i).getRange();
sizes[i] = r.getMin() + r.getRange() / 2;
}
return generate(sizes, bad);
} | [
"public",
"String",
"generate",
"(",
"final",
"int",
"bad",
")",
"{",
"int",
"[",
"]",
"sizes",
"=",
"new",
"int",
"[",
"nodes",
".",
"size",
"(",
")",
"]",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"sizes",
".",
"length",
";",
"i... | Returns a string whose length is always exactly in the middle of the allowed range
@param bad
if 0, only allowed characters are generated, if 1, 1 - (all - 1) characters are
generated false, if 2 all characters are generated false.
@return a string | [
"Returns",
"a",
"string",
"whose",
"length",
"is",
"always",
"exactly",
"in",
"the",
"middle",
"of",
"the",
"allowed",
"range"
] | 5b9fecac5778b988bb458085ded39ea9a4c7c2ae | https://github.com/mgm-tp/jfunk/blob/5b9fecac5778b988bb458085ded39ea9a4c7c2ae/jfunk-data-generator/src/main/java/com/mgmtp/jfunk/data/generator/util/GeneratingExpression.java#L269-L276 | train |
mgm-tp/jfunk | jfunk-data-generator/src/main/java/com/mgmtp/jfunk/data/generator/util/GeneratingExpression.java | GeneratingExpression.generate | public String generate(int total, final int bad) {
if (total < 0) {
if (log.isDebugEnabled()) {
log.debug("Character string cannot have a negative length!");
}
total = 0;
}
Range[] ranges = getRanges();
int[] lengths = new int[ranges.length];
int length = 0;
// first make sure every single node has at least its minimum length
for (int i = 0; i < ranges.length; i++) {
lengths[i] = ranges[i].getMin();
length += lengths[i];
}
// now increase each node chosen randomly by one until the extra is consumed
int index = 0;
boolean increase = length < total;
if (increase) {
boolean maxedOut = total > getRange().getMax();
while (length < total) {
// if maxed out is true, we have more than normal max characters, so
// we ignore the local max; if not maxed out, the nodes are not bigger than max
if ((maxedOut || ranges[index].getMax() > lengths[index]) && choice.get()) {
lengths[index]++;
length++;
}
index = (index + 1) % lengths.length;
}
} else {
boolean minOut = total < getRange().getMin();
while (length > total) {
// if min out is true, we have less than normal min characters, so
// we ignore the local min; if not min out, the nodes are not smaller than min
if ((minOut || ranges[index].getMin() > lengths[index]) && lengths[index] > 0 && choice.get()) {
lengths[index]--;
length--;
}
index = (index + 1) % lengths.length;
}
}
// now we have distributed the character number to all subnodes of this expression
// build buffer
return generate(lengths, bad);
} | java | public String generate(int total, final int bad) {
if (total < 0) {
if (log.isDebugEnabled()) {
log.debug("Character string cannot have a negative length!");
}
total = 0;
}
Range[] ranges = getRanges();
int[] lengths = new int[ranges.length];
int length = 0;
// first make sure every single node has at least its minimum length
for (int i = 0; i < ranges.length; i++) {
lengths[i] = ranges[i].getMin();
length += lengths[i];
}
// now increase each node chosen randomly by one until the extra is consumed
int index = 0;
boolean increase = length < total;
if (increase) {
boolean maxedOut = total > getRange().getMax();
while (length < total) {
// if maxed out is true, we have more than normal max characters, so
// we ignore the local max; if not maxed out, the nodes are not bigger than max
if ((maxedOut || ranges[index].getMax() > lengths[index]) && choice.get()) {
lengths[index]++;
length++;
}
index = (index + 1) % lengths.length;
}
} else {
boolean minOut = total < getRange().getMin();
while (length > total) {
// if min out is true, we have less than normal min characters, so
// we ignore the local min; if not min out, the nodes are not smaller than min
if ((minOut || ranges[index].getMin() > lengths[index]) && lengths[index] > 0 && choice.get()) {
lengths[index]--;
length--;
}
index = (index + 1) % lengths.length;
}
}
// now we have distributed the character number to all subnodes of this expression
// build buffer
return generate(lengths, bad);
} | [
"public",
"String",
"generate",
"(",
"int",
"total",
",",
"final",
"int",
"bad",
")",
"{",
"if",
"(",
"total",
"<",
"0",
")",
"{",
"if",
"(",
"log",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"log",
".",
"debug",
"(",
"\"Character string cannot have a ... | Generates a string with the given length. Thereby the mandatory length will be reached first
and then the separate areas are filled with the remaining characters randlomly. | [
"Generates",
"a",
"string",
"with",
"the",
"given",
"length",
".",
"Thereby",
"the",
"mandatory",
"length",
"will",
"be",
"reached",
"first",
"and",
"then",
"the",
"separate",
"areas",
"are",
"filled",
"with",
"the",
"remaining",
"characters",
"randlomly",
"."... | 5b9fecac5778b988bb458085ded39ea9a4c7c2ae | https://github.com/mgm-tp/jfunk/blob/5b9fecac5778b988bb458085ded39ea9a4c7c2ae/jfunk-data-generator/src/main/java/com/mgmtp/jfunk/data/generator/util/GeneratingExpression.java#L282-L326 | train |
spotify/ssh-agent-proxy | src/main/java/com/spotify/sshagentproxy/AgentReplyHeaders.java | AgentReplyHeaders.intFromSubArray | private static int intFromSubArray(final byte[] bytes, final int from, final int to) {
final byte[] subBytes = Arrays.copyOfRange(bytes, from, to);
final ByteBuffer wrap = ByteBuffer.wrap(subBytes);
return wrap.getInt();
} | java | private static int intFromSubArray(final byte[] bytes, final int from, final int to) {
final byte[] subBytes = Arrays.copyOfRange(bytes, from, to);
final ByteBuffer wrap = ByteBuffer.wrap(subBytes);
return wrap.getInt();
} | [
"private",
"static",
"int",
"intFromSubArray",
"(",
"final",
"byte",
"[",
"]",
"bytes",
",",
"final",
"int",
"from",
",",
"final",
"int",
"to",
")",
"{",
"final",
"byte",
"[",
"]",
"subBytes",
"=",
"Arrays",
".",
"copyOfRange",
"(",
"bytes",
",",
"from... | Take a slice of an array of bytes and interpret it as an int.
@param bytes Array of bytes
@param from Start index in the array
@param to End index in the array
@return int | [
"Take",
"a",
"slice",
"of",
"an",
"array",
"of",
"bytes",
"and",
"interpret",
"it",
"as",
"an",
"int",
"."
] | b678792750c0157bd5ed3fb6a18895ff95effbc4 | https://github.com/spotify/ssh-agent-proxy/blob/b678792750c0157bd5ed3fb6a18895ff95effbc4/src/main/java/com/spotify/sshagentproxy/AgentReplyHeaders.java#L83-L87 | train |
mgm-tp/jfunk | jfunk-core/src/main/java/com/mgmtp/jfunk/core/scripting/ModuleArchiver.java | ModuleArchiver.startArchiving | void startArchiving() {
if (isArchivingDisabled()) {
return;
}
String archiveName = configuration.get(JFunkConstants.ARCHIVE_FILE);
if (StringUtils.isBlank(archiveName)) {
archiveName = String.format(DIR_PATTERN, moduleMetaData.getModuleName(), Thread.currentThread().getName(),
FORMAT.format(moduleMetaData.getStartDate()));
}
moduleArchiveDir = new File(archiveDir, archiveName);
if (moduleArchiveDir.exists()) {
log.warn("Archive directory already exists: {}", moduleArchiveDir);
} else {
moduleArchiveDir.mkdirs();
}
addModuleAppender();
log.info("Started archiving: (module={}, moduleArchiveDir={})", moduleMetaData.getModuleName(), moduleArchiveDir);
} | java | void startArchiving() {
if (isArchivingDisabled()) {
return;
}
String archiveName = configuration.get(JFunkConstants.ARCHIVE_FILE);
if (StringUtils.isBlank(archiveName)) {
archiveName = String.format(DIR_PATTERN, moduleMetaData.getModuleName(), Thread.currentThread().getName(),
FORMAT.format(moduleMetaData.getStartDate()));
}
moduleArchiveDir = new File(archiveDir, archiveName);
if (moduleArchiveDir.exists()) {
log.warn("Archive directory already exists: {}", moduleArchiveDir);
} else {
moduleArchiveDir.mkdirs();
}
addModuleAppender();
log.info("Started archiving: (module={}, moduleArchiveDir={})", moduleMetaData.getModuleName(), moduleArchiveDir);
} | [
"void",
"startArchiving",
"(",
")",
"{",
"if",
"(",
"isArchivingDisabled",
"(",
")",
")",
"{",
"return",
";",
"}",
"String",
"archiveName",
"=",
"configuration",
".",
"get",
"(",
"JFunkConstants",
".",
"ARCHIVE_FILE",
")",
";",
"if",
"(",
"StringUtils",
".... | Starts archiving of the specified module, if archiving is enabled. | [
"Starts",
"archiving",
"of",
"the",
"specified",
"module",
"if",
"archiving",
"is",
"enabled",
"."
] | 5b9fecac5778b988bb458085ded39ea9a4c7c2ae | https://github.com/mgm-tp/jfunk/blob/5b9fecac5778b988bb458085ded39ea9a4c7c2ae/jfunk-core/src/main/java/com/mgmtp/jfunk/core/scripting/ModuleArchiver.java#L122-L142 | train |
mgm-tp/jfunk | jfunk-data-generator/src/main/java/com/mgmtp/jfunk/data/generator/constraint/Optional.java | Optional.initValuesImpl | @Override
public String initValuesImpl(final FieldCase ca) {
if (ca == FieldCase.NULL || ca == FieldCase.BLANK) {
return null;
}
// If there still is an mandatory case, a value will be generated anyway
if (ca != null || last && constraint.hasNextCase() || generator.isIgnoreOptionalConstraints()) {
return constraint.initValues(ca);
}
if (choice.isNext()) {
last = true;
return constraint.initValues(null);
}
// Initialize the field below with 0 as optional equals false
last = false;
constraint.initValues(FieldCase.NULL);
return null;
} | java | @Override
public String initValuesImpl(final FieldCase ca) {
if (ca == FieldCase.NULL || ca == FieldCase.BLANK) {
return null;
}
// If there still is an mandatory case, a value will be generated anyway
if (ca != null || last && constraint.hasNextCase() || generator.isIgnoreOptionalConstraints()) {
return constraint.initValues(ca);
}
if (choice.isNext()) {
last = true;
return constraint.initValues(null);
}
// Initialize the field below with 0 as optional equals false
last = false;
constraint.initValues(FieldCase.NULL);
return null;
} | [
"@",
"Override",
"public",
"String",
"initValuesImpl",
"(",
"final",
"FieldCase",
"ca",
")",
"{",
"if",
"(",
"ca",
"==",
"FieldCase",
".",
"NULL",
"||",
"ca",
"==",
"FieldCase",
".",
"BLANK",
")",
"{",
"return",
"null",
";",
"}",
"// If there still is an m... | Returns either null or a value. If null is returned the embedded constraint is initialized
with FieldCase.NULL. If a value is returned the embedded constraint is initialized with the
FieldCase whose value is returned. If the latest value was not not null the next value will
be generated if in the case that the embedded constraint still has an mandatory case. This
also applies if all optional constraints have been turned of globally using the property
IGNORE_CONSTRAINT_OPTIONAL. Otherwise no value will be generated in 50% of the cases or the
values of the embedded constraints are returned.
@return the value just generated | [
"Returns",
"either",
"null",
"or",
"a",
"value",
".",
"If",
"null",
"is",
"returned",
"the",
"embedded",
"constraint",
"is",
"initialized",
"with",
"FieldCase",
".",
"NULL",
".",
"If",
"a",
"value",
"is",
"returned",
"the",
"embedded",
"constraint",
"is",
... | 5b9fecac5778b988bb458085ded39ea9a4c7c2ae | https://github.com/mgm-tp/jfunk/blob/5b9fecac5778b988bb458085ded39ea9a4c7c2ae/jfunk-data-generator/src/main/java/com/mgmtp/jfunk/data/generator/constraint/Optional.java#L100-L117 | train |
mgm-tp/jfunk | jfunk-common/src/main/java/com/mgmtp/jfunk/common/util/RegExUtil.java | RegExUtil.spacesOptional | public static String spacesOptional(final String input) {
String output;
output = input.replaceAll("\\s", "\\\\s?");
return output;
} | java | public static String spacesOptional(final String input) {
String output;
output = input.replaceAll("\\s", "\\\\s?");
return output;
} | [
"public",
"static",
"String",
"spacesOptional",
"(",
"final",
"String",
"input",
")",
"{",
"String",
"output",
";",
"output",
"=",
"input",
".",
"replaceAll",
"(",
"\"\\\\s\"",
",",
"\"\\\\\\\\s?\"",
")",
";",
"return",
"output",
";",
"}"
] | Replaces a space with the regular expression \\s?
@param input
the string to modify
@return the input string with all spaces replaced by \\s? | [
"Replaces",
"a",
"space",
"with",
"the",
"regular",
"expression",
"\\\\",
"s?"
] | 5b9fecac5778b988bb458085ded39ea9a4c7c2ae | https://github.com/mgm-tp/jfunk/blob/5b9fecac5778b988bb458085ded39ea9a4c7c2ae/jfunk-common/src/main/java/com/mgmtp/jfunk/common/util/RegExUtil.java#L85-L89 | train |
Mozu/mozu-java | mozu-java-core/src/main/java/com/mozu/api/urls/commerce/catalog/admin/DiscountSettingsUrl.java | DiscountSettingsUrl.getDiscountSettingsUrl | public static MozuUrl getDiscountSettingsUrl(Integer catalogId, String responseFields)
{
UrlFormatter formatter = new UrlFormatter("/api/commerce/catalog/admin/discountsettings/{catalogId}?responseFields={responseFields}");
formatter.formatUrl("catalogId", catalogId);
formatter.formatUrl("responseFields", responseFields);
return new MozuUrl(formatter.getResourceUrl(), MozuUrl.UrlLocation.TENANT_POD) ;
} | java | public static MozuUrl getDiscountSettingsUrl(Integer catalogId, String responseFields)
{
UrlFormatter formatter = new UrlFormatter("/api/commerce/catalog/admin/discountsettings/{catalogId}?responseFields={responseFields}");
formatter.formatUrl("catalogId", catalogId);
formatter.formatUrl("responseFields", responseFields);
return new MozuUrl(formatter.getResourceUrl(), MozuUrl.UrlLocation.TENANT_POD) ;
} | [
"public",
"static",
"MozuUrl",
"getDiscountSettingsUrl",
"(",
"Integer",
"catalogId",
",",
"String",
"responseFields",
")",
"{",
"UrlFormatter",
"formatter",
"=",
"new",
"UrlFormatter",
"(",
"\"/api/commerce/catalog/admin/discountsettings/{catalogId}?responseFields={responseField... | Get Resource Url for GetDiscountSettings
@param catalogId Unique identifier for a catalog.
@param responseFields Filtering syntax appended to an API call to increase or decrease the amount of data returned inside a JSON object. This parameter should only be used to retrieve data. Attempting to update data using this parameter may cause data loss.
@return String Resource Url | [
"Get",
"Resource",
"Url",
"for",
"GetDiscountSettings"
] | 5beadde73601a859f845e3e2fc1077b39c8bea83 | https://github.com/Mozu/mozu-java/blob/5beadde73601a859f845e3e2fc1077b39c8bea83/mozu-java-core/src/main/java/com/mozu/api/urls/commerce/catalog/admin/DiscountSettingsUrl.java#L22-L28 | train |
nmdp-bioinformatics/ngs | hml/src/main/java/org/nmdp/ngs/hml/HmlReader.java | HmlReader.read | public static Hml read(final File file) throws IOException {
checkNotNull(file);
try (BufferedReader reader = new BufferedReader(new FileReader(file))) {
return read(reader);
}
} | java | public static Hml read(final File file) throws IOException {
checkNotNull(file);
try (BufferedReader reader = new BufferedReader(new FileReader(file))) {
return read(reader);
}
} | [
"public",
"static",
"Hml",
"read",
"(",
"final",
"File",
"file",
")",
"throws",
"IOException",
"{",
"checkNotNull",
"(",
"file",
")",
";",
"try",
"(",
"BufferedReader",
"reader",
"=",
"new",
"BufferedReader",
"(",
"new",
"FileReader",
"(",
"file",
")",
")"... | Read HML from the specified file.
@param file file to read from, must not be null
@return the HML read from the specified file
@throws IOException if an I/O error occurs | [
"Read",
"HML",
"from",
"the",
"specified",
"file",
"."
] | 277627e4311313a80f5dc110b3185b0d7af32bd0 | https://github.com/nmdp-bioinformatics/ngs/blob/277627e4311313a80f5dc110b3185b0d7af32bd0/hml/src/main/java/org/nmdp/ngs/hml/HmlReader.java#L97-L102 | train |
spotify/ssh-agent-proxy | src/main/java/com/spotify/sshagentproxy/AgentInput.java | AgentInput.readSignResponse | byte[] readSignResponse() throws IOException {
// Read the first 9 bytes from the InputStream which are the SSH2_AGENT_SIGN_RESPONSE headers.
final byte[] headerBytes = readBytes(9, "SSH2_AGENT_SIGN_RESPONSE");
log.debug("Received SSH2_AGENT_SIGN_RESPONSE message from ssh-agent.");
final SignResponseHeaders headers = SignResponseHeaders.from(headerBytes);
// Read the rest of the SSH2_AGENT_SIGN_RESPONSE message from ssh-agent.
// 5 is the sum of the number of bytes of response code and response length
final byte[] bytes = readBytes(headers.getLength() - 5);
final ByteIterator iterator = new ByteIterator(bytes);
final byte[] responseType = iterator.next();
final String signatureFormatId = new String(responseType);
if (!signatureFormatId.equals(Rsa.RSA_LABEL)) {
throw new RuntimeException("I unexpectedly got a non-Rsa signature format ID in the "
+ "SSH2_AGENT_SIGN_RESPONSE's signature blob.");
}
return iterator.next();
} | java | byte[] readSignResponse() throws IOException {
// Read the first 9 bytes from the InputStream which are the SSH2_AGENT_SIGN_RESPONSE headers.
final byte[] headerBytes = readBytes(9, "SSH2_AGENT_SIGN_RESPONSE");
log.debug("Received SSH2_AGENT_SIGN_RESPONSE message from ssh-agent.");
final SignResponseHeaders headers = SignResponseHeaders.from(headerBytes);
// Read the rest of the SSH2_AGENT_SIGN_RESPONSE message from ssh-agent.
// 5 is the sum of the number of bytes of response code and response length
final byte[] bytes = readBytes(headers.getLength() - 5);
final ByteIterator iterator = new ByteIterator(bytes);
final byte[] responseType = iterator.next();
final String signatureFormatId = new String(responseType);
if (!signatureFormatId.equals(Rsa.RSA_LABEL)) {
throw new RuntimeException("I unexpectedly got a non-Rsa signature format ID in the "
+ "SSH2_AGENT_SIGN_RESPONSE's signature blob.");
}
return iterator.next();
} | [
"byte",
"[",
"]",
"readSignResponse",
"(",
")",
"throws",
"IOException",
"{",
"// Read the first 9 bytes from the InputStream which are the SSH2_AGENT_SIGN_RESPONSE headers.",
"final",
"byte",
"[",
"]",
"headerBytes",
"=",
"readBytes",
"(",
"9",
",",
"\"SSH2_AGENT_SIGN_RESPON... | Return an array of bytes from the ssh-agent representing data signed by a private SSH key.
@return An array of signed bytes. | [
"Return",
"an",
"array",
"of",
"bytes",
"from",
"the",
"ssh",
"-",
"agent",
"representing",
"data",
"signed",
"by",
"a",
"private",
"SSH",
"key",
"."
] | b678792750c0157bd5ed3fb6a18895ff95effbc4 | https://github.com/spotify/ssh-agent-proxy/blob/b678792750c0157bd5ed3fb6a18895ff95effbc4/src/main/java/com/spotify/sshagentproxy/AgentInput.java#L105-L124 | train |
Mozu/mozu-java | mozu-java-core/src/main/java/com/mozu/api/urls/commerce/settings/general/TaxableTerritoryUrl.java | TaxableTerritoryUrl.getTaxableTerritoriesUrl | public static MozuUrl getTaxableTerritoriesUrl()
{
UrlFormatter formatter = new UrlFormatter("/api/commerce/settings/general/taxableterritories");
return new MozuUrl(formatter.getResourceUrl(), MozuUrl.UrlLocation.TENANT_POD) ;
} | java | public static MozuUrl getTaxableTerritoriesUrl()
{
UrlFormatter formatter = new UrlFormatter("/api/commerce/settings/general/taxableterritories");
return new MozuUrl(formatter.getResourceUrl(), MozuUrl.UrlLocation.TENANT_POD) ;
} | [
"public",
"static",
"MozuUrl",
"getTaxableTerritoriesUrl",
"(",
")",
"{",
"UrlFormatter",
"formatter",
"=",
"new",
"UrlFormatter",
"(",
"\"/api/commerce/settings/general/taxableterritories\"",
")",
";",
"return",
"new",
"MozuUrl",
"(",
"formatter",
".",
"getResourceUrl",
... | Get Resource Url for GetTaxableTerritories
@return String Resource Url | [
"Get",
"Resource",
"Url",
"for",
"GetTaxableTerritories"
] | 5beadde73601a859f845e3e2fc1077b39c8bea83 | https://github.com/Mozu/mozu-java/blob/5beadde73601a859f845e3e2fc1077b39c8bea83/mozu-java-core/src/main/java/com/mozu/api/urls/commerce/settings/general/TaxableTerritoryUrl.java#L20-L24 | train |
Mozu/mozu-java | mozu-java-core/src/main/java/com/mozu/api/urls/commerce/settings/general/TaxableTerritoryUrl.java | TaxableTerritoryUrl.updateTaxableTerritoriesUrl | public static MozuUrl updateTaxableTerritoriesUrl()
{
UrlFormatter formatter = new UrlFormatter("/api/commerce/settings/general/taxableterritories");
return new MozuUrl(formatter.getResourceUrl(), MozuUrl.UrlLocation.TENANT_POD) ;
} | java | public static MozuUrl updateTaxableTerritoriesUrl()
{
UrlFormatter formatter = new UrlFormatter("/api/commerce/settings/general/taxableterritories");
return new MozuUrl(formatter.getResourceUrl(), MozuUrl.UrlLocation.TENANT_POD) ;
} | [
"public",
"static",
"MozuUrl",
"updateTaxableTerritoriesUrl",
"(",
")",
"{",
"UrlFormatter",
"formatter",
"=",
"new",
"UrlFormatter",
"(",
"\"/api/commerce/settings/general/taxableterritories\"",
")",
";",
"return",
"new",
"MozuUrl",
"(",
"formatter",
".",
"getResourceUrl... | Get Resource Url for UpdateTaxableTerritories
@return String Resource Url | [
"Get",
"Resource",
"Url",
"for",
"UpdateTaxableTerritories"
] | 5beadde73601a859f845e3e2fc1077b39c8bea83 | https://github.com/Mozu/mozu-java/blob/5beadde73601a859f845e3e2fc1077b39c8bea83/mozu-java-core/src/main/java/com/mozu/api/urls/commerce/settings/general/TaxableTerritoryUrl.java#L42-L46 | train |
nmdp-bioinformatics/ngs | variant/src/main/java/org/nmdp/ngs/variant/vcf/VcfRecordParser.java | VcfRecordParser.records | public static Iterable<VcfRecord> records(final Readable readable) throws IOException {
checkNotNull(readable);
ParseListener parseListener = new ParseListener();
VcfParser.parse(readable, parseListener);
return parseListener.getRecords();
} | java | public static Iterable<VcfRecord> records(final Readable readable) throws IOException {
checkNotNull(readable);
ParseListener parseListener = new ParseListener();
VcfParser.parse(readable, parseListener);
return parseListener.getRecords();
} | [
"public",
"static",
"Iterable",
"<",
"VcfRecord",
">",
"records",
"(",
"final",
"Readable",
"readable",
")",
"throws",
"IOException",
"{",
"checkNotNull",
"(",
"readable",
")",
";",
"ParseListener",
"parseListener",
"=",
"new",
"ParseListener",
"(",
")",
";",
... | Read zero or more VCF records from the specified readable.
@param readable readable to read from, must not be null
@return zero or more VCF records read from the specified readable
@throws IOException if an I/O error occurs | [
"Read",
"zero",
"or",
"more",
"VCF",
"records",
"from",
"the",
"specified",
"readable",
"."
] | 277627e4311313a80f5dc110b3185b0d7af32bd0 | https://github.com/nmdp-bioinformatics/ngs/blob/277627e4311313a80f5dc110b3185b0d7af32bd0/variant/src/main/java/org/nmdp/ngs/variant/vcf/VcfRecordParser.java#L55-L60 | train |
mgm-tp/jfunk | jfunk-data-generator/src/main/java/com/mgmtp/jfunk/data/generator/constraint/ConstraintFactory.java | ConstraintFactory.createModel | public Constraint createModel(final MathRandom random, final Element element) {
if (element == null) {
return null;
}
Class<? extends Constraint> classObject = null;
Constraint object = null;
try {
classObject = getClassObject(element);
Constructor<? extends Constraint> constructor = getConstructor(classObject);
object = getObject(random, element, constructor);
} catch (InvocationTargetException ex) {
throw new JFunkException("Could not initialise object of class " + classObject, ex.getCause());
} catch (Exception ex) {
throw new JFunkException("Could not initialise object of class " + classObject, ex);
}
putToCache(element, object);
return object;
} | java | public Constraint createModel(final MathRandom random, final Element element) {
if (element == null) {
return null;
}
Class<? extends Constraint> classObject = null;
Constraint object = null;
try {
classObject = getClassObject(element);
Constructor<? extends Constraint> constructor = getConstructor(classObject);
object = getObject(random, element, constructor);
} catch (InvocationTargetException ex) {
throw new JFunkException("Could not initialise object of class " + classObject, ex.getCause());
} catch (Exception ex) {
throw new JFunkException("Could not initialise object of class " + classObject, ex);
}
putToCache(element, object);
return object;
} | [
"public",
"Constraint",
"createModel",
"(",
"final",
"MathRandom",
"random",
",",
"final",
"Element",
"element",
")",
"{",
"if",
"(",
"element",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"Class",
"<",
"?",
"extends",
"Constraint",
">",
"classObje... | Generates an instance based on the data in the given object. The object's class will be
determined by the class attribute of the element. IF the element contains an id attribute the
generated instance is stored in a map using this id as key. | [
"Generates",
"an",
"instance",
"based",
"on",
"the",
"data",
"in",
"the",
"given",
"object",
".",
"The",
"object",
"s",
"class",
"will",
"be",
"determined",
"by",
"the",
"class",
"attribute",
"of",
"the",
"element",
".",
"IF",
"the",
"element",
"contains",... | 5b9fecac5778b988bb458085ded39ea9a4c7c2ae | https://github.com/mgm-tp/jfunk/blob/5b9fecac5778b988bb458085ded39ea9a4c7c2ae/jfunk-data-generator/src/main/java/com/mgmtp/jfunk/data/generator/constraint/ConstraintFactory.java#L62-L79 | train |
mgm-tp/jfunk | jfunk-data-generator/src/main/java/com/mgmtp/jfunk/data/generator/constraint/ConstraintFactory.java | ConstraintFactory.getModel | public Constraint getModel(final Element element) throws IdNotFoundException {
Attribute attr = element.getAttribute(XMLTags.ID);
if (attr == null) {
throw new IdNotFoundException(null);
}
Constraint c = null;
final String id = attr.getValue();
try {
c = getModel(id);
} catch (IdNotFoundException e) {
LOG.debug("DummyConstraint fuer id " + id);
}
if (c == null) {
c = new DummyConstraint();
putToCache(id, c);
}
return c;
} | java | public Constraint getModel(final Element element) throws IdNotFoundException {
Attribute attr = element.getAttribute(XMLTags.ID);
if (attr == null) {
throw new IdNotFoundException(null);
}
Constraint c = null;
final String id = attr.getValue();
try {
c = getModel(id);
} catch (IdNotFoundException e) {
LOG.debug("DummyConstraint fuer id " + id);
}
if (c == null) {
c = new DummyConstraint();
putToCache(id, c);
}
return c;
} | [
"public",
"Constraint",
"getModel",
"(",
"final",
"Element",
"element",
")",
"throws",
"IdNotFoundException",
"{",
"Attribute",
"attr",
"=",
"element",
".",
"getAttribute",
"(",
"XMLTags",
".",
"ID",
")",
";",
"if",
"(",
"attr",
"==",
"null",
")",
"{",
"th... | Returns the constraint to the associated id attribute value of the passed element. To achieve
this the id attribute of the passed element is searched first. If there is none an
IdNotFoundException will be thrown. Then the constraint stored under the respective key is
returned from the internal table. If this constraint is not found a wrapper is written to the
table at the requested key. This way the sequence of the constraints in the XML file does not
determine the cross-references by id. The wrapper will be replaced, if a constraint already
represented by the wrapper in the table is generated later on. | [
"Returns",
"the",
"constraint",
"to",
"the",
"associated",
"id",
"attribute",
"value",
"of",
"the",
"passed",
"element",
".",
"To",
"achieve",
"this",
"the",
"id",
"attribute",
"of",
"the",
"passed",
"element",
"is",
"searched",
"first",
".",
"If",
"there",
... | 5b9fecac5778b988bb458085ded39ea9a4c7c2ae | https://github.com/mgm-tp/jfunk/blob/5b9fecac5778b988bb458085ded39ea9a4c7c2ae/jfunk-data-generator/src/main/java/com/mgmtp/jfunk/data/generator/constraint/ConstraintFactory.java#L91-L108 | train |
mgm-tp/jfunk | jfunk-data-generator/src/main/java/com/mgmtp/jfunk/data/generator/constraint/ConstraintFactory.java | ConstraintFactory.getModel | public Constraint getModel(final String id) throws IdNotFoundException {
Constraint e = map.get(id);
if (e == null) {
throw new IdNotFoundException(id);
}
return e;
} | java | public Constraint getModel(final String id) throws IdNotFoundException {
Constraint e = map.get(id);
if (e == null) {
throw new IdNotFoundException(id);
}
return e;
} | [
"public",
"Constraint",
"getModel",
"(",
"final",
"String",
"id",
")",
"throws",
"IdNotFoundException",
"{",
"Constraint",
"e",
"=",
"map",
".",
"get",
"(",
"id",
")",
";",
"if",
"(",
"e",
"==",
"null",
")",
"{",
"throw",
"new",
"IdNotFoundException",
"(... | Returns the object in the map with the key id | [
"Returns",
"the",
"object",
"in",
"the",
"map",
"with",
"the",
"key",
"id"
] | 5b9fecac5778b988bb458085ded39ea9a4c7c2ae | https://github.com/mgm-tp/jfunk/blob/5b9fecac5778b988bb458085ded39ea9a4c7c2ae/jfunk-data-generator/src/main/java/com/mgmtp/jfunk/data/generator/constraint/ConstraintFactory.java#L113-L119 | train |
mgm-tp/jfunk | jfunk-data-generator/src/main/java/com/mgmtp/jfunk/data/generator/constraint/ConstraintFactory.java | ConstraintFactory.getClassObject | private Class<? extends Constraint> getClassObject(final Element element) throws ClassNotFoundException {
String className = element.getAttributeValue(XMLTags.CLASS);
className = className.indexOf('.') > 0 ? className : getClass().getPackage().getName() + '.' + className;
return Class.forName(className).asSubclass(Constraint.class);
} | java | private Class<? extends Constraint> getClassObject(final Element element) throws ClassNotFoundException {
String className = element.getAttributeValue(XMLTags.CLASS);
className = className.indexOf('.') > 0 ? className : getClass().getPackage().getName() + '.' + className;
return Class.forName(className).asSubclass(Constraint.class);
} | [
"private",
"Class",
"<",
"?",
"extends",
"Constraint",
">",
"getClassObject",
"(",
"final",
"Element",
"element",
")",
"throws",
"ClassNotFoundException",
"{",
"String",
"className",
"=",
"element",
".",
"getAttributeValue",
"(",
"XMLTags",
".",
"CLASS",
")",
";... | This method returns the class object of which a new instance shall be generated. To achieve
this the class attribute of the passed element will be used to determine the class name | [
"This",
"method",
"returns",
"the",
"class",
"object",
"of",
"which",
"a",
"new",
"instance",
"shall",
"be",
"generated",
".",
"To",
"achieve",
"this",
"the",
"class",
"attribute",
"of",
"the",
"passed",
"element",
"will",
"be",
"used",
"to",
"determine",
... | 5b9fecac5778b988bb458085ded39ea9a4c7c2ae | https://github.com/mgm-tp/jfunk/blob/5b9fecac5778b988bb458085ded39ea9a4c7c2ae/jfunk-data-generator/src/main/java/com/mgmtp/jfunk/data/generator/constraint/ConstraintFactory.java#L132-L137 | train |
mgm-tp/jfunk | jfunk-data-generator/src/main/java/com/mgmtp/jfunk/data/generator/constraint/ConstraintFactory.java | ConstraintFactory.getConstructor | private Constructor<? extends Constraint> getConstructor(final Class<? extends Constraint> classObject) throws NoSuchMethodException {
return classObject.getConstructor(new Class[] { MathRandom.class, Element.class, Generator.class });
} | java | private Constructor<? extends Constraint> getConstructor(final Class<? extends Constraint> classObject) throws NoSuchMethodException {
return classObject.getConstructor(new Class[] { MathRandom.class, Element.class, Generator.class });
} | [
"private",
"Constructor",
"<",
"?",
"extends",
"Constraint",
">",
"getConstructor",
"(",
"final",
"Class",
"<",
"?",
"extends",
"Constraint",
">",
"classObject",
")",
"throws",
"NoSuchMethodException",
"{",
"return",
"classObject",
".",
"getConstructor",
"(",
"new... | Searches for the matching constraint constructor with the parameter types MathRandom, Element
and Generator. | [
"Searches",
"for",
"the",
"matching",
"constraint",
"constructor",
"with",
"the",
"parameter",
"types",
"MathRandom",
"Element",
"and",
"Generator",
"."
] | 5b9fecac5778b988bb458085ded39ea9a4c7c2ae | https://github.com/mgm-tp/jfunk/blob/5b9fecac5778b988bb458085ded39ea9a4c7c2ae/jfunk-data-generator/src/main/java/com/mgmtp/jfunk/data/generator/constraint/ConstraintFactory.java#L143-L145 | train |
mgm-tp/jfunk | jfunk-data-generator/src/main/java/com/mgmtp/jfunk/data/generator/constraint/ConstraintFactory.java | ConstraintFactory.getObject | private Constraint getObject(final MathRandom random, final Element element, final Constructor<? extends Constraint> constructor)
throws IllegalArgumentException, InstantiationException, IllegalAccessException, InvocationTargetException {
LOG.debug("Creating constraint: " + element.getAttributes());
Constraint instance = constructor.newInstance(new Object[] { random, element, generator });
injector.injectMembers(instance);
return instance;
} | java | private Constraint getObject(final MathRandom random, final Element element, final Constructor<? extends Constraint> constructor)
throws IllegalArgumentException, InstantiationException, IllegalAccessException, InvocationTargetException {
LOG.debug("Creating constraint: " + element.getAttributes());
Constraint instance = constructor.newInstance(new Object[] { random, element, generator });
injector.injectMembers(instance);
return instance;
} | [
"private",
"Constraint",
"getObject",
"(",
"final",
"MathRandom",
"random",
",",
"final",
"Element",
"element",
",",
"final",
"Constructor",
"<",
"?",
"extends",
"Constraint",
">",
"constructor",
")",
"throws",
"IllegalArgumentException",
",",
"InstantiationException"... | Generates a new constraint instance using the given constructor, the element and the
generateor callback as parameters. | [
"Generates",
"a",
"new",
"constraint",
"instance",
"using",
"the",
"given",
"constructor",
"the",
"element",
"and",
"the",
"generateor",
"callback",
"as",
"parameters",
"."
] | 5b9fecac5778b988bb458085ded39ea9a4c7c2ae | https://github.com/mgm-tp/jfunk/blob/5b9fecac5778b988bb458085ded39ea9a4c7c2ae/jfunk-data-generator/src/main/java/com/mgmtp/jfunk/data/generator/constraint/ConstraintFactory.java#L151-L157 | train |
mgm-tp/jfunk | jfunk-data-generator/src/main/java/com/mgmtp/jfunk/data/generator/constraint/ConstraintFactory.java | ConstraintFactory.putToCache | private void putToCache(final Element element, final Constraint object) {
String id = element.getAttributeValue(XMLTags.ID);
if (id != null && id.length() > 0) {
Constraint old = putToCache(id, object);
if (old != null) {
LOG.warn("The id=" + id + " for object of type=" + old.getClass().getName()
+ " was already found. Please make sure this is ok and no mistake.");
}
}
} | java | private void putToCache(final Element element, final Constraint object) {
String id = element.getAttributeValue(XMLTags.ID);
if (id != null && id.length() > 0) {
Constraint old = putToCache(id, object);
if (old != null) {
LOG.warn("The id=" + id + " for object of type=" + old.getClass().getName()
+ " was already found. Please make sure this is ok and no mistake.");
}
}
} | [
"private",
"void",
"putToCache",
"(",
"final",
"Element",
"element",
",",
"final",
"Constraint",
"object",
")",
"{",
"String",
"id",
"=",
"element",
".",
"getAttributeValue",
"(",
"XMLTags",
".",
"ID",
")",
";",
"if",
"(",
"id",
"!=",
"null",
"&&",
"id",... | If the element has an attribute with name id this attribute's value will be used as key to
store the just generated object in a map. The object can in this case also be retrieved using
this id.
@see #getModel(String) | [
"If",
"the",
"element",
"has",
"an",
"attribute",
"with",
"name",
"id",
"this",
"attribute",
"s",
"value",
"will",
"be",
"used",
"as",
"key",
"to",
"store",
"the",
"just",
"generated",
"object",
"in",
"a",
"map",
".",
"The",
"object",
"can",
"in",
"thi... | 5b9fecac5778b988bb458085ded39ea9a4c7c2ae | https://github.com/mgm-tp/jfunk/blob/5b9fecac5778b988bb458085ded39ea9a4c7c2ae/jfunk-data-generator/src/main/java/com/mgmtp/jfunk/data/generator/constraint/ConstraintFactory.java#L166-L175 | train |
mgm-tp/jfunk | jfunk-data-generator/src/main/java/com/mgmtp/jfunk/data/generator/constraint/ConstraintFactory.java | ConstraintFactory.putToCache | private Constraint putToCache(final String id, final Constraint object) {
Constraint c = this.map.put(id, object);
if (c instanceof DummyConstraint) {
((DummyConstraint) c).constraint = object;
return null;
}
return c;
} | java | private Constraint putToCache(final String id, final Constraint object) {
Constraint c = this.map.put(id, object);
if (c instanceof DummyConstraint) {
((DummyConstraint) c).constraint = object;
return null;
}
return c;
} | [
"private",
"Constraint",
"putToCache",
"(",
"final",
"String",
"id",
",",
"final",
"Constraint",
"object",
")",
"{",
"Constraint",
"c",
"=",
"this",
".",
"map",
".",
"put",
"(",
"id",
",",
"object",
")",
";",
"if",
"(",
"c",
"instanceof",
"DummyConstrain... | Puts the given constraint object into the cache using the key id. If an existing
DummyConstraint object is found in the table, the reference will be set to the constraint and
the constraint will not be put into the table. | [
"Puts",
"the",
"given",
"constraint",
"object",
"into",
"the",
"cache",
"using",
"the",
"key",
"id",
".",
"If",
"an",
"existing",
"DummyConstraint",
"object",
"is",
"found",
"in",
"the",
"table",
"the",
"reference",
"will",
"be",
"set",
"to",
"the",
"const... | 5b9fecac5778b988bb458085ded39ea9a4c7c2ae | https://github.com/mgm-tp/jfunk/blob/5b9fecac5778b988bb458085ded39ea9a4c7c2ae/jfunk-data-generator/src/main/java/com/mgmtp/jfunk/data/generator/constraint/ConstraintFactory.java#L182-L189 | train |
nmdp-bioinformatics/ngs | sra/src/main/java/org/nmdp/ngs/sra/SraReader.java | SraReader.readAnalysis | public static Analysis readAnalysis(final Reader reader) throws IOException {
checkNotNull(reader);
try {
JAXBContext context = JAXBContext.newInstance(Analysis.class);
Unmarshaller unmarshaller = context.createUnmarshaller();
SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
URL commonSchemaURL = SraReader.class.getResource("/org/nmdp/ngs/sra/xsd/SRA.common.xsd");
URL analysisSchemaURL = SraReader.class.getResource("/org/nmdp/ngs/sra/xsd/SRA.analysis.xsd");
Schema schema = schemaFactory.newSchema(new StreamSource[] { new StreamSource(commonSchemaURL.toString()), new StreamSource(analysisSchemaURL.toString()) });
unmarshaller.setSchema(schema);
return (Analysis) unmarshaller.unmarshal(reader);
}
catch (JAXBException | SAXException e) {
throw new IOException("could not unmarshal Analysis", e);
}
} | java | public static Analysis readAnalysis(final Reader reader) throws IOException {
checkNotNull(reader);
try {
JAXBContext context = JAXBContext.newInstance(Analysis.class);
Unmarshaller unmarshaller = context.createUnmarshaller();
SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
URL commonSchemaURL = SraReader.class.getResource("/org/nmdp/ngs/sra/xsd/SRA.common.xsd");
URL analysisSchemaURL = SraReader.class.getResource("/org/nmdp/ngs/sra/xsd/SRA.analysis.xsd");
Schema schema = schemaFactory.newSchema(new StreamSource[] { new StreamSource(commonSchemaURL.toString()), new StreamSource(analysisSchemaURL.toString()) });
unmarshaller.setSchema(schema);
return (Analysis) unmarshaller.unmarshal(reader);
}
catch (JAXBException | SAXException e) {
throw new IOException("could not unmarshal Analysis", e);
}
} | [
"public",
"static",
"Analysis",
"readAnalysis",
"(",
"final",
"Reader",
"reader",
")",
"throws",
"IOException",
"{",
"checkNotNull",
"(",
"reader",
")",
";",
"try",
"{",
"JAXBContext",
"context",
"=",
"JAXBContext",
".",
"newInstance",
"(",
"Analysis",
".",
"c... | Read an analysis from the specified reader.
@param reader reader, must not be null
@return an analysis read from the specified reader
@throws IOException if an I/O error occurs | [
"Read",
"an",
"analysis",
"from",
"the",
"specified",
"reader",
"."
] | 277627e4311313a80f5dc110b3185b0d7af32bd0 | https://github.com/nmdp-bioinformatics/ngs/blob/277627e4311313a80f5dc110b3185b0d7af32bd0/sra/src/main/java/org/nmdp/ngs/sra/SraReader.java#L73-L88 | train |
nmdp-bioinformatics/ngs | sra/src/main/java/org/nmdp/ngs/sra/SraReader.java | SraReader.readAnalysis | public static Analysis readAnalysis(final File file) throws IOException {
checkNotNull(file);
try (BufferedReader reader = new BufferedReader(new FileReader(file))) {
return readAnalysis(reader);
}
} | java | public static Analysis readAnalysis(final File file) throws IOException {
checkNotNull(file);
try (BufferedReader reader = new BufferedReader(new FileReader(file))) {
return readAnalysis(reader);
}
} | [
"public",
"static",
"Analysis",
"readAnalysis",
"(",
"final",
"File",
"file",
")",
"throws",
"IOException",
"{",
"checkNotNull",
"(",
"file",
")",
";",
"try",
"(",
"BufferedReader",
"reader",
"=",
"new",
"BufferedReader",
"(",
"new",
"FileReader",
"(",
"file",... | Read an analysis from the specified file.
@param file file, must not be null
@return an analysis read from the specified file
@throws IOException if an I/O error occurs | [
"Read",
"an",
"analysis",
"from",
"the",
"specified",
"file",
"."
] | 277627e4311313a80f5dc110b3185b0d7af32bd0 | https://github.com/nmdp-bioinformatics/ngs/blob/277627e4311313a80f5dc110b3185b0d7af32bd0/sra/src/main/java/org/nmdp/ngs/sra/SraReader.java#L97-L102 | train |
nmdp-bioinformatics/ngs | sra/src/main/java/org/nmdp/ngs/sra/SraReader.java | SraReader.readAnalysis | public static Analysis readAnalysis(final URL url) throws IOException {
checkNotNull(url);
try (BufferedReader reader = Resources.asCharSource(url, Charsets.UTF_8).openBufferedStream()) {
return readAnalysis(reader);
}
} | java | public static Analysis readAnalysis(final URL url) throws IOException {
checkNotNull(url);
try (BufferedReader reader = Resources.asCharSource(url, Charsets.UTF_8).openBufferedStream()) {
return readAnalysis(reader);
}
} | [
"public",
"static",
"Analysis",
"readAnalysis",
"(",
"final",
"URL",
"url",
")",
"throws",
"IOException",
"{",
"checkNotNull",
"(",
"url",
")",
";",
"try",
"(",
"BufferedReader",
"reader",
"=",
"Resources",
".",
"asCharSource",
"(",
"url",
",",
"Charsets",
"... | Read an analysis from the specified URL.
@param url URL, must not be null
@return an analysis read from the specified URL
@throws IOException if an I/O error occurs | [
"Read",
"an",
"analysis",
"from",
"the",
"specified",
"URL",
"."
] | 277627e4311313a80f5dc110b3185b0d7af32bd0 | https://github.com/nmdp-bioinformatics/ngs/blob/277627e4311313a80f5dc110b3185b0d7af32bd0/sra/src/main/java/org/nmdp/ngs/sra/SraReader.java#L111-L116 | train |
nmdp-bioinformatics/ngs | sra/src/main/java/org/nmdp/ngs/sra/SraReader.java | SraReader.readAnalysis | public static Analysis readAnalysis(final InputStream inputStream) throws IOException {
checkNotNull(inputStream);
try (BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream))) {
return readAnalysis(reader);
}
} | java | public static Analysis readAnalysis(final InputStream inputStream) throws IOException {
checkNotNull(inputStream);
try (BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream))) {
return readAnalysis(reader);
}
} | [
"public",
"static",
"Analysis",
"readAnalysis",
"(",
"final",
"InputStream",
"inputStream",
")",
"throws",
"IOException",
"{",
"checkNotNull",
"(",
"inputStream",
")",
";",
"try",
"(",
"BufferedReader",
"reader",
"=",
"new",
"BufferedReader",
"(",
"new",
"InputStr... | Read an analysis from the specified input stream.
@param inputStream input stream, must not be null
@return an analysis read from the specified input stream
@throws IOException if an I/O error occurs | [
"Read",
"an",
"analysis",
"from",
"the",
"specified",
"input",
"stream",
"."
] | 277627e4311313a80f5dc110b3185b0d7af32bd0 | https://github.com/nmdp-bioinformatics/ngs/blob/277627e4311313a80f5dc110b3185b0d7af32bd0/sra/src/main/java/org/nmdp/ngs/sra/SraReader.java#L125-L130 | train |
nmdp-bioinformatics/ngs | sra/src/main/java/org/nmdp/ngs/sra/SraReader.java | SraReader.readExperiment | public static Experiment readExperiment(final File file) throws IOException {
checkNotNull(file);
try (BufferedReader reader = new BufferedReader(new FileReader(file))) {
return readExperiment(reader);
}
} | java | public static Experiment readExperiment(final File file) throws IOException {
checkNotNull(file);
try (BufferedReader reader = new BufferedReader(new FileReader(file))) {
return readExperiment(reader);
}
} | [
"public",
"static",
"Experiment",
"readExperiment",
"(",
"final",
"File",
"file",
")",
"throws",
"IOException",
"{",
"checkNotNull",
"(",
"file",
")",
";",
"try",
"(",
"BufferedReader",
"reader",
"=",
"new",
"BufferedReader",
"(",
"new",
"FileReader",
"(",
"fi... | Read an experiment from the specified file.
@param file file, must not be null
@return an experiment read from the specified file
@throws IOException if an I/O error occurs | [
"Read",
"an",
"experiment",
"from",
"the",
"specified",
"file",
"."
] | 277627e4311313a80f5dc110b3185b0d7af32bd0 | https://github.com/nmdp-bioinformatics/ngs/blob/277627e4311313a80f5dc110b3185b0d7af32bd0/sra/src/main/java/org/nmdp/ngs/sra/SraReader.java#L164-L169 | train |
nmdp-bioinformatics/ngs | sra/src/main/java/org/nmdp/ngs/sra/SraReader.java | SraReader.readExperiment | public static Experiment readExperiment(final URL url) throws IOException {
checkNotNull(url);
try (BufferedReader reader = Resources.asCharSource(url, Charsets.UTF_8).openBufferedStream()) {
return readExperiment(reader);
}
} | java | public static Experiment readExperiment(final URL url) throws IOException {
checkNotNull(url);
try (BufferedReader reader = Resources.asCharSource(url, Charsets.UTF_8).openBufferedStream()) {
return readExperiment(reader);
}
} | [
"public",
"static",
"Experiment",
"readExperiment",
"(",
"final",
"URL",
"url",
")",
"throws",
"IOException",
"{",
"checkNotNull",
"(",
"url",
")",
";",
"try",
"(",
"BufferedReader",
"reader",
"=",
"Resources",
".",
"asCharSource",
"(",
"url",
",",
"Charsets",... | Read an experiment from the specified URL.
@param url URL, must not be null
@return an experiment read from the specified URL
@throws IOException if an I/O error occurs | [
"Read",
"an",
"experiment",
"from",
"the",
"specified",
"URL",
"."
] | 277627e4311313a80f5dc110b3185b0d7af32bd0 | https://github.com/nmdp-bioinformatics/ngs/blob/277627e4311313a80f5dc110b3185b0d7af32bd0/sra/src/main/java/org/nmdp/ngs/sra/SraReader.java#L178-L183 | train |
nmdp-bioinformatics/ngs | sra/src/main/java/org/nmdp/ngs/sra/SraReader.java | SraReader.readExperiment | public static Experiment readExperiment(final InputStream inputStream) throws IOException {
checkNotNull(inputStream);
try (BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream))) {
return readExperiment(reader);
}
} | java | public static Experiment readExperiment(final InputStream inputStream) throws IOException {
checkNotNull(inputStream);
try (BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream))) {
return readExperiment(reader);
}
} | [
"public",
"static",
"Experiment",
"readExperiment",
"(",
"final",
"InputStream",
"inputStream",
")",
"throws",
"IOException",
"{",
"checkNotNull",
"(",
"inputStream",
")",
";",
"try",
"(",
"BufferedReader",
"reader",
"=",
"new",
"BufferedReader",
"(",
"new",
"Inpu... | Read an experiment from the specified input stream.
@param inputStream input stream, must not be null
@return an experiment read from the specified input stream
@throws IOException if an I/O error occurs | [
"Read",
"an",
"experiment",
"from",
"the",
"specified",
"input",
"stream",
"."
] | 277627e4311313a80f5dc110b3185b0d7af32bd0 | https://github.com/nmdp-bioinformatics/ngs/blob/277627e4311313a80f5dc110b3185b0d7af32bd0/sra/src/main/java/org/nmdp/ngs/sra/SraReader.java#L192-L197 | train |
nmdp-bioinformatics/ngs | sra/src/main/java/org/nmdp/ngs/sra/SraReader.java | SraReader.readRunSet | public static RunSet readRunSet(final File file) throws IOException {
checkNotNull(file);
try (BufferedReader reader = new BufferedReader(new FileReader(file))) {
return readRunSet(reader);
}
} | java | public static RunSet readRunSet(final File file) throws IOException {
checkNotNull(file);
try (BufferedReader reader = new BufferedReader(new FileReader(file))) {
return readRunSet(reader);
}
} | [
"public",
"static",
"RunSet",
"readRunSet",
"(",
"final",
"File",
"file",
")",
"throws",
"IOException",
"{",
"checkNotNull",
"(",
"file",
")",
";",
"try",
"(",
"BufferedReader",
"reader",
"=",
"new",
"BufferedReader",
"(",
"new",
"FileReader",
"(",
"file",
"... | Read a run set from the specified file.
@param file file, must not be null
@return a run set read from the specified file
@throws IOException if an I/O error occurs | [
"Read",
"a",
"run",
"set",
"from",
"the",
"specified",
"file",
"."
] | 277627e4311313a80f5dc110b3185b0d7af32bd0 | https://github.com/nmdp-bioinformatics/ngs/blob/277627e4311313a80f5dc110b3185b0d7af32bd0/sra/src/main/java/org/nmdp/ngs/sra/SraReader.java#L231-L236 | train |
nmdp-bioinformatics/ngs | sra/src/main/java/org/nmdp/ngs/sra/SraReader.java | SraReader.readRunSet | public static RunSet readRunSet(final URL url) throws IOException {
checkNotNull(url);
try (BufferedReader reader = Resources.asCharSource(url, Charsets.UTF_8).openBufferedStream()) {
return readRunSet(reader);
}
} | java | public static RunSet readRunSet(final URL url) throws IOException {
checkNotNull(url);
try (BufferedReader reader = Resources.asCharSource(url, Charsets.UTF_8).openBufferedStream()) {
return readRunSet(reader);
}
} | [
"public",
"static",
"RunSet",
"readRunSet",
"(",
"final",
"URL",
"url",
")",
"throws",
"IOException",
"{",
"checkNotNull",
"(",
"url",
")",
";",
"try",
"(",
"BufferedReader",
"reader",
"=",
"Resources",
".",
"asCharSource",
"(",
"url",
",",
"Charsets",
".",
... | Read a run set from the specified URL.
@param url URL, must not be null
@return a run set read from the specified URL
@throws IOException if an I/O error occurs | [
"Read",
"a",
"run",
"set",
"from",
"the",
"specified",
"URL",
"."
] | 277627e4311313a80f5dc110b3185b0d7af32bd0 | https://github.com/nmdp-bioinformatics/ngs/blob/277627e4311313a80f5dc110b3185b0d7af32bd0/sra/src/main/java/org/nmdp/ngs/sra/SraReader.java#L245-L250 | train |
nmdp-bioinformatics/ngs | sra/src/main/java/org/nmdp/ngs/sra/SraReader.java | SraReader.readRunSet | public static RunSet readRunSet(final InputStream inputStream) throws IOException {
checkNotNull(inputStream);
try (BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream))) {
return readRunSet(reader);
}
} | java | public static RunSet readRunSet(final InputStream inputStream) throws IOException {
checkNotNull(inputStream);
try (BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream))) {
return readRunSet(reader);
}
} | [
"public",
"static",
"RunSet",
"readRunSet",
"(",
"final",
"InputStream",
"inputStream",
")",
"throws",
"IOException",
"{",
"checkNotNull",
"(",
"inputStream",
")",
";",
"try",
"(",
"BufferedReader",
"reader",
"=",
"new",
"BufferedReader",
"(",
"new",
"InputStreamR... | Read a run set from the specified input stream.
@param inputStream input stream, must not be null
@return a run set read from the specified input stream
@throws IOException if an I/O error occurs | [
"Read",
"a",
"run",
"set",
"from",
"the",
"specified",
"input",
"stream",
"."
] | 277627e4311313a80f5dc110b3185b0d7af32bd0 | https://github.com/nmdp-bioinformatics/ngs/blob/277627e4311313a80f5dc110b3185b0d7af32bd0/sra/src/main/java/org/nmdp/ngs/sra/SraReader.java#L259-L264 | train |
nmdp-bioinformatics/ngs | sra/src/main/java/org/nmdp/ngs/sra/SraReader.java | SraReader.readSample | public static Sample readSample(final File file) throws IOException {
checkNotNull(file);
try (BufferedReader reader = new BufferedReader(new FileReader(file))) {
return readSample(reader);
}
} | java | public static Sample readSample(final File file) throws IOException {
checkNotNull(file);
try (BufferedReader reader = new BufferedReader(new FileReader(file))) {
return readSample(reader);
}
} | [
"public",
"static",
"Sample",
"readSample",
"(",
"final",
"File",
"file",
")",
"throws",
"IOException",
"{",
"checkNotNull",
"(",
"file",
")",
";",
"try",
"(",
"BufferedReader",
"reader",
"=",
"new",
"BufferedReader",
"(",
"new",
"FileReader",
"(",
"file",
"... | Read a sample from the specified file.
@param file file, must not be null
@return a sample read from the specified file
@throws IOException if an I/O error occurs | [
"Read",
"a",
"sample",
"from",
"the",
"specified",
"file",
"."
] | 277627e4311313a80f5dc110b3185b0d7af32bd0 | https://github.com/nmdp-bioinformatics/ngs/blob/277627e4311313a80f5dc110b3185b0d7af32bd0/sra/src/main/java/org/nmdp/ngs/sra/SraReader.java#L298-L303 | train |
nmdp-bioinformatics/ngs | sra/src/main/java/org/nmdp/ngs/sra/SraReader.java | SraReader.readSample | public static Sample readSample(final URL url) throws IOException {
checkNotNull(url);
try (BufferedReader reader = Resources.asCharSource(url, Charsets.UTF_8).openBufferedStream()) {
return readSample(reader);
}
} | java | public static Sample readSample(final URL url) throws IOException {
checkNotNull(url);
try (BufferedReader reader = Resources.asCharSource(url, Charsets.UTF_8).openBufferedStream()) {
return readSample(reader);
}
} | [
"public",
"static",
"Sample",
"readSample",
"(",
"final",
"URL",
"url",
")",
"throws",
"IOException",
"{",
"checkNotNull",
"(",
"url",
")",
";",
"try",
"(",
"BufferedReader",
"reader",
"=",
"Resources",
".",
"asCharSource",
"(",
"url",
",",
"Charsets",
".",
... | Read a sample from the specified URL.
@param url URL, must not be null
@return a sample read from the specified URL
@throws IOException if an I/O error occurs | [
"Read",
"a",
"sample",
"from",
"the",
"specified",
"URL",
"."
] | 277627e4311313a80f5dc110b3185b0d7af32bd0 | https://github.com/nmdp-bioinformatics/ngs/blob/277627e4311313a80f5dc110b3185b0d7af32bd0/sra/src/main/java/org/nmdp/ngs/sra/SraReader.java#L312-L317 | train |
nmdp-bioinformatics/ngs | sra/src/main/java/org/nmdp/ngs/sra/SraReader.java | SraReader.readSample | public static Sample readSample(final InputStream inputStream) throws IOException {
checkNotNull(inputStream);
try (BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream))) {
return readSample(reader);
}
} | java | public static Sample readSample(final InputStream inputStream) throws IOException {
checkNotNull(inputStream);
try (BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream))) {
return readSample(reader);
}
} | [
"public",
"static",
"Sample",
"readSample",
"(",
"final",
"InputStream",
"inputStream",
")",
"throws",
"IOException",
"{",
"checkNotNull",
"(",
"inputStream",
")",
";",
"try",
"(",
"BufferedReader",
"reader",
"=",
"new",
"BufferedReader",
"(",
"new",
"InputStreamR... | Read a sample from the specified input stream.
@param inputStream input stream, must not be null
@return a sample read from the specified input stream
@throws IOException if an I/O error occurs | [
"Read",
"a",
"sample",
"from",
"the",
"specified",
"input",
"stream",
"."
] | 277627e4311313a80f5dc110b3185b0d7af32bd0 | https://github.com/nmdp-bioinformatics/ngs/blob/277627e4311313a80f5dc110b3185b0d7af32bd0/sra/src/main/java/org/nmdp/ngs/sra/SraReader.java#L326-L331 | train |
nmdp-bioinformatics/ngs | sra/src/main/java/org/nmdp/ngs/sra/SraReader.java | SraReader.readStudy | public static Study readStudy(final File file) throws IOException {
checkNotNull(file);
try (BufferedReader reader = new BufferedReader(new FileReader(file))) {
return readStudy(reader);
}
} | java | public static Study readStudy(final File file) throws IOException {
checkNotNull(file);
try (BufferedReader reader = new BufferedReader(new FileReader(file))) {
return readStudy(reader);
}
} | [
"public",
"static",
"Study",
"readStudy",
"(",
"final",
"File",
"file",
")",
"throws",
"IOException",
"{",
"checkNotNull",
"(",
"file",
")",
";",
"try",
"(",
"BufferedReader",
"reader",
"=",
"new",
"BufferedReader",
"(",
"new",
"FileReader",
"(",
"file",
")"... | Read a study from the specified file.
@param file file, must not be null
@return a study read from the specified file
@throws IOException if an I/O error occurs | [
"Read",
"a",
"study",
"from",
"the",
"specified",
"file",
"."
] | 277627e4311313a80f5dc110b3185b0d7af32bd0 | https://github.com/nmdp-bioinformatics/ngs/blob/277627e4311313a80f5dc110b3185b0d7af32bd0/sra/src/main/java/org/nmdp/ngs/sra/SraReader.java#L365-L370 | train |
nmdp-bioinformatics/ngs | sra/src/main/java/org/nmdp/ngs/sra/SraReader.java | SraReader.readStudy | public static Study readStudy(final URL url) throws IOException {
checkNotNull(url);
try (BufferedReader reader = Resources.asCharSource(url, Charsets.UTF_8).openBufferedStream()) {
return readStudy(reader);
}
} | java | public static Study readStudy(final URL url) throws IOException {
checkNotNull(url);
try (BufferedReader reader = Resources.asCharSource(url, Charsets.UTF_8).openBufferedStream()) {
return readStudy(reader);
}
} | [
"public",
"static",
"Study",
"readStudy",
"(",
"final",
"URL",
"url",
")",
"throws",
"IOException",
"{",
"checkNotNull",
"(",
"url",
")",
";",
"try",
"(",
"BufferedReader",
"reader",
"=",
"Resources",
".",
"asCharSource",
"(",
"url",
",",
"Charsets",
".",
... | Read a study from the specified URL.
@param url URL, must not be null
@return a study read from the specified URL
@throws IOException if an I/O error occurs | [
"Read",
"a",
"study",
"from",
"the",
"specified",
"URL",
"."
] | 277627e4311313a80f5dc110b3185b0d7af32bd0 | https://github.com/nmdp-bioinformatics/ngs/blob/277627e4311313a80f5dc110b3185b0d7af32bd0/sra/src/main/java/org/nmdp/ngs/sra/SraReader.java#L379-L384 | train |
nmdp-bioinformatics/ngs | sra/src/main/java/org/nmdp/ngs/sra/SraReader.java | SraReader.readStudy | public static Study readStudy(final InputStream inputStream) throws IOException {
checkNotNull(inputStream);
try (BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream))) {
return readStudy(reader);
}
} | java | public static Study readStudy(final InputStream inputStream) throws IOException {
checkNotNull(inputStream);
try (BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream))) {
return readStudy(reader);
}
} | [
"public",
"static",
"Study",
"readStudy",
"(",
"final",
"InputStream",
"inputStream",
")",
"throws",
"IOException",
"{",
"checkNotNull",
"(",
"inputStream",
")",
";",
"try",
"(",
"BufferedReader",
"reader",
"=",
"new",
"BufferedReader",
"(",
"new",
"InputStreamRea... | Read a study from the specified input stream.
@param inputStream input stream, must not be null
@return a study read from the specified input stream
@throws IOException if an I/O error occurs | [
"Read",
"a",
"study",
"from",
"the",
"specified",
"input",
"stream",
"."
] | 277627e4311313a80f5dc110b3185b0d7af32bd0 | https://github.com/nmdp-bioinformatics/ngs/blob/277627e4311313a80f5dc110b3185b0d7af32bd0/sra/src/main/java/org/nmdp/ngs/sra/SraReader.java#L393-L398 | train |
nmdp-bioinformatics/ngs | sra/src/main/java/org/nmdp/ngs/sra/SraReader.java | SraReader.readSubmission | public static Submission readSubmission(final File file) throws IOException {
checkNotNull(file);
try (BufferedReader reader = new BufferedReader(new FileReader(file))) {
return readSubmission(reader);
}
} | java | public static Submission readSubmission(final File file) throws IOException {
checkNotNull(file);
try (BufferedReader reader = new BufferedReader(new FileReader(file))) {
return readSubmission(reader);
}
} | [
"public",
"static",
"Submission",
"readSubmission",
"(",
"final",
"File",
"file",
")",
"throws",
"IOException",
"{",
"checkNotNull",
"(",
"file",
")",
";",
"try",
"(",
"BufferedReader",
"reader",
"=",
"new",
"BufferedReader",
"(",
"new",
"FileReader",
"(",
"fi... | Read a submission from the specified file.
@param file file, must not be null
@return a submission read from the specified file
@throws IOException if an I/O error occurs | [
"Read",
"a",
"submission",
"from",
"the",
"specified",
"file",
"."
] | 277627e4311313a80f5dc110b3185b0d7af32bd0 | https://github.com/nmdp-bioinformatics/ngs/blob/277627e4311313a80f5dc110b3185b0d7af32bd0/sra/src/main/java/org/nmdp/ngs/sra/SraReader.java#L432-L437 | train |
nmdp-bioinformatics/ngs | sra/src/main/java/org/nmdp/ngs/sra/SraReader.java | SraReader.readSubmission | public static Submission readSubmission(final URL url) throws IOException {
checkNotNull(url);
try (BufferedReader reader = Resources.asCharSource(url, Charsets.UTF_8).openBufferedStream()) {
return readSubmission(reader);
}
} | java | public static Submission readSubmission(final URL url) throws IOException {
checkNotNull(url);
try (BufferedReader reader = Resources.asCharSource(url, Charsets.UTF_8).openBufferedStream()) {
return readSubmission(reader);
}
} | [
"public",
"static",
"Submission",
"readSubmission",
"(",
"final",
"URL",
"url",
")",
"throws",
"IOException",
"{",
"checkNotNull",
"(",
"url",
")",
";",
"try",
"(",
"BufferedReader",
"reader",
"=",
"Resources",
".",
"asCharSource",
"(",
"url",
",",
"Charsets",... | Read a submission from the specified URL.
@param url URL, must not be null
@return a submission read from the specified URL
@throws IOException if an I/O error occurs | [
"Read",
"a",
"submission",
"from",
"the",
"specified",
"URL",
"."
] | 277627e4311313a80f5dc110b3185b0d7af32bd0 | https://github.com/nmdp-bioinformatics/ngs/blob/277627e4311313a80f5dc110b3185b0d7af32bd0/sra/src/main/java/org/nmdp/ngs/sra/SraReader.java#L446-L451 | train |
nmdp-bioinformatics/ngs | sra/src/main/java/org/nmdp/ngs/sra/SraReader.java | SraReader.readSubmission | public static Submission readSubmission(final InputStream inputStream) throws IOException {
checkNotNull(inputStream);
try (BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream))) {
return readSubmission(reader);
}
} | java | public static Submission readSubmission(final InputStream inputStream) throws IOException {
checkNotNull(inputStream);
try (BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream))) {
return readSubmission(reader);
}
} | [
"public",
"static",
"Submission",
"readSubmission",
"(",
"final",
"InputStream",
"inputStream",
")",
"throws",
"IOException",
"{",
"checkNotNull",
"(",
"inputStream",
")",
";",
"try",
"(",
"BufferedReader",
"reader",
"=",
"new",
"BufferedReader",
"(",
"new",
"Inpu... | Read a submission from the specified input stream.
@param inputStream input stream, must not be null
@return a submission read from the specified input stream
@throws IOException if an I/O error occurs | [
"Read",
"a",
"submission",
"from",
"the",
"specified",
"input",
"stream",
"."
] | 277627e4311313a80f5dc110b3185b0d7af32bd0 | https://github.com/nmdp-bioinformatics/ngs/blob/277627e4311313a80f5dc110b3185b0d7af32bd0/sra/src/main/java/org/nmdp/ngs/sra/SraReader.java#L460-L465 | train |
mgm-tp/jfunk | jfunk-common/src/main/java/com/mgmtp/jfunk/common/config/BaseScope.java | BaseScope.getScopedObject | protected <T> T getScopedObject(final Key<T> key, final Provider<T> unscoped, final Map<Key<?>, Object> scopeMap) {
// ok, because we know what we'd put in before
@SuppressWarnings("unchecked")
T value = (T) scopeMap.get(key);
if (value == null) {
/*
* no cache instance present, so we use the one we get from the unscoped provider and
* add it to the cache
*/
value = unscoped.get();
scopeMap.put(key, value);
}
return value;
} | java | protected <T> T getScopedObject(final Key<T> key, final Provider<T> unscoped, final Map<Key<?>, Object> scopeMap) {
// ok, because we know what we'd put in before
@SuppressWarnings("unchecked")
T value = (T) scopeMap.get(key);
if (value == null) {
/*
* no cache instance present, so we use the one we get from the unscoped provider and
* add it to the cache
*/
value = unscoped.get();
scopeMap.put(key, value);
}
return value;
} | [
"protected",
"<",
"T",
">",
"T",
"getScopedObject",
"(",
"final",
"Key",
"<",
"T",
">",
"key",
",",
"final",
"Provider",
"<",
"T",
">",
"unscoped",
",",
"final",
"Map",
"<",
"Key",
"<",
"?",
">",
",",
"Object",
">",
"scopeMap",
")",
"{",
"// ok, be... | If already present, gets the object for the specified key from the scope map. Otherwise it is
retrieved from the unscoped provider and stored in the scope map.
@param key
the key
@param unscoped
the unscoped provider for creating the object
@param scopeMap
the scope map
@return the correctly scoped object | [
"If",
"already",
"present",
"gets",
"the",
"object",
"for",
"the",
"specified",
"key",
"from",
"the",
"scope",
"map",
".",
"Otherwise",
"it",
"is",
"retrieved",
"from",
"the",
"unscoped",
"provider",
"and",
"stored",
"in",
"the",
"scope",
"map",
"."
] | 5b9fecac5778b988bb458085ded39ea9a4c7c2ae | https://github.com/mgm-tp/jfunk/blob/5b9fecac5778b988bb458085ded39ea9a4c7c2ae/jfunk-common/src/main/java/com/mgmtp/jfunk/common/config/BaseScope.java#L67-L80 | train |
Mozu/mozu-java | mozu-java-core/src/main/java/com/mozu/api/urls/commerce/customer/CustomerAuthTicketUrl.java | CustomerAuthTicketUrl.refreshUserAuthTicketUrl | public static MozuUrl refreshUserAuthTicketUrl(String refreshToken, String responseFields)
{
UrlFormatter formatter = new UrlFormatter("/api/commerce/customer/authtickets/refresh?refreshToken={refreshToken}&responseFields={responseFields}");
formatter.formatUrl("refreshToken", refreshToken);
formatter.formatUrl("responseFields", responseFields);
return new MozuUrl(formatter.getResourceUrl(), MozuUrl.UrlLocation.TENANT_POD) ;
} | java | public static MozuUrl refreshUserAuthTicketUrl(String refreshToken, String responseFields)
{
UrlFormatter formatter = new UrlFormatter("/api/commerce/customer/authtickets/refresh?refreshToken={refreshToken}&responseFields={responseFields}");
formatter.formatUrl("refreshToken", refreshToken);
formatter.formatUrl("responseFields", responseFields);
return new MozuUrl(formatter.getResourceUrl(), MozuUrl.UrlLocation.TENANT_POD) ;
} | [
"public",
"static",
"MozuUrl",
"refreshUserAuthTicketUrl",
"(",
"String",
"refreshToken",
",",
"String",
"responseFields",
")",
"{",
"UrlFormatter",
"formatter",
"=",
"new",
"UrlFormatter",
"(",
"\"/api/commerce/customer/authtickets/refresh?refreshToken={refreshToken}&responseFie... | Get Resource Url for RefreshUserAuthTicket
@param refreshToken Alphanumeric string used for access tokens. This token refreshes access for accounts by generating a new developer or application account authentication ticket after an access token expires.
@param responseFields Filtering syntax appended to an API call to increase or decrease the amount of data returned inside a JSON object. This parameter should only be used to retrieve data. Attempting to update data using this parameter may cause data loss.
@return String Resource Url | [
"Get",
"Resource",
"Url",
"for",
"RefreshUserAuthTicket"
] | 5beadde73601a859f845e3e2fc1077b39c8bea83 | https://github.com/Mozu/mozu-java/blob/5beadde73601a859f845e3e2fc1077b39c8bea83/mozu-java-core/src/main/java/com/mozu/api/urls/commerce/customer/CustomerAuthTicketUrl.java#L46-L52 | train |
Mozu/mozu-java | mozu-java-core/src/main/java/com/mozu/api/urls/platform/adminuser/TenantAdminUserAuthTicketUrl.java | TenantAdminUserAuthTicketUrl.createUserAuthTicketUrl | public static MozuUrl createUserAuthTicketUrl(String responseFields, Integer tenantId)
{
UrlFormatter formatter = new UrlFormatter("/api/platform/adminuser/authtickets/tenants?tenantId={tenantId}&responseFields={responseFields}");
formatter.formatUrl("responseFields", responseFields);
formatter.formatUrl("tenantId", tenantId);
return new MozuUrl(formatter.getResourceUrl(), MozuUrl.UrlLocation.HOME_POD) ;
} | java | public static MozuUrl createUserAuthTicketUrl(String responseFields, Integer tenantId)
{
UrlFormatter formatter = new UrlFormatter("/api/platform/adminuser/authtickets/tenants?tenantId={tenantId}&responseFields={responseFields}");
formatter.formatUrl("responseFields", responseFields);
formatter.formatUrl("tenantId", tenantId);
return new MozuUrl(formatter.getResourceUrl(), MozuUrl.UrlLocation.HOME_POD) ;
} | [
"public",
"static",
"MozuUrl",
"createUserAuthTicketUrl",
"(",
"String",
"responseFields",
",",
"Integer",
"tenantId",
")",
"{",
"UrlFormatter",
"formatter",
"=",
"new",
"UrlFormatter",
"(",
"\"/api/platform/adminuser/authtickets/tenants?tenantId={tenantId}&responseFields={respon... | Get Resource Url for CreateUserAuthTicket
@param responseFields Filtering syntax appended to an API call to increase or decrease the amount of data returned inside a JSON object. This parameter should only be used to retrieve data. Attempting to update data using this parameter may cause data loss.
@param tenantId Unique identifier of the development or production tenant for which to generate the user authentication ticket.
@return String Resource Url | [
"Get",
"Resource",
"Url",
"for",
"CreateUserAuthTicket"
] | 5beadde73601a859f845e3e2fc1077b39c8bea83 | https://github.com/Mozu/mozu-java/blob/5beadde73601a859f845e3e2fc1077b39c8bea83/mozu-java-core/src/main/java/com/mozu/api/urls/platform/adminuser/TenantAdminUserAuthTicketUrl.java#L22-L28 | train |
Mozu/mozu-java | mozu-java-core/src/main/java/com/mozu/api/urls/platform/adminuser/TenantAdminUserAuthTicketUrl.java | TenantAdminUserAuthTicketUrl.deleteUserAuthTicketUrl | public static MozuUrl deleteUserAuthTicketUrl(String refreshToken)
{
UrlFormatter formatter = new UrlFormatter("/api/platform/adminuser/authtickets/?refreshToken={refreshToken}");
formatter.formatUrl("refreshToken", refreshToken);
return new MozuUrl(formatter.getResourceUrl(), MozuUrl.UrlLocation.HOME_POD) ;
} | java | public static MozuUrl deleteUserAuthTicketUrl(String refreshToken)
{
UrlFormatter formatter = new UrlFormatter("/api/platform/adminuser/authtickets/?refreshToken={refreshToken}");
formatter.formatUrl("refreshToken", refreshToken);
return new MozuUrl(formatter.getResourceUrl(), MozuUrl.UrlLocation.HOME_POD) ;
} | [
"public",
"static",
"MozuUrl",
"deleteUserAuthTicketUrl",
"(",
"String",
"refreshToken",
")",
"{",
"UrlFormatter",
"formatter",
"=",
"new",
"UrlFormatter",
"(",
"\"/api/platform/adminuser/authtickets/?refreshToken={refreshToken}\"",
")",
";",
"formatter",
".",
"formatUrl",
... | Get Resource Url for DeleteUserAuthTicket
@param refreshToken Alphanumeric string used for access tokens. This token refreshes access for accounts by generating a new developer or application account authentication ticket after an access token expires.
@return String Resource Url | [
"Get",
"Resource",
"Url",
"for",
"DeleteUserAuthTicket"
] | 5beadde73601a859f845e3e2fc1077b39c8bea83 | https://github.com/Mozu/mozu-java/blob/5beadde73601a859f845e3e2fc1077b39c8bea83/mozu-java-core/src/main/java/com/mozu/api/urls/platform/adminuser/TenantAdminUserAuthTicketUrl.java#L49-L54 | train |
nmdp-bioinformatics/ngs | align/src/main/java/org/nmdp/ngs/align/BedReader.java | BedReader.read | public static Iterable<BedRecord> read(final Readable readable) throws IOException {
checkNotNull(readable);
Collect collect = new Collect();
stream(readable, collect);
return collect.records();
} | java | public static Iterable<BedRecord> read(final Readable readable) throws IOException {
checkNotNull(readable);
Collect collect = new Collect();
stream(readable, collect);
return collect.records();
} | [
"public",
"static",
"Iterable",
"<",
"BedRecord",
">",
"read",
"(",
"final",
"Readable",
"readable",
")",
"throws",
"IOException",
"{",
"checkNotNull",
"(",
"readable",
")",
";",
"Collect",
"collect",
"=",
"new",
"Collect",
"(",
")",
";",
"stream",
"(",
"r... | Read zero or more BED records from the specified readable.
@param readable to read from, must not be null
@return zero or more BED records read from the specified readable
@throws IOException if an I/O error occurs | [
"Read",
"zero",
"or",
"more",
"BED",
"records",
"from",
"the",
"specified",
"readable",
"."
] | 277627e4311313a80f5dc110b3185b0d7af32bd0 | https://github.com/nmdp-bioinformatics/ngs/blob/277627e4311313a80f5dc110b3185b0d7af32bd0/align/src/main/java/org/nmdp/ngs/align/BedReader.java#L55-L60 | train |
nmdp-bioinformatics/ngs | align/src/main/java/org/nmdp/ngs/align/BedReader.java | BedReader.stream | public static void stream(final Readable readable, final BedListener listener) throws IOException {
checkNotNull(readable);
checkNotNull(listener);
BedLineProcessor lineProcessor = new BedLineProcessor(listener);
CharStreams.readLines(readable, lineProcessor);
} | java | public static void stream(final Readable readable, final BedListener listener) throws IOException {
checkNotNull(readable);
checkNotNull(listener);
BedLineProcessor lineProcessor = new BedLineProcessor(listener);
CharStreams.readLines(readable, lineProcessor);
} | [
"public",
"static",
"void",
"stream",
"(",
"final",
"Readable",
"readable",
",",
"final",
"BedListener",
"listener",
")",
"throws",
"IOException",
"{",
"checkNotNull",
"(",
"readable",
")",
";",
"checkNotNull",
"(",
"listener",
")",
";",
"BedLineProcessor",
"lin... | Stream zero or more BED records from the specified readable.
@param readable readable to stream from, must not be null
@param listener event based listener callback, must not be null
@throws IOException if an I/O error occurs | [
"Stream",
"zero",
"or",
"more",
"BED",
"records",
"from",
"the",
"specified",
"readable",
"."
] | 277627e4311313a80f5dc110b3185b0d7af32bd0 | https://github.com/nmdp-bioinformatics/ngs/blob/277627e4311313a80f5dc110b3185b0d7af32bd0/align/src/main/java/org/nmdp/ngs/align/BedReader.java#L69-L75 | train |
mgm-tp/jfunk | jfunk-common/src/main/java/com/mgmtp/jfunk/common/util/ExtendedFile.java | ExtendedFile.copy | public void copy(final File source) throws IOException {
if (!source.exists()) {
LOG.warn("File " + source + " cannot be copied as it does not exist");
return;
}
if (equals(source)) {
LOG.info("Skipping copying of " + source + " as it matches the target");
return;
}
File target = isDirectory() ? new File(this, source.getName()) : this;
FileUtils.copyFile(source, target);
} | java | public void copy(final File source) throws IOException {
if (!source.exists()) {
LOG.warn("File " + source + " cannot be copied as it does not exist");
return;
}
if (equals(source)) {
LOG.info("Skipping copying of " + source + " as it matches the target");
return;
}
File target = isDirectory() ? new File(this, source.getName()) : this;
FileUtils.copyFile(source, target);
} | [
"public",
"void",
"copy",
"(",
"final",
"File",
"source",
")",
"throws",
"IOException",
"{",
"if",
"(",
"!",
"source",
".",
"exists",
"(",
")",
")",
"{",
"LOG",
".",
"warn",
"(",
"\"File \"",
"+",
"source",
"+",
"\" cannot be copied as it does not exist\"",
... | Copies the specified file. If this object is a directory the file will be copied to this
directory. If this object represents a file it will be overwritten with the specified file. | [
"Copies",
"the",
"specified",
"file",
".",
"If",
"this",
"object",
"is",
"a",
"directory",
"the",
"file",
"will",
"be",
"copied",
"to",
"this",
"directory",
".",
"If",
"this",
"object",
"represents",
"a",
"file",
"it",
"will",
"be",
"overwritten",
"with",
... | 5b9fecac5778b988bb458085ded39ea9a4c7c2ae | https://github.com/mgm-tp/jfunk/blob/5b9fecac5778b988bb458085ded39ea9a4c7c2ae/jfunk-common/src/main/java/com/mgmtp/jfunk/common/util/ExtendedFile.java#L101-L112 | train |
mgm-tp/jfunk | jfunk-common/src/main/java/com/mgmtp/jfunk/common/util/ExtendedFile.java | ExtendedFile.zip | public void zip(final File zipFile) throws IOException {
File[] files = listFiles();
if (files.length == 0) {
return;
}
LOG.info("Creating zip file " + zipFile + " from directory " + this);
ZipOutputStream zipOut = null;
try {
zipOut = new ZipOutputStream(new FileOutputStream(zipFile));
for (File file : files) {
zip("", file, zipOut);
}
} finally {
IOUtils.closeQuietly(zipOut);
}
} | java | public void zip(final File zipFile) throws IOException {
File[] files = listFiles();
if (files.length == 0) {
return;
}
LOG.info("Creating zip file " + zipFile + " from directory " + this);
ZipOutputStream zipOut = null;
try {
zipOut = new ZipOutputStream(new FileOutputStream(zipFile));
for (File file : files) {
zip("", file, zipOut);
}
} finally {
IOUtils.closeQuietly(zipOut);
}
} | [
"public",
"void",
"zip",
"(",
"final",
"File",
"zipFile",
")",
"throws",
"IOException",
"{",
"File",
"[",
"]",
"files",
"=",
"listFiles",
"(",
")",
";",
"if",
"(",
"files",
".",
"length",
"==",
"0",
")",
"{",
"return",
";",
"}",
"LOG",
".",
"info",... | Zips all included objects into the specified file.
@param zipFile
the zip file to be created | [
"Zips",
"all",
"included",
"objects",
"into",
"the",
"specified",
"file",
"."
] | 5b9fecac5778b988bb458085ded39ea9a4c7c2ae | https://github.com/mgm-tp/jfunk/blob/5b9fecac5778b988bb458085ded39ea9a4c7c2ae/jfunk-common/src/main/java/com/mgmtp/jfunk/common/util/ExtendedFile.java#L135-L150 | train |
mgm-tp/jfunk | jfunk-core/src/main/java/com/mgmtp/jfunk/core/config/ModulesLoader.java | ModulesLoader.loadModulesFromProperties | public static Module loadModulesFromProperties(final Module jFunkModule, final String propertiesFile)
throws ClassNotFoundException, InstantiationException, IllegalAccessException, IOException {
final List<Module> modules = Lists.newArrayList();
LOG.debug("Using jfunk.props.file=" + propertiesFile);
Properties props = loadProperties(propertiesFile);
for (final Enumeration<?> en = props.propertyNames(); en.hasMoreElements();) {
String name = (String) en.nextElement();
if (name.startsWith("module.")) {
String className = props.getProperty(name);
LOG.info("Loading " + name + "=" + className);
Class<? extends Module> moduleClass = Class.forName(className).asSubclass(Module.class);
Module module = moduleClass.newInstance();
modules.add(module);
}
}
return Modules.override(jFunkModule).with(modules);
} | java | public static Module loadModulesFromProperties(final Module jFunkModule, final String propertiesFile)
throws ClassNotFoundException, InstantiationException, IllegalAccessException, IOException {
final List<Module> modules = Lists.newArrayList();
LOG.debug("Using jfunk.props.file=" + propertiesFile);
Properties props = loadProperties(propertiesFile);
for (final Enumeration<?> en = props.propertyNames(); en.hasMoreElements();) {
String name = (String) en.nextElement();
if (name.startsWith("module.")) {
String className = props.getProperty(name);
LOG.info("Loading " + name + "=" + className);
Class<? extends Module> moduleClass = Class.forName(className).asSubclass(Module.class);
Module module = moduleClass.newInstance();
modules.add(module);
}
}
return Modules.override(jFunkModule).with(modules);
} | [
"public",
"static",
"Module",
"loadModulesFromProperties",
"(",
"final",
"Module",
"jFunkModule",
",",
"final",
"String",
"propertiesFile",
")",
"throws",
"ClassNotFoundException",
",",
"InstantiationException",
",",
"IllegalAccessException",
",",
"IOException",
"{",
"fin... | Loads Guice modules whose class names are specified as properties. All properties starting
with "module." are considered to have a fully qualified class name representing a Guice
module. The modules are combined and override thespecified jFunkModule.
@param propertiesFile
The properties file
@return the combined module | [
"Loads",
"Guice",
"modules",
"whose",
"class",
"names",
"are",
"specified",
"as",
"properties",
".",
"All",
"properties",
"starting",
"with",
"module",
".",
"are",
"considered",
"to",
"have",
"a",
"fully",
"qualified",
"class",
"name",
"representing",
"a",
"Gu... | 5b9fecac5778b988bb458085ded39ea9a4c7c2ae | https://github.com/mgm-tp/jfunk/blob/5b9fecac5778b988bb458085ded39ea9a4c7c2ae/jfunk-core/src/main/java/com/mgmtp/jfunk/core/config/ModulesLoader.java#L60-L78 | train |
mgm-tp/jfunk | jfunk-common/src/main/java/com/mgmtp/jfunk/common/util/Range.java | Range.merge | public Range merge(final Range otherRange) {
int newMin = Math.min(otherRange.min, min);
int newMax = Math.max(otherRange.max, max);
return new Range(newMin, newMax);
} | java | public Range merge(final Range otherRange) {
int newMin = Math.min(otherRange.min, min);
int newMax = Math.max(otherRange.max, max);
return new Range(newMin, newMax);
} | [
"public",
"Range",
"merge",
"(",
"final",
"Range",
"otherRange",
")",
"{",
"int",
"newMin",
"=",
"Math",
".",
"min",
"(",
"otherRange",
".",
"min",
",",
"min",
")",
";",
"int",
"newMax",
"=",
"Math",
".",
"max",
"(",
"otherRange",
".",
"max",
",",
... | Merges this range with the passed range. Returns a range object whose min and max values
match the minimum or maximum of the two values, respectively. So the range returned contains
this and the passed range in any case.
@return a range object with [min(this.min,other.min), max(this.max, other.max)] | [
"Merges",
"this",
"range",
"with",
"the",
"passed",
"range",
".",
"Returns",
"a",
"range",
"object",
"whose",
"min",
"and",
"max",
"values",
"match",
"the",
"minimum",
"or",
"maximum",
"of",
"the",
"two",
"values",
"respectively",
".",
"So",
"the",
"range"... | 5b9fecac5778b988bb458085ded39ea9a4c7c2ae | https://github.com/mgm-tp/jfunk/blob/5b9fecac5778b988bb458085ded39ea9a4c7c2ae/jfunk-common/src/main/java/com/mgmtp/jfunk/common/util/Range.java#L57-L61 | train |
mgm-tp/jfunk | jfunk-common/src/main/java/com/mgmtp/jfunk/common/util/Range.java | Range.sumBoundaries | public Range sumBoundaries(final Range plus) {
int newMin = min + plus.min;
int newMax = max == RANGE_MAX || plus.max == RANGE_MAX ? RANGE_MAX : max + plus.max;
return new Range(newMin, newMax);
} | java | public Range sumBoundaries(final Range plus) {
int newMin = min + plus.min;
int newMax = max == RANGE_MAX || plus.max == RANGE_MAX ? RANGE_MAX : max + plus.max;
return new Range(newMin, newMax);
} | [
"public",
"Range",
"sumBoundaries",
"(",
"final",
"Range",
"plus",
")",
"{",
"int",
"newMin",
"=",
"min",
"+",
"plus",
".",
"min",
";",
"int",
"newMax",
"=",
"max",
"==",
"RANGE_MAX",
"||",
"plus",
".",
"max",
"==",
"RANGE_MAX",
"?",
"RANGE_MAX",
":",
... | Sums the boundaries of this range with the ones of the passed. So the returned range has
this.min + plus.min as minimum and this.max + plus.max as maximum respectively.
@return a range object whose boundaries are summed | [
"Sums",
"the",
"boundaries",
"of",
"this",
"range",
"with",
"the",
"ones",
"of",
"the",
"passed",
".",
"So",
"the",
"returned",
"range",
"has",
"this",
".",
"min",
"+",
"plus",
".",
"min",
"as",
"minimum",
"and",
"this",
".",
"max",
"+",
"plus",
".",... | 5b9fecac5778b988bb458085ded39ea9a4c7c2ae | https://github.com/mgm-tp/jfunk/blob/5b9fecac5778b988bb458085ded39ea9a4c7c2ae/jfunk-common/src/main/java/com/mgmtp/jfunk/common/util/Range.java#L69-L73 | train |
mgm-tp/jfunk | jfunk-common/src/main/java/com/mgmtp/jfunk/common/util/Range.java | Range.intersect | public Range intersect(final Range outerRange) throws RangeException {
if (min > outerRange.max) {
throw new IllegalArgumentException("range maximum must be greater or equal than " + min);
}
if (max < outerRange.min) {
throw new IllegalArgumentException("range minimum must be less or equal than " + max);
}
int newMin = Math.max(min, outerRange.min);
int newMax = Math.min(max, outerRange.max);
return new Range(newMin, newMax);
} | java | public Range intersect(final Range outerRange) throws RangeException {
if (min > outerRange.max) {
throw new IllegalArgumentException("range maximum must be greater or equal than " + min);
}
if (max < outerRange.min) {
throw new IllegalArgumentException("range minimum must be less or equal than " + max);
}
int newMin = Math.max(min, outerRange.min);
int newMax = Math.min(max, outerRange.max);
return new Range(newMin, newMax);
} | [
"public",
"Range",
"intersect",
"(",
"final",
"Range",
"outerRange",
")",
"throws",
"RangeException",
"{",
"if",
"(",
"min",
">",
"outerRange",
".",
"max",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"range maximum must be greater or equal than \"",
... | Intersects this range with the one passed. This means that the returned rand contains the
maximum of both minima as minimum and the minimum of the two maxima as maximum.
@throws RangeException
if the given range has not intersection with this range | [
"Intersects",
"this",
"range",
"with",
"the",
"one",
"passed",
".",
"This",
"means",
"that",
"the",
"returned",
"rand",
"contains",
"the",
"maximum",
"of",
"both",
"minima",
"as",
"minimum",
"and",
"the",
"minimum",
"of",
"the",
"two",
"maxima",
"as",
"max... | 5b9fecac5778b988bb458085ded39ea9a4c7c2ae | https://github.com/mgm-tp/jfunk/blob/5b9fecac5778b988bb458085ded39ea9a4c7c2ae/jfunk-common/src/main/java/com/mgmtp/jfunk/common/util/Range.java#L82-L92 | train |
mgm-tp/jfunk | jfunk-common/src/main/java/com/mgmtp/jfunk/common/util/Range.java | Range.listValues | public List<Integer> listValues() {
ArrayList<Integer> list = new ArrayList<Integer>(getRange());
for (int i = getMin(); i <= getMax(); i++) {
list.add(i);
}
return list;
} | java | public List<Integer> listValues() {
ArrayList<Integer> list = new ArrayList<Integer>(getRange());
for (int i = getMin(); i <= getMax(); i++) {
list.add(i);
}
return list;
} | [
"public",
"List",
"<",
"Integer",
">",
"listValues",
"(",
")",
"{",
"ArrayList",
"<",
"Integer",
">",
"list",
"=",
"new",
"ArrayList",
"<",
"Integer",
">",
"(",
"getRange",
"(",
")",
")",
";",
"for",
"(",
"int",
"i",
"=",
"getMin",
"(",
")",
";",
... | Returns a list of all allowed values within the range
@return a list of all allowed values within the range | [
"Returns",
"a",
"list",
"of",
"all",
"allowed",
"values",
"within",
"the",
"range"
] | 5b9fecac5778b988bb458085ded39ea9a4c7c2ae | https://github.com/mgm-tp/jfunk/blob/5b9fecac5778b988bb458085ded39ea9a4c7c2ae/jfunk-common/src/main/java/com/mgmtp/jfunk/common/util/Range.java#L141-L147 | train |
Mozu/mozu-java | mozu-java-core/src/main/java/com/mozu/api/urls/commerce/carts/CartItemUrl.java | CartItemUrl.getCartItemUrl | public static MozuUrl getCartItemUrl(String cartItemId, String responseFields)
{
UrlFormatter formatter = new UrlFormatter("/api/commerce/carts/current/items/{cartItemId}?responseFields={responseFields}");
formatter.formatUrl("cartItemId", cartItemId);
formatter.formatUrl("responseFields", responseFields);
return new MozuUrl(formatter.getResourceUrl(), MozuUrl.UrlLocation.TENANT_POD) ;
} | java | public static MozuUrl getCartItemUrl(String cartItemId, String responseFields)
{
UrlFormatter formatter = new UrlFormatter("/api/commerce/carts/current/items/{cartItemId}?responseFields={responseFields}");
formatter.formatUrl("cartItemId", cartItemId);
formatter.formatUrl("responseFields", responseFields);
return new MozuUrl(formatter.getResourceUrl(), MozuUrl.UrlLocation.TENANT_POD) ;
} | [
"public",
"static",
"MozuUrl",
"getCartItemUrl",
"(",
"String",
"cartItemId",
",",
"String",
"responseFields",
")",
"{",
"UrlFormatter",
"formatter",
"=",
"new",
"UrlFormatter",
"(",
"\"/api/commerce/carts/current/items/{cartItemId}?responseFields={responseFields}\"",
")",
";... | Get Resource Url for GetCartItem
@param cartItemId Identifier of the cart item to delete.
@param responseFields Filtering syntax appended to an API call to increase or decrease the amount of data returned inside a JSON object. This parameter should only be used to retrieve data. Attempting to update data using this parameter may cause data loss.
@return String Resource Url | [
"Get",
"Resource",
"Url",
"for",
"GetCartItem"
] | 5beadde73601a859f845e3e2fc1077b39c8bea83 | https://github.com/Mozu/mozu-java/blob/5beadde73601a859f845e3e2fc1077b39c8bea83/mozu-java-core/src/main/java/com/mozu/api/urls/commerce/carts/CartItemUrl.java#L22-L28 | train |
Mozu/mozu-java | mozu-java-core/src/main/java/com/mozu/api/urls/commerce/carts/CartItemUrl.java | CartItemUrl.addItemsToCartUrl | public static MozuUrl addItemsToCartUrl(Boolean throwErrorOnInvalidItems)
{
UrlFormatter formatter = new UrlFormatter("/api/commerce/carts/current/bulkitems?throwErrorOnInvalidItems={throwErrorOnInvalidItems}");
formatter.formatUrl("throwErrorOnInvalidItems", throwErrorOnInvalidItems);
return new MozuUrl(formatter.getResourceUrl(), MozuUrl.UrlLocation.TENANT_POD) ;
} | java | public static MozuUrl addItemsToCartUrl(Boolean throwErrorOnInvalidItems)
{
UrlFormatter formatter = new UrlFormatter("/api/commerce/carts/current/bulkitems?throwErrorOnInvalidItems={throwErrorOnInvalidItems}");
formatter.formatUrl("throwErrorOnInvalidItems", throwErrorOnInvalidItems);
return new MozuUrl(formatter.getResourceUrl(), MozuUrl.UrlLocation.TENANT_POD) ;
} | [
"public",
"static",
"MozuUrl",
"addItemsToCartUrl",
"(",
"Boolean",
"throwErrorOnInvalidItems",
")",
"{",
"UrlFormatter",
"formatter",
"=",
"new",
"UrlFormatter",
"(",
"\"/api/commerce/carts/current/bulkitems?throwErrorOnInvalidItems={throwErrorOnInvalidItems}\"",
")",
";",
"form... | Get Resource Url for AddItemsToCart
@param throwErrorOnInvalidItems
@return String Resource Url | [
"Get",
"Resource",
"Url",
"for",
"AddItemsToCart"
] | 5beadde73601a859f845e3e2fc1077b39c8bea83 | https://github.com/Mozu/mozu-java/blob/5beadde73601a859f845e3e2fc1077b39c8bea83/mozu-java-core/src/main/java/com/mozu/api/urls/commerce/carts/CartItemUrl.java#L47-L52 | train |
Mozu/mozu-java | mozu-java-core/src/main/java/com/mozu/api/urls/commerce/carts/CartItemUrl.java | CartItemUrl.updateCartItemQuantityUrl | public static MozuUrl updateCartItemQuantityUrl(String cartItemId, Integer quantity, String responseFields)
{
UrlFormatter formatter = new UrlFormatter("/api/commerce/carts/current/items/{cartItemId}/{quantity}?responseFields={responseFields}");
formatter.formatUrl("cartItemId", cartItemId);
formatter.formatUrl("quantity", quantity);
formatter.formatUrl("responseFields", responseFields);
return new MozuUrl(formatter.getResourceUrl(), MozuUrl.UrlLocation.TENANT_POD) ;
} | java | public static MozuUrl updateCartItemQuantityUrl(String cartItemId, Integer quantity, String responseFields)
{
UrlFormatter formatter = new UrlFormatter("/api/commerce/carts/current/items/{cartItemId}/{quantity}?responseFields={responseFields}");
formatter.formatUrl("cartItemId", cartItemId);
formatter.formatUrl("quantity", quantity);
formatter.formatUrl("responseFields", responseFields);
return new MozuUrl(formatter.getResourceUrl(), MozuUrl.UrlLocation.TENANT_POD) ;
} | [
"public",
"static",
"MozuUrl",
"updateCartItemQuantityUrl",
"(",
"String",
"cartItemId",
",",
"Integer",
"quantity",
",",
"String",
"responseFields",
")",
"{",
"UrlFormatter",
"formatter",
"=",
"new",
"UrlFormatter",
"(",
"\"/api/commerce/carts/current/items/{cartItemId}/{q... | Get Resource Url for UpdateCartItemQuantity
@param cartItemId Identifier of the cart item to delete.
@param quantity The number of cart items in the shopper's active cart.
@param responseFields Filtering syntax appended to an API call to increase or decrease the amount of data returned inside a JSON object. This parameter should only be used to retrieve data. Attempting to update data using this parameter may cause data loss.
@return String Resource Url | [
"Get",
"Resource",
"Url",
"for",
"UpdateCartItemQuantity"
] | 5beadde73601a859f845e3e2fc1077b39c8bea83 | https://github.com/Mozu/mozu-java/blob/5beadde73601a859f845e3e2fc1077b39c8bea83/mozu-java-core/src/main/java/com/mozu/api/urls/commerce/carts/CartItemUrl.java#L73-L80 | train |
Mozu/mozu-java | mozu-java-core/src/main/java/com/mozu/api/urls/commerce/carts/CartItemUrl.java | CartItemUrl.removeAllCartItemsUrl | public static MozuUrl removeAllCartItemsUrl()
{
UrlFormatter formatter = new UrlFormatter("/api/commerce/carts/current/items");
return new MozuUrl(formatter.getResourceUrl(), MozuUrl.UrlLocation.TENANT_POD) ;
} | java | public static MozuUrl removeAllCartItemsUrl()
{
UrlFormatter formatter = new UrlFormatter("/api/commerce/carts/current/items");
return new MozuUrl(formatter.getResourceUrl(), MozuUrl.UrlLocation.TENANT_POD) ;
} | [
"public",
"static",
"MozuUrl",
"removeAllCartItemsUrl",
"(",
")",
"{",
"UrlFormatter",
"formatter",
"=",
"new",
"UrlFormatter",
"(",
"\"/api/commerce/carts/current/items\"",
")",
";",
"return",
"new",
"MozuUrl",
"(",
"formatter",
".",
"getResourceUrl",
"(",
")",
","... | Get Resource Url for RemoveAllCartItems
@return String Resource Url | [
"Get",
"Resource",
"Url",
"for",
"RemoveAllCartItems"
] | 5beadde73601a859f845e3e2fc1077b39c8bea83 | https://github.com/Mozu/mozu-java/blob/5beadde73601a859f845e3e2fc1077b39c8bea83/mozu-java-core/src/main/java/com/mozu/api/urls/commerce/carts/CartItemUrl.java#L100-L104 | train |
Mozu/mozu-java | mozu-java-core/src/main/java/com/mozu/api/urls/commerce/carts/CartItemUrl.java | CartItemUrl.deleteCartItemUrl | public static MozuUrl deleteCartItemUrl(String cartItemId)
{
UrlFormatter formatter = new UrlFormatter("/api/commerce/carts/current/items/{cartItemId}");
formatter.formatUrl("cartItemId", cartItemId);
return new MozuUrl(formatter.getResourceUrl(), MozuUrl.UrlLocation.TENANT_POD) ;
} | java | public static MozuUrl deleteCartItemUrl(String cartItemId)
{
UrlFormatter formatter = new UrlFormatter("/api/commerce/carts/current/items/{cartItemId}");
formatter.formatUrl("cartItemId", cartItemId);
return new MozuUrl(formatter.getResourceUrl(), MozuUrl.UrlLocation.TENANT_POD) ;
} | [
"public",
"static",
"MozuUrl",
"deleteCartItemUrl",
"(",
"String",
"cartItemId",
")",
"{",
"UrlFormatter",
"formatter",
"=",
"new",
"UrlFormatter",
"(",
"\"/api/commerce/carts/current/items/{cartItemId}\"",
")",
";",
"formatter",
".",
"formatUrl",
"(",
"\"cartItemId\"",
... | Get Resource Url for DeleteCartItem
@param cartItemId Identifier of the cart item to delete.
@return String Resource Url | [
"Get",
"Resource",
"Url",
"for",
"DeleteCartItem"
] | 5beadde73601a859f845e3e2fc1077b39c8bea83 | https://github.com/Mozu/mozu-java/blob/5beadde73601a859f845e3e2fc1077b39c8bea83/mozu-java-core/src/main/java/com/mozu/api/urls/commerce/carts/CartItemUrl.java#L111-L116 | train |
Mozu/mozu-java | mozu-java-core/src/main/java/com/mozu/api/urls/commerce/CheckoutUrl.java | CheckoutUrl.processDigitalWalletUrl | public static MozuUrl processDigitalWalletUrl(String checkoutId, String digitalWalletType, String responseFields)
{
UrlFormatter formatter = new UrlFormatter("/api/commerce/checkouts/{checkoutId}/digitalWallet/{digitalWalletType}?responseFields={responseFields}");
formatter.formatUrl("checkoutId", checkoutId);
formatter.formatUrl("digitalWalletType", digitalWalletType);
formatter.formatUrl("responseFields", responseFields);
return new MozuUrl(formatter.getResourceUrl(), MozuUrl.UrlLocation.TENANT_POD) ;
} | java | public static MozuUrl processDigitalWalletUrl(String checkoutId, String digitalWalletType, String responseFields)
{
UrlFormatter formatter = new UrlFormatter("/api/commerce/checkouts/{checkoutId}/digitalWallet/{digitalWalletType}?responseFields={responseFields}");
formatter.formatUrl("checkoutId", checkoutId);
formatter.formatUrl("digitalWalletType", digitalWalletType);
formatter.formatUrl("responseFields", responseFields);
return new MozuUrl(formatter.getResourceUrl(), MozuUrl.UrlLocation.TENANT_POD) ;
} | [
"public",
"static",
"MozuUrl",
"processDigitalWalletUrl",
"(",
"String",
"checkoutId",
",",
"String",
"digitalWalletType",
",",
"String",
"responseFields",
")",
"{",
"UrlFormatter",
"formatter",
"=",
"new",
"UrlFormatter",
"(",
"\"/api/commerce/checkouts/{checkoutId}/digita... | Get Resource Url for ProcessDigitalWallet
@param checkoutId The unique identifier of the checkout.
@param digitalWalletType The type of digital wallet.
@param responseFields Filtering syntax appended to an API call to increase or decrease the amount of data returned inside a JSON object. This parameter should only be used to retrieve data. Attempting to update data using this parameter may cause data loss.
@return String Resource Url | [
"Get",
"Resource",
"Url",
"for",
"ProcessDigitalWallet"
] | 5beadde73601a859f845e3e2fc1077b39c8bea83 | https://github.com/Mozu/mozu-java/blob/5beadde73601a859f845e3e2fc1077b39c8bea83/mozu-java-core/src/main/java/com/mozu/api/urls/commerce/CheckoutUrl.java#L153-L160 | train |
nmdp-bioinformatics/ngs | variant/src/main/java/org/nmdp/ngs/variant/vcf/VcfHeaderParser.java | VcfHeaderParser.header | public static VcfHeader header(final Readable readable) throws IOException {
checkNotNull(readable);
ParseListener parseListener = new ParseListener();
VcfParser.parse(readable, parseListener);
return parseListener.getHeader();
} | java | public static VcfHeader header(final Readable readable) throws IOException {
checkNotNull(readable);
ParseListener parseListener = new ParseListener();
VcfParser.parse(readable, parseListener);
return parseListener.getHeader();
} | [
"public",
"static",
"VcfHeader",
"header",
"(",
"final",
"Readable",
"readable",
")",
"throws",
"IOException",
"{",
"checkNotNull",
"(",
"readable",
")",
";",
"ParseListener",
"parseListener",
"=",
"new",
"ParseListener",
"(",
")",
";",
"VcfParser",
".",
"parse"... | Read the VCF header from the specified readable.
@param readable readable to read from, must not be null
@return the VCF header read from the specified readable
@throws IOException if an I/O error occurs | [
"Read",
"the",
"VCF",
"header",
"from",
"the",
"specified",
"readable",
"."
] | 277627e4311313a80f5dc110b3185b0d7af32bd0 | https://github.com/nmdp-bioinformatics/ngs/blob/277627e4311313a80f5dc110b3185b0d7af32bd0/variant/src/main/java/org/nmdp/ngs/variant/vcf/VcfHeaderParser.java#L52-L57 | train |
mgm-tp/jfunk | jfunk-data-generator/src/main/java/com/mgmtp/jfunk/data/generator/constraint/FieldContainer.java | FieldContainer.initValuesImpl | @Override
protected String initValuesImpl(final FieldCase ca) {
if (ca == FieldCase.NULL || ca == FieldCase.BLANK) {
return null;
}
return field.getString(control.getNext(ca));
} | java | @Override
protected String initValuesImpl(final FieldCase ca) {
if (ca == FieldCase.NULL || ca == FieldCase.BLANK) {
return null;
}
return field.getString(control.getNext(ca));
} | [
"@",
"Override",
"protected",
"String",
"initValuesImpl",
"(",
"final",
"FieldCase",
"ca",
")",
"{",
"if",
"(",
"ca",
"==",
"FieldCase",
".",
"NULL",
"||",
"ca",
"==",
"FieldCase",
".",
"BLANK",
")",
"{",
"return",
"null",
";",
"}",
"return",
"field",
... | Returns a string whose length and character type reflect the passed FieldCase using the
embedded field object. If FieldCase.NULL or FieldCase.BLANK is passed, the method returns
null.
@return the value just generated | [
"Returns",
"a",
"string",
"whose",
"length",
"and",
"character",
"type",
"reflect",
"the",
"passed",
"FieldCase",
"using",
"the",
"embedded",
"field",
"object",
".",
"If",
"FieldCase",
".",
"NULL",
"or",
"FieldCase",
".",
"BLANK",
"is",
"passed",
"the",
"met... | 5b9fecac5778b988bb458085ded39ea9a4c7c2ae | https://github.com/mgm-tp/jfunk/blob/5b9fecac5778b988bb458085ded39ea9a4c7c2ae/jfunk-data-generator/src/main/java/com/mgmtp/jfunk/data/generator/constraint/FieldContainer.java#L54-L60 | train |
Mozu/mozu-java | mozu-java-core/src/main/java/com/mozu/api/urls/commerce/TargetRuleUrl.java | TargetRuleUrl.validateTargetRuleUrl | public static MozuUrl validateTargetRuleUrl()
{
UrlFormatter formatter = new UrlFormatter("/api/commerce/targetrules/validate");
return new MozuUrl(formatter.getResourceUrl(), MozuUrl.UrlLocation.TENANT_POD) ;
} | java | public static MozuUrl validateTargetRuleUrl()
{
UrlFormatter formatter = new UrlFormatter("/api/commerce/targetrules/validate");
return new MozuUrl(formatter.getResourceUrl(), MozuUrl.UrlLocation.TENANT_POD) ;
} | [
"public",
"static",
"MozuUrl",
"validateTargetRuleUrl",
"(",
")",
"{",
"UrlFormatter",
"formatter",
"=",
"new",
"UrlFormatter",
"(",
"\"/api/commerce/targetrules/validate\"",
")",
";",
"return",
"new",
"MozuUrl",
"(",
"formatter",
".",
"getResourceUrl",
"(",
")",
",... | Get Resource Url for ValidateTargetRule
@return String Resource Url | [
"Get",
"Resource",
"Url",
"for",
"ValidateTargetRule"
] | 5beadde73601a859f845e3e2fc1077b39c8bea83 | https://github.com/Mozu/mozu-java/blob/5beadde73601a859f845e3e2fc1077b39c8bea83/mozu-java-core/src/main/java/com/mozu/api/urls/commerce/TargetRuleUrl.java#L66-L70 | train |
sualeh/pointlocation6709 | src/main/java/us/fatehi/pointlocation6709/format/PointLocationFormatter.java | PointLocationFormatter.formatLatitude | public static String formatLatitude(final Latitude latitude,
final PointLocationFormatType formatType)
throws FormatterException
{
if (latitude == null)
{
throw new FormatterException("No point location provided");
}
if (formatType == null)
{
throw new FormatterException("No format type provided");
}
final String formatted;
switch (formatType)
{
case HUMAN_LONG:
formatted = latitude.toString();
break;
case HUMAN_MEDIUM:
formatted = formatLatitudeHumanMedium(latitude);
break;
case LONG:
formatted = formatLatitudeLong(latitude);
break;
case MEDIUM:
formatted = formatLatitudeMedium(latitude);
break;
case SHORT:
formatted = formatLatitudeShort(latitude);
break;
case DECIMAL:
formatted = formatLatitudeWithDecimals(latitude);
break;
default:
throw new FormatterException("Unsupported format type");
}
return formatted;
} | java | public static String formatLatitude(final Latitude latitude,
final PointLocationFormatType formatType)
throws FormatterException
{
if (latitude == null)
{
throw new FormatterException("No point location provided");
}
if (formatType == null)
{
throw new FormatterException("No format type provided");
}
final String formatted;
switch (formatType)
{
case HUMAN_LONG:
formatted = latitude.toString();
break;
case HUMAN_MEDIUM:
formatted = formatLatitudeHumanMedium(latitude);
break;
case LONG:
formatted = formatLatitudeLong(latitude);
break;
case MEDIUM:
formatted = formatLatitudeMedium(latitude);
break;
case SHORT:
formatted = formatLatitudeShort(latitude);
break;
case DECIMAL:
formatted = formatLatitudeWithDecimals(latitude);
break;
default:
throw new FormatterException("Unsupported format type");
}
return formatted;
} | [
"public",
"static",
"String",
"formatLatitude",
"(",
"final",
"Latitude",
"latitude",
",",
"final",
"PointLocationFormatType",
"formatType",
")",
"throws",
"FormatterException",
"{",
"if",
"(",
"latitude",
"==",
"null",
")",
"{",
"throw",
"new",
"FormatterException"... | Formats a latitude as an ISO 6709 string.
@param latitude
Latitude to format
@param formatType
Format type
@return Formatted string
@throws FormatterException
On an exception | [
"Formats",
"a",
"latitude",
"as",
"an",
"ISO",
"6709",
"string",
"."
] | c0c186c2518f41e3fe174920cacd5c0d082d01a0 | https://github.com/sualeh/pointlocation6709/blob/c0c186c2518f41e3fe174920cacd5c0d082d01a0/src/main/java/us/fatehi/pointlocation6709/format/PointLocationFormatter.java#L52-L91 | train |
sualeh/pointlocation6709 | src/main/java/us/fatehi/pointlocation6709/format/PointLocationFormatter.java | PointLocationFormatter.formatLongitude | public static String formatLongitude(final Longitude longitude,
final PointLocationFormatType formatType)
throws FormatterException
{
if (longitude == null)
{
throw new FormatterException("No point location provided");
}
if (formatType == null)
{
throw new FormatterException("No format type provided");
}
final String formatted;
switch (formatType)
{
case HUMAN_LONG:
formatted = longitude.toString();
break;
case HUMAN_MEDIUM:
formatted = formatLongitudeHumanMedium(longitude);
break;
case LONG:
formatted = formatLongitudeLong(longitude);
break;
case MEDIUM:
formatted = formatLongitudeMedium(longitude);
break;
case SHORT:
formatted = formatLongitudeShort(longitude);
break;
case DECIMAL:
formatted = formatLongitudeWithDecimals(longitude);
break;
default:
throw new FormatterException("Unsupported format type");
}
return formatted;
} | java | public static String formatLongitude(final Longitude longitude,
final PointLocationFormatType formatType)
throws FormatterException
{
if (longitude == null)
{
throw new FormatterException("No point location provided");
}
if (formatType == null)
{
throw new FormatterException("No format type provided");
}
final String formatted;
switch (formatType)
{
case HUMAN_LONG:
formatted = longitude.toString();
break;
case HUMAN_MEDIUM:
formatted = formatLongitudeHumanMedium(longitude);
break;
case LONG:
formatted = formatLongitudeLong(longitude);
break;
case MEDIUM:
formatted = formatLongitudeMedium(longitude);
break;
case SHORT:
formatted = formatLongitudeShort(longitude);
break;
case DECIMAL:
formatted = formatLongitudeWithDecimals(longitude);
break;
default:
throw new FormatterException("Unsupported format type");
}
return formatted;
} | [
"public",
"static",
"String",
"formatLongitude",
"(",
"final",
"Longitude",
"longitude",
",",
"final",
"PointLocationFormatType",
"formatType",
")",
"throws",
"FormatterException",
"{",
"if",
"(",
"longitude",
"==",
"null",
")",
"{",
"throw",
"new",
"FormatterExcept... | Formats a longitude as an ISO 6709 string.
@param longitude
Longitude to format
@param formatType
Format type
@return Formatted string
@throws FormatterException
On an exception | [
"Formats",
"a",
"longitude",
"as",
"an",
"ISO",
"6709",
"string",
"."
] | c0c186c2518f41e3fe174920cacd5c0d082d01a0 | https://github.com/sualeh/pointlocation6709/blob/c0c186c2518f41e3fe174920cacd5c0d082d01a0/src/main/java/us/fatehi/pointlocation6709/format/PointLocationFormatter.java#L104-L143 | train |
sualeh/pointlocation6709 | src/main/java/us/fatehi/pointlocation6709/format/PointLocationFormatter.java | PointLocationFormatter.formatPointLocation | public static String formatPointLocation(final PointLocation pointLocation,
final PointLocationFormatType formatType)
throws FormatterException
{
if (pointLocation == null)
{
throw new FormatterException("No point location provided");
}
if (formatType == null)
{
throw new FormatterException("No format type provided");
}
final String formatted;
switch (formatType)
{
case HUMAN_LONG:
formatted = pointLocation.toString();
break;
case HUMAN_MEDIUM:
formatted = formatHumanMedium(pointLocation);
break;
case HUMAN_SHORT:
formatted = formatHumanShort(pointLocation);
break;
case LONG:
formatted = formatISO6709Long(pointLocation);
break;
case MEDIUM:
formatted = formatISO6709Medium(pointLocation);
break;
case SHORT:
formatted = formatISO6709Short(pointLocation);
break;
case DECIMAL:
formatted = formatISO6709WithDecimals(pointLocation);
break;
default:
throw new FormatterException("Unsupported format type");
}
return formatted;
} | java | public static String formatPointLocation(final PointLocation pointLocation,
final PointLocationFormatType formatType)
throws FormatterException
{
if (pointLocation == null)
{
throw new FormatterException("No point location provided");
}
if (formatType == null)
{
throw new FormatterException("No format type provided");
}
final String formatted;
switch (formatType)
{
case HUMAN_LONG:
formatted = pointLocation.toString();
break;
case HUMAN_MEDIUM:
formatted = formatHumanMedium(pointLocation);
break;
case HUMAN_SHORT:
formatted = formatHumanShort(pointLocation);
break;
case LONG:
formatted = formatISO6709Long(pointLocation);
break;
case MEDIUM:
formatted = formatISO6709Medium(pointLocation);
break;
case SHORT:
formatted = formatISO6709Short(pointLocation);
break;
case DECIMAL:
formatted = formatISO6709WithDecimals(pointLocation);
break;
default:
throw new FormatterException("Unsupported format type");
}
return formatted;
} | [
"public",
"static",
"String",
"formatPointLocation",
"(",
"final",
"PointLocation",
"pointLocation",
",",
"final",
"PointLocationFormatType",
"formatType",
")",
"throws",
"FormatterException",
"{",
"if",
"(",
"pointLocation",
"==",
"null",
")",
"{",
"throw",
"new",
... | Formats a point location as an ISO 6709 or human readable string.
@param pointLocation
Point location to format
@param formatType
Format type
@return Formatted string
@throws FormatterException
On an exception | [
"Formats",
"a",
"point",
"location",
"as",
"an",
"ISO",
"6709",
"or",
"human",
"readable",
"string",
"."
] | c0c186c2518f41e3fe174920cacd5c0d082d01a0 | https://github.com/sualeh/pointlocation6709/blob/c0c186c2518f41e3fe174920cacd5c0d082d01a0/src/main/java/us/fatehi/pointlocation6709/format/PointLocationFormatter.java#L156-L199 | train |
sualeh/pointlocation6709 | src/main/java/us/fatehi/pointlocation6709/format/PointLocationFormatter.java | PointLocationFormatter.formatISO6709WithDecimals | private static String formatISO6709WithDecimals(final PointLocation pointLocation)
{
final Latitude latitude = pointLocation.getLatitude();
final Longitude longitude = pointLocation.getLongitude();
String string = formatLatitudeWithDecimals(latitude) +
formatLongitudeWithDecimals(longitude);
final double altitude = pointLocation.getAltitude();
string = string + formatAltitudeWithSign(altitude);
final String crs = pointLocation.getCoordinateReferenceSystemIdentifier();
string = string + formatCoordinateReferenceSystemIdentifier(crs);
return string + "/";
} | java | private static String formatISO6709WithDecimals(final PointLocation pointLocation)
{
final Latitude latitude = pointLocation.getLatitude();
final Longitude longitude = pointLocation.getLongitude();
String string = formatLatitudeWithDecimals(latitude) +
formatLongitudeWithDecimals(longitude);
final double altitude = pointLocation.getAltitude();
string = string + formatAltitudeWithSign(altitude);
final String crs = pointLocation.getCoordinateReferenceSystemIdentifier();
string = string + formatCoordinateReferenceSystemIdentifier(crs);
return string + "/";
} | [
"private",
"static",
"String",
"formatISO6709WithDecimals",
"(",
"final",
"PointLocation",
"pointLocation",
")",
"{",
"final",
"Latitude",
"latitude",
"=",
"pointLocation",
".",
"getLatitude",
"(",
")",
";",
"final",
"Longitude",
"longitude",
"=",
"pointLocation",
"... | Formats a point location as an ISO 6709 string, using decimals.
@param pointLocation
Point location to format
@return Formatted string | [
"Formats",
"a",
"point",
"location",
"as",
"an",
"ISO",
"6709",
"string",
"using",
"decimals",
"."
] | c0c186c2518f41e3fe174920cacd5c0d082d01a0 | https://github.com/sualeh/pointlocation6709/blob/c0c186c2518f41e3fe174920cacd5c0d082d01a0/src/main/java/us/fatehi/pointlocation6709/format/PointLocationFormatter.java#L372-L383 | train |
sualeh/pointlocation6709 | src/main/java/us/fatehi/pointlocation6709/Angle.java | Angle.sexagesimalSplit | private int[] sexagesimalSplit(final double value)
{
final double absValue = Math.abs(value);
int units;
int minutes;
int seconds;
final int sign = value < 0? -1: 1;
// Calculate absolute integer units
units = (int) Math.floor(absValue);
seconds = (int) Math.round((absValue - units) * 3600D);
// Calculate absolute integer minutes
minutes = seconds / 60; // Integer arithmetic
if (minutes == 60)
{
minutes = 0;
units++;
}
// Calculate absolute integer seconds
seconds = seconds % 60;
// Correct for sign
units = units * sign;
minutes = minutes * sign;
seconds = seconds * sign;
return new int[] {
units, minutes, seconds
};
} | java | private int[] sexagesimalSplit(final double value)
{
final double absValue = Math.abs(value);
int units;
int minutes;
int seconds;
final int sign = value < 0? -1: 1;
// Calculate absolute integer units
units = (int) Math.floor(absValue);
seconds = (int) Math.round((absValue - units) * 3600D);
// Calculate absolute integer minutes
minutes = seconds / 60; // Integer arithmetic
if (minutes == 60)
{
minutes = 0;
units++;
}
// Calculate absolute integer seconds
seconds = seconds % 60;
// Correct for sign
units = units * sign;
minutes = minutes * sign;
seconds = seconds * sign;
return new int[] {
units, minutes, seconds
};
} | [
"private",
"int",
"[",
"]",
"sexagesimalSplit",
"(",
"final",
"double",
"value",
")",
"{",
"final",
"double",
"absValue",
"=",
"Math",
".",
"abs",
"(",
"value",
")",
";",
"int",
"units",
";",
"int",
"minutes",
";",
"int",
"seconds",
";",
"final",
"int"... | Splits a double value into it's sexagesimal parts. Each part has
the same sign as the provided value.
@param value
Value to split
@return Split parts | [
"Splits",
"a",
"double",
"value",
"into",
"it",
"s",
"sexagesimal",
"parts",
".",
"Each",
"part",
"has",
"the",
"same",
"sign",
"as",
"the",
"provided",
"value",
"."
] | c0c186c2518f41e3fe174920cacd5c0d082d01a0 | https://github.com/sualeh/pointlocation6709/blob/c0c186c2518f41e3fe174920cacd5c0d082d01a0/src/main/java/us/fatehi/pointlocation6709/Angle.java#L393-L425 | train |
nmdp-bioinformatics/ngs | range/src/main/java/org/nmdp/ngs/range/rtree/RangeGeometries.java | RangeGeometries.singleton | public static <N extends Number & Comparable<? super N>> Point singleton(final N value) {
checkNotNull(value);
return Geometries.point(value.doubleValue(), 0.5d);
} | java | public static <N extends Number & Comparable<? super N>> Point singleton(final N value) {
checkNotNull(value);
return Geometries.point(value.doubleValue(), 0.5d);
} | [
"public",
"static",
"<",
"N",
"extends",
"Number",
"&",
"Comparable",
"<",
"?",
"super",
"N",
">",
">",
"Point",
"singleton",
"(",
"final",
"N",
"value",
")",
"{",
"checkNotNull",
"(",
"value",
")",
";",
"return",
"Geometries",
".",
"point",
"(",
"valu... | Create and return a new point geometry from the specified singleton value.
@param value singleton value, must not be null
@return a new point geometry from the specified singleton value | [
"Create",
"and",
"return",
"a",
"new",
"point",
"geometry",
"from",
"the",
"specified",
"singleton",
"value",
"."
] | 277627e4311313a80f5dc110b3185b0d7af32bd0 | https://github.com/nmdp-bioinformatics/ngs/blob/277627e4311313a80f5dc110b3185b0d7af32bd0/range/src/main/java/org/nmdp/ngs/range/rtree/RangeGeometries.java#L66-L69 | train |
nmdp-bioinformatics/ngs | range/src/main/java/org/nmdp/ngs/range/rtree/RangeGeometries.java | RangeGeometries.range | public static <N extends Number & Comparable<? super N>> Rectangle range(final Range<N> range) {
checkNotNull(range);
if (range.isEmpty()) {
throw new IllegalArgumentException("range must not be empty");
}
if (!range.hasLowerBound() || !range.hasUpperBound()) {
throw new IllegalArgumentException("range must have lower and upper bounds");
}
Number lowerEndpoint = range.lowerEndpoint();
BoundType lowerBoundType = range.lowerBoundType();
Number upperEndpoint = range.upperEndpoint();
BoundType upperBoundType = range.upperBoundType();
/*
Since we are representing genomic coordinate systems, the expectation is
that endpoints are instance of Integer, Long, or BigInteger; thus for open
lower and upper bounds we can safely add or substract 1.0 respectively.
Then by convention a rectangle with y1 0.0 and height of 1.0 is used.
closed(10, 20) --> (10.0, 0.0, 20.0, 1.0)
closedOpen(10, 20) --> (10.0, 0.0, 19.0, 1.0)
openClosed(10, 20) --> (11.0, 0.0, 20.0, 1.0)
open(10, 20) --> (11.0, 0.0, 19.0, 1.0);
closed(10, 11) --> (10.0, 0.0, 11.0, 1.0)
closedOpen(10, 11) --> (10.0, 0.0, 10.0, 1.0)
openClosed(10, 11) --> (11.0, 0.0, 11.0, 1.0)
open(10, 11) --> empty, throw exception
closed(10, 10) --> (10.0, 0.0, 10.0, 1.0)
closedOpen(10, 10) --> empty, throw exception
openClosed(10, 10) --> empty, throw exception
open(10, 10) --> empty, throw exception
*/
double x1 = lowerBoundType == BoundType.OPEN ? lowerEndpoint.doubleValue() + 1.0d : lowerEndpoint.doubleValue();
double y1 = 0.0d;
double x2 = upperBoundType == BoundType.OPEN ? upperEndpoint.doubleValue() - 1.0d : upperEndpoint.doubleValue();
double y2 = 1.0d;
return Geometries.rectangle(x1, y1, x2, y2);
} | java | public static <N extends Number & Comparable<? super N>> Rectangle range(final Range<N> range) {
checkNotNull(range);
if (range.isEmpty()) {
throw new IllegalArgumentException("range must not be empty");
}
if (!range.hasLowerBound() || !range.hasUpperBound()) {
throw new IllegalArgumentException("range must have lower and upper bounds");
}
Number lowerEndpoint = range.lowerEndpoint();
BoundType lowerBoundType = range.lowerBoundType();
Number upperEndpoint = range.upperEndpoint();
BoundType upperBoundType = range.upperBoundType();
/*
Since we are representing genomic coordinate systems, the expectation is
that endpoints are instance of Integer, Long, or BigInteger; thus for open
lower and upper bounds we can safely add or substract 1.0 respectively.
Then by convention a rectangle with y1 0.0 and height of 1.0 is used.
closed(10, 20) --> (10.0, 0.0, 20.0, 1.0)
closedOpen(10, 20) --> (10.0, 0.0, 19.0, 1.0)
openClosed(10, 20) --> (11.0, 0.0, 20.0, 1.0)
open(10, 20) --> (11.0, 0.0, 19.0, 1.0);
closed(10, 11) --> (10.0, 0.0, 11.0, 1.0)
closedOpen(10, 11) --> (10.0, 0.0, 10.0, 1.0)
openClosed(10, 11) --> (11.0, 0.0, 11.0, 1.0)
open(10, 11) --> empty, throw exception
closed(10, 10) --> (10.0, 0.0, 10.0, 1.0)
closedOpen(10, 10) --> empty, throw exception
openClosed(10, 10) --> empty, throw exception
open(10, 10) --> empty, throw exception
*/
double x1 = lowerBoundType == BoundType.OPEN ? lowerEndpoint.doubleValue() + 1.0d : lowerEndpoint.doubleValue();
double y1 = 0.0d;
double x2 = upperBoundType == BoundType.OPEN ? upperEndpoint.doubleValue() - 1.0d : upperEndpoint.doubleValue();
double y2 = 1.0d;
return Geometries.rectangle(x1, y1, x2, y2);
} | [
"public",
"static",
"<",
"N",
"extends",
"Number",
"&",
"Comparable",
"<",
"?",
"super",
"N",
">",
">",
"Rectangle",
"range",
"(",
"final",
"Range",
"<",
"N",
">",
"range",
")",
"{",
"checkNotNull",
"(",
"range",
")",
";",
"if",
"(",
"range",
".",
... | Create and return a new rectangle geometry from the specified range.
@param range range, must not be null, must not be empty, and must have lower and upper bounds
@return a new rectangle geometry from the specified range | [
"Create",
"and",
"return",
"a",
"new",
"rectangle",
"geometry",
"from",
"the",
"specified",
"range",
"."
] | 277627e4311313a80f5dc110b3185b0d7af32bd0 | https://github.com/nmdp-bioinformatics/ngs/blob/277627e4311313a80f5dc110b3185b0d7af32bd0/range/src/main/java/org/nmdp/ngs/range/rtree/RangeGeometries.java#L129-L171 | train |
nmdp-bioinformatics/ngs | reads/src/main/java/org/nmdp/ngs/reads/paired/PairedEndFastqReader.java | PairedEndFastqReader.isLeft | static boolean isLeft(final Fastq fastq) {
checkNotNull(fastq);
return LEFT.matcher(fastq.getDescription()).matches();
} | java | static boolean isLeft(final Fastq fastq) {
checkNotNull(fastq);
return LEFT.matcher(fastq.getDescription()).matches();
} | [
"static",
"boolean",
"isLeft",
"(",
"final",
"Fastq",
"fastq",
")",
"{",
"checkNotNull",
"(",
"fastq",
")",
";",
"return",
"LEFT",
".",
"matcher",
"(",
"fastq",
".",
"getDescription",
"(",
")",
")",
".",
"matches",
"(",
")",
";",
"}"
] | Return true if the specified fastq is the left or first read of a paired end read.
@param fastq fastq, must not be null
@return true if the specified fastq is the left or first read of a paired end read | [
"Return",
"true",
"if",
"the",
"specified",
"fastq",
"is",
"the",
"left",
"or",
"first",
"read",
"of",
"a",
"paired",
"end",
"read",
"."
] | 277627e4311313a80f5dc110b3185b0d7af32bd0 | https://github.com/nmdp-bioinformatics/ngs/blob/277627e4311313a80f5dc110b3185b0d7af32bd0/reads/src/main/java/org/nmdp/ngs/reads/paired/PairedEndFastqReader.java#L302-L305 | train |
nmdp-bioinformatics/ngs | reads/src/main/java/org/nmdp/ngs/reads/paired/PairedEndFastqReader.java | PairedEndFastqReader.isRight | static boolean isRight(final Fastq fastq) {
checkNotNull(fastq);
return RIGHT.matcher(fastq.getDescription()).matches();
} | java | static boolean isRight(final Fastq fastq) {
checkNotNull(fastq);
return RIGHT.matcher(fastq.getDescription()).matches();
} | [
"static",
"boolean",
"isRight",
"(",
"final",
"Fastq",
"fastq",
")",
"{",
"checkNotNull",
"(",
"fastq",
")",
";",
"return",
"RIGHT",
".",
"matcher",
"(",
"fastq",
".",
"getDescription",
"(",
")",
")",
".",
"matches",
"(",
")",
";",
"}"
] | Return true if the specified fastq is the right or second read of a paired end read.
@param fastq fastq, must not be null
@return true if the specified fastq is the right or second read of a paired end read | [
"Return",
"true",
"if",
"the",
"specified",
"fastq",
"is",
"the",
"right",
"or",
"second",
"read",
"of",
"a",
"paired",
"end",
"read",
"."
] | 277627e4311313a80f5dc110b3185b0d7af32bd0 | https://github.com/nmdp-bioinformatics/ngs/blob/277627e4311313a80f5dc110b3185b0d7af32bd0/reads/src/main/java/org/nmdp/ngs/reads/paired/PairedEndFastqReader.java#L313-L316 | train |
nmdp-bioinformatics/ngs | reads/src/main/java/org/nmdp/ngs/reads/paired/PairedEndFastqReader.java | PairedEndFastqReader.prefix | static String prefix(final Fastq fastq) {
checkNotNull(fastq);
Matcher m = PREFIX.matcher(fastq.getDescription());
if (!m.matches()) {
throw new PairedEndFastqReaderException("could not parse prefix from description " + fastq.getDescription());
}
return m.group(1);
} | java | static String prefix(final Fastq fastq) {
checkNotNull(fastq);
Matcher m = PREFIX.matcher(fastq.getDescription());
if (!m.matches()) {
throw new PairedEndFastqReaderException("could not parse prefix from description " + fastq.getDescription());
}
return m.group(1);
} | [
"static",
"String",
"prefix",
"(",
"final",
"Fastq",
"fastq",
")",
"{",
"checkNotNull",
"(",
"fastq",
")",
";",
"Matcher",
"m",
"=",
"PREFIX",
".",
"matcher",
"(",
"fastq",
".",
"getDescription",
"(",
")",
")",
";",
"if",
"(",
"!",
"m",
".",
"matches... | Return the prefix of the paired end read name of the specified fastq.
@param fastq fastq, must not be null
@return the prefix of the paired end read name of the specified fastq | [
"Return",
"the",
"prefix",
"of",
"the",
"paired",
"end",
"read",
"name",
"of",
"the",
"specified",
"fastq",
"."
] | 277627e4311313a80f5dc110b3185b0d7af32bd0 | https://github.com/nmdp-bioinformatics/ngs/blob/277627e4311313a80f5dc110b3185b0d7af32bd0/reads/src/main/java/org/nmdp/ngs/reads/paired/PairedEndFastqReader.java#L324-L331 | train |
nmdp-bioinformatics/ngs | align/src/main/java/org/nmdp/ngs/align/GapPenalties.java | GapPenalties.create | public static GapPenalties create(final int match,
final int replace,
final int insert,
final int delete,
final int extend) {
return new GapPenalties((short) match, (short) replace, (short) insert, (short) delete, (short) extend);
} | java | public static GapPenalties create(final int match,
final int replace,
final int insert,
final int delete,
final int extend) {
return new GapPenalties((short) match, (short) replace, (short) insert, (short) delete, (short) extend);
} | [
"public",
"static",
"GapPenalties",
"create",
"(",
"final",
"int",
"match",
",",
"final",
"int",
"replace",
",",
"final",
"int",
"insert",
",",
"final",
"int",
"delete",
",",
"final",
"int",
"extend",
")",
"{",
"return",
"new",
"GapPenalties",
"(",
"(",
... | Create and return a new gap penalties with the specified penalties.
@param match match penalty
@param replace replace penalty
@param insert insert penalty
@param delete delete penalty
@param extend extend penalty
@return a new gap penalties with the specified penalties | [
"Create",
"and",
"return",
"a",
"new",
"gap",
"penalties",
"with",
"the",
"specified",
"penalties",
"."
] | 277627e4311313a80f5dc110b3185b0d7af32bd0 | https://github.com/nmdp-bioinformatics/ngs/blob/277627e4311313a80f5dc110b3185b0d7af32bd0/align/src/main/java/org/nmdp/ngs/align/GapPenalties.java#L116-L122 | train |
Mozu/mozu-java | mozu-java-core/src/main/java/com/mozu/api/urls/commerce/orders/PickupUrl.java | PickupUrl.getAvailablePickupFulfillmentActionsUrl | public static MozuUrl getAvailablePickupFulfillmentActionsUrl(String orderId, String pickupId)
{
UrlFormatter formatter = new UrlFormatter("/api/commerce/orders/{orderId}/pickups/{pickupId}/actions");
formatter.formatUrl("orderId", orderId);
formatter.formatUrl("pickupId", pickupId);
return new MozuUrl(formatter.getResourceUrl(), MozuUrl.UrlLocation.TENANT_POD) ;
} | java | public static MozuUrl getAvailablePickupFulfillmentActionsUrl(String orderId, String pickupId)
{
UrlFormatter formatter = new UrlFormatter("/api/commerce/orders/{orderId}/pickups/{pickupId}/actions");
formatter.formatUrl("orderId", orderId);
formatter.formatUrl("pickupId", pickupId);
return new MozuUrl(formatter.getResourceUrl(), MozuUrl.UrlLocation.TENANT_POD) ;
} | [
"public",
"static",
"MozuUrl",
"getAvailablePickupFulfillmentActionsUrl",
"(",
"String",
"orderId",
",",
"String",
"pickupId",
")",
"{",
"UrlFormatter",
"formatter",
"=",
"new",
"UrlFormatter",
"(",
"\"/api/commerce/orders/{orderId}/pickups/{pickupId}/actions\"",
")",
";",
... | Get Resource Url for GetAvailablePickupFulfillmentActions
@param orderId Unique identifier of the order.
@param pickupId Unique identifier of the pickup to remove.
@return String Resource Url | [
"Get",
"Resource",
"Url",
"for",
"GetAvailablePickupFulfillmentActions"
] | 5beadde73601a859f845e3e2fc1077b39c8bea83 | https://github.com/Mozu/mozu-java/blob/5beadde73601a859f845e3e2fc1077b39c8bea83/mozu-java-core/src/main/java/com/mozu/api/urls/commerce/orders/PickupUrl.java#L22-L28 | train |
Mozu/mozu-java | mozu-java-core/src/main/java/com/mozu/api/urls/commerce/orders/PickupUrl.java | PickupUrl.getPickupUrl | public static MozuUrl getPickupUrl(String orderId, String pickupId, String responseFields)
{
UrlFormatter formatter = new UrlFormatter("/api/commerce/orders/{orderId}/pickups/{pickupId}?responseFields={responseFields}");
formatter.formatUrl("orderId", orderId);
formatter.formatUrl("pickupId", pickupId);
formatter.formatUrl("responseFields", responseFields);
return new MozuUrl(formatter.getResourceUrl(), MozuUrl.UrlLocation.TENANT_POD) ;
} | java | public static MozuUrl getPickupUrl(String orderId, String pickupId, String responseFields)
{
UrlFormatter formatter = new UrlFormatter("/api/commerce/orders/{orderId}/pickups/{pickupId}?responseFields={responseFields}");
formatter.formatUrl("orderId", orderId);
formatter.formatUrl("pickupId", pickupId);
formatter.formatUrl("responseFields", responseFields);
return new MozuUrl(formatter.getResourceUrl(), MozuUrl.UrlLocation.TENANT_POD) ;
} | [
"public",
"static",
"MozuUrl",
"getPickupUrl",
"(",
"String",
"orderId",
",",
"String",
"pickupId",
",",
"String",
"responseFields",
")",
"{",
"UrlFormatter",
"formatter",
"=",
"new",
"UrlFormatter",
"(",
"\"/api/commerce/orders/{orderId}/pickups/{pickupId}?responseFields={... | Get Resource Url for GetPickup
@param orderId Unique identifier of the order.
@param pickupId Unique identifier of the pickup to remove.
@param responseFields Filtering syntax appended to an API call to increase or decrease the amount of data returned inside a JSON object. This parameter should only be used to retrieve data. Attempting to update data using this parameter may cause data loss.
@return String Resource Url | [
"Get",
"Resource",
"Url",
"for",
"GetPickup"
] | 5beadde73601a859f845e3e2fc1077b39c8bea83 | https://github.com/Mozu/mozu-java/blob/5beadde73601a859f845e3e2fc1077b39c8bea83/mozu-java-core/src/main/java/com/mozu/api/urls/commerce/orders/PickupUrl.java#L37-L44 | train |
mgm-tp/jfunk | jfunk-web/src/main/java/com/mgmtp/jfunk/web/util/MultipartPostRequest.java | MultipartPostRequest.setParameter | public void setParameter(final String name, final String filename, final InputStream is) throws IOException {
boundary();
writeName(name);
write("; filename=\"");
write(filename);
write('"');
newline();
write("Content-Type: ");
String type = URLConnection.guessContentTypeFromName(filename);
if (type == null) {
type = "application/octet-stream";
}
writeln(type);
newline();
pipe(is, os);
newline();
} | java | public void setParameter(final String name, final String filename, final InputStream is) throws IOException {
boundary();
writeName(name);
write("; filename=\"");
write(filename);
write('"');
newline();
write("Content-Type: ");
String type = URLConnection.guessContentTypeFromName(filename);
if (type == null) {
type = "application/octet-stream";
}
writeln(type);
newline();
pipe(is, os);
newline();
} | [
"public",
"void",
"setParameter",
"(",
"final",
"String",
"name",
",",
"final",
"String",
"filename",
",",
"final",
"InputStream",
"is",
")",
"throws",
"IOException",
"{",
"boundary",
"(",
")",
";",
"writeName",
"(",
"name",
")",
";",
"write",
"(",
"\"; fi... | Adds a file parameter to the request
@param name
parameter name
@param filename
the name of the file
@param is
input stream to read the contents of the file from | [
"Adds",
"a",
"file",
"parameter",
"to",
"the",
"request"
] | 5b9fecac5778b988bb458085ded39ea9a4c7c2ae | https://github.com/mgm-tp/jfunk/blob/5b9fecac5778b988bb458085ded39ea9a4c7c2ae/jfunk-web/src/main/java/com/mgmtp/jfunk/web/util/MultipartPostRequest.java#L115-L131 | train |
Mozu/mozu-java | mozu-javaasync-core/src/main/java/com/mozu/api/urls/commerce/customer/accounts/TransactionUrl.java | TransactionUrl.getTransactionsUrl | public static MozuUrl getTransactionsUrl(Integer accountId)
{
UrlFormatter formatter = new UrlFormatter("/api/commerce/customer/accounts/{accountId}/transactions");
formatter.formatUrl("accountId", accountId);
return new MozuUrl(formatter.getResourceUrl(), MozuUrl.UrlLocation.TENANT_POD) ;
} | java | public static MozuUrl getTransactionsUrl(Integer accountId)
{
UrlFormatter formatter = new UrlFormatter("/api/commerce/customer/accounts/{accountId}/transactions");
formatter.formatUrl("accountId", accountId);
return new MozuUrl(formatter.getResourceUrl(), MozuUrl.UrlLocation.TENANT_POD) ;
} | [
"public",
"static",
"MozuUrl",
"getTransactionsUrl",
"(",
"Integer",
"accountId",
")",
"{",
"UrlFormatter",
"formatter",
"=",
"new",
"UrlFormatter",
"(",
"\"/api/commerce/customer/accounts/{accountId}/transactions\"",
")",
";",
"formatter",
".",
"formatUrl",
"(",
"\"accou... | Get Resource Url for GetTransactions
@param accountId Unique identifier of the customer account.
@return String Resource Url | [
"Get",
"Resource",
"Url",
"for",
"GetTransactions"
] | 5beadde73601a859f845e3e2fc1077b39c8bea83 | https://github.com/Mozu/mozu-java/blob/5beadde73601a859f845e3e2fc1077b39c8bea83/mozu-javaasync-core/src/main/java/com/mozu/api/urls/commerce/customer/accounts/TransactionUrl.java#L21-L26 | train |
Mozu/mozu-java | mozu-javaasync-core/src/main/java/com/mozu/api/urls/commerce/customer/accounts/TransactionUrl.java | TransactionUrl.removeTransactionUrl | public static MozuUrl removeTransactionUrl(Integer accountId, String transactionId)
{
UrlFormatter formatter = new UrlFormatter("/api/commerce/customer/accounts/{accountId}/transactions/{transactionId}");
formatter.formatUrl("accountId", accountId);
formatter.formatUrl("transactionId", transactionId);
return new MozuUrl(formatter.getResourceUrl(), MozuUrl.UrlLocation.TENANT_POD) ;
} | java | public static MozuUrl removeTransactionUrl(Integer accountId, String transactionId)
{
UrlFormatter formatter = new UrlFormatter("/api/commerce/customer/accounts/{accountId}/transactions/{transactionId}");
formatter.formatUrl("accountId", accountId);
formatter.formatUrl("transactionId", transactionId);
return new MozuUrl(formatter.getResourceUrl(), MozuUrl.UrlLocation.TENANT_POD) ;
} | [
"public",
"static",
"MozuUrl",
"removeTransactionUrl",
"(",
"Integer",
"accountId",
",",
"String",
"transactionId",
")",
"{",
"UrlFormatter",
"formatter",
"=",
"new",
"UrlFormatter",
"(",
"\"/api/commerce/customer/accounts/{accountId}/transactions/{transactionId}\"",
")",
";"... | Get Resource Url for RemoveTransaction
@param accountId Unique identifier of the customer account.
@param transactionId Unique identifier of the transaction to delete.
@return String Resource Url | [
"Get",
"Resource",
"Url",
"for",
"RemoveTransaction"
] | 5beadde73601a859f845e3e2fc1077b39c8bea83 | https://github.com/Mozu/mozu-java/blob/5beadde73601a859f845e3e2fc1077b39c8bea83/mozu-javaasync-core/src/main/java/com/mozu/api/urls/commerce/customer/accounts/TransactionUrl.java#L48-L54 | train |
mgm-tp/jfunk | jfunk-core/src/main/java/com/mgmtp/jfunk/core/mail/SmtpClient.java | SmtpClient.send | public void send(final Message msg) throws MailException {
Transport transport = null;
try {
if (log.isDebugEnabled()) {
log.debug("Sending mail message [subject={}, recipients={}]", msg.getSubject(),
on(", ").join(msg.getAllRecipients()));
}
transport = sessionProvider.get().getTransport();
transport.connect();
transport.sendMessage(msg, msg.getAllRecipients());
} catch (MessagingException ex) {
throw new MailException("Error sending mail message", ex);
} finally {
try {
transport.close();
} catch (MessagingException ex) {
log.error(ex.getMessage(), ex);
}
}
} | java | public void send(final Message msg) throws MailException {
Transport transport = null;
try {
if (log.isDebugEnabled()) {
log.debug("Sending mail message [subject={}, recipients={}]", msg.getSubject(),
on(", ").join(msg.getAllRecipients()));
}
transport = sessionProvider.get().getTransport();
transport.connect();
transport.sendMessage(msg, msg.getAllRecipients());
} catch (MessagingException ex) {
throw new MailException("Error sending mail message", ex);
} finally {
try {
transport.close();
} catch (MessagingException ex) {
log.error(ex.getMessage(), ex);
}
}
} | [
"public",
"void",
"send",
"(",
"final",
"Message",
"msg",
")",
"throws",
"MailException",
"{",
"Transport",
"transport",
"=",
"null",
";",
"try",
"{",
"if",
"(",
"log",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"log",
".",
"debug",
"(",
"\"Sending mail ... | Sends the specified message.
@param msg
the message to send
@throws MailException
if an error occurred sending the message | [
"Sends",
"the",
"specified",
"message",
"."
] | 5b9fecac5778b988bb458085ded39ea9a4c7c2ae | https://github.com/mgm-tp/jfunk/blob/5b9fecac5778b988bb458085ded39ea9a4c7c2ae/jfunk-core/src/main/java/com/mgmtp/jfunk/core/mail/SmtpClient.java#L62-L81 | train |
Mozu/mozu-java | mozu-java-core/src/main/java/com/mozu/api/urls/commerce/QuoteUrl.java | QuoteUrl.getQuoteByNameUrl | public static MozuUrl getQuoteByNameUrl(Integer customerAccountId, String quoteName, String responseFields)
{
UrlFormatter formatter = new UrlFormatter("/api/commerce/quotes/customers/{customerAccountId}/{quoteName}?responseFields={responseFields}");
formatter.formatUrl("customerAccountId", customerAccountId);
formatter.formatUrl("quoteName", quoteName);
formatter.formatUrl("responseFields", responseFields);
return new MozuUrl(formatter.getResourceUrl(), MozuUrl.UrlLocation.TENANT_POD) ;
} | java | public static MozuUrl getQuoteByNameUrl(Integer customerAccountId, String quoteName, String responseFields)
{
UrlFormatter formatter = new UrlFormatter("/api/commerce/quotes/customers/{customerAccountId}/{quoteName}?responseFields={responseFields}");
formatter.formatUrl("customerAccountId", customerAccountId);
formatter.formatUrl("quoteName", quoteName);
formatter.formatUrl("responseFields", responseFields);
return new MozuUrl(formatter.getResourceUrl(), MozuUrl.UrlLocation.TENANT_POD) ;
} | [
"public",
"static",
"MozuUrl",
"getQuoteByNameUrl",
"(",
"Integer",
"customerAccountId",
",",
"String",
"quoteName",
",",
"String",
"responseFields",
")",
"{",
"UrlFormatter",
"formatter",
"=",
"new",
"UrlFormatter",
"(",
"\"/api/commerce/quotes/customers/{customerAccountId... | Get Resource Url for GetQuoteByName
@param customerAccountId The unique identifier of the customer account for which to retrieve wish lists.
@param quoteName
@param responseFields Filtering syntax appended to an API call to increase or decrease the amount of data returned inside a JSON object. This parameter should only be used to retrieve data. Attempting to update data using this parameter may cause data loss.
@return String Resource Url | [
"Get",
"Resource",
"Url",
"for",
"GetQuoteByName"
] | 5beadde73601a859f845e3e2fc1077b39c8bea83 | https://github.com/Mozu/mozu-java/blob/5beadde73601a859f845e3e2fc1077b39c8bea83/mozu-java-core/src/main/java/com/mozu/api/urls/commerce/QuoteUrl.java#L61-L68 | train |
Mozu/mozu-java | mozu-java-core/src/main/java/com/mozu/api/urls/commerce/QuoteUrl.java | QuoteUrl.deleteQuoteUrl | public static MozuUrl deleteQuoteUrl(String quoteId)
{
UrlFormatter formatter = new UrlFormatter("/api/commerce/quotes/{quoteId}");
formatter.formatUrl("quoteId", quoteId);
return new MozuUrl(formatter.getResourceUrl(), MozuUrl.UrlLocation.TENANT_POD) ;
} | java | public static MozuUrl deleteQuoteUrl(String quoteId)
{
UrlFormatter formatter = new UrlFormatter("/api/commerce/quotes/{quoteId}");
formatter.formatUrl("quoteId", quoteId);
return new MozuUrl(formatter.getResourceUrl(), MozuUrl.UrlLocation.TENANT_POD) ;
} | [
"public",
"static",
"MozuUrl",
"deleteQuoteUrl",
"(",
"String",
"quoteId",
")",
"{",
"UrlFormatter",
"formatter",
"=",
"new",
"UrlFormatter",
"(",
"\"/api/commerce/quotes/{quoteId}\"",
")",
";",
"formatter",
".",
"formatUrl",
"(",
"\"quoteId\"",
",",
"quoteId",
")",... | Get Resource Url for DeleteQuote
@param quoteId
@return String Resource Url | [
"Get",
"Resource",
"Url",
"for",
"DeleteQuote"
] | 5beadde73601a859f845e3e2fc1077b39c8bea83 | https://github.com/Mozu/mozu-java/blob/5beadde73601a859f845e3e2fc1077b39c8bea83/mozu-java-core/src/main/java/com/mozu/api/urls/commerce/QuoteUrl.java#L101-L106 | train |
Mozu/mozu-java | mozu-java-core/src/main/java/com/mozu/api/urls/platform/TenantDataUrl.java | TenantDataUrl.getDBValueUrl | public static MozuUrl getDBValueUrl(String dbEntryQuery, String responseFields)
{
UrlFormatter formatter = new UrlFormatter("/api/platform/tenantdata/{dbEntryQuery}?responseFields={responseFields}");
formatter.formatUrl("dbEntryQuery", dbEntryQuery);
formatter.formatUrl("responseFields", responseFields);
return new MozuUrl(formatter.getResourceUrl(), MozuUrl.UrlLocation.TENANT_POD) ;
} | java | public static MozuUrl getDBValueUrl(String dbEntryQuery, String responseFields)
{
UrlFormatter formatter = new UrlFormatter("/api/platform/tenantdata/{dbEntryQuery}?responseFields={responseFields}");
formatter.formatUrl("dbEntryQuery", dbEntryQuery);
formatter.formatUrl("responseFields", responseFields);
return new MozuUrl(formatter.getResourceUrl(), MozuUrl.UrlLocation.TENANT_POD) ;
} | [
"public",
"static",
"MozuUrl",
"getDBValueUrl",
"(",
"String",
"dbEntryQuery",
",",
"String",
"responseFields",
")",
"{",
"UrlFormatter",
"formatter",
"=",
"new",
"UrlFormatter",
"(",
"\"/api/platform/tenantdata/{dbEntryQuery}?responseFields={responseFields}\"",
")",
";",
"... | Get Resource Url for GetDBValue
@param dbEntryQuery The database entry string to create.
@param responseFields Filtering syntax appended to an API call to increase or decrease the amount of data returned inside a JSON object. This parameter should only be used to retrieve data. Attempting to update data using this parameter may cause data loss.
@return String Resource Url | [
"Get",
"Resource",
"Url",
"for",
"GetDBValue"
] | 5beadde73601a859f845e3e2fc1077b39c8bea83 | https://github.com/Mozu/mozu-java/blob/5beadde73601a859f845e3e2fc1077b39c8bea83/mozu-java-core/src/main/java/com/mozu/api/urls/platform/TenantDataUrl.java#L22-L28 | train |
Mozu/mozu-java | mozu-java-core/src/main/java/com/mozu/api/urls/platform/TenantDataUrl.java | TenantDataUrl.createDBValueUrl | public static MozuUrl createDBValueUrl(String dbEntryQuery)
{
UrlFormatter formatter = new UrlFormatter("/api/platform/tenantdata/{dbEntryQuery}");
formatter.formatUrl("dbEntryQuery", dbEntryQuery);
return new MozuUrl(formatter.getResourceUrl(), MozuUrl.UrlLocation.TENANT_POD) ;
} | java | public static MozuUrl createDBValueUrl(String dbEntryQuery)
{
UrlFormatter formatter = new UrlFormatter("/api/platform/tenantdata/{dbEntryQuery}");
formatter.formatUrl("dbEntryQuery", dbEntryQuery);
return new MozuUrl(formatter.getResourceUrl(), MozuUrl.UrlLocation.TENANT_POD) ;
} | [
"public",
"static",
"MozuUrl",
"createDBValueUrl",
"(",
"String",
"dbEntryQuery",
")",
"{",
"UrlFormatter",
"formatter",
"=",
"new",
"UrlFormatter",
"(",
"\"/api/platform/tenantdata/{dbEntryQuery}\"",
")",
";",
"formatter",
".",
"formatUrl",
"(",
"\"dbEntryQuery\"",
","... | Get Resource Url for CreateDBValue
@param dbEntryQuery The database entry string to create.
@return String Resource Url | [
"Get",
"Resource",
"Url",
"for",
"CreateDBValue"
] | 5beadde73601a859f845e3e2fc1077b39c8bea83 | https://github.com/Mozu/mozu-java/blob/5beadde73601a859f845e3e2fc1077b39c8bea83/mozu-java-core/src/main/java/com/mozu/api/urls/platform/TenantDataUrl.java#L35-L40 | train |
jeremybrooks/jinx | src/main/java/net/jeremybrooks/jinx/JinxUtils.java | JinxUtils.normalizeTagsForUpload | public static List<String> normalizeTagsForUpload(List<String> list) {
if (isNullOrEmpty(list)) {
return null;
}
List<String> tmp = new ArrayList<String>();
for (String s : list) {
if (s.contains(" ")) {
tmp.add("\"" + s + "\"");
} else {
tmp.add(s);
}
}
return tmp;
} | java | public static List<String> normalizeTagsForUpload(List<String> list) {
if (isNullOrEmpty(list)) {
return null;
}
List<String> tmp = new ArrayList<String>();
for (String s : list) {
if (s.contains(" ")) {
tmp.add("\"" + s + "\"");
} else {
tmp.add(s);
}
}
return tmp;
} | [
"public",
"static",
"List",
"<",
"String",
">",
"normalizeTagsForUpload",
"(",
"List",
"<",
"String",
">",
"list",
")",
"{",
"if",
"(",
"isNullOrEmpty",
"(",
"list",
")",
")",
"{",
"return",
"null",
";",
"}",
"List",
"<",
"String",
">",
"tmp",
"=",
"... | Normalize tags for uploads.
This will put quotation marks around tags that contain spaces.
@param list list of tags.
@return new list containing normalized tags. | [
"Normalize",
"tags",
"for",
"uploads",
"."
] | ab7a4b7462d08bcbfd9b98bd3f5029771c20f6c6 | https://github.com/jeremybrooks/jinx/blob/ab7a4b7462d08bcbfd9b98bd3f5029771c20f6c6/src/main/java/net/jeremybrooks/jinx/JinxUtils.java#L382-L395 | train |
jeremybrooks/jinx | src/main/java/net/jeremybrooks/jinx/JinxUtils.java | JinxUtils.memberTypeToMemberTypeId | public static Integer memberTypeToMemberTypeId(JinxConstants.MemberType memberType) {
if (memberType == null) {
return null;
}
Integer type;
switch (memberType) {
case narwhal:
type = 1;
break;
case member:
type = 2;
break;
case moderator:
type = 3;
break;
case admin:
type = 4;
break;
default:
type = null;
break;
}
return type;
} | java | public static Integer memberTypeToMemberTypeId(JinxConstants.MemberType memberType) {
if (memberType == null) {
return null;
}
Integer type;
switch (memberType) {
case narwhal:
type = 1;
break;
case member:
type = 2;
break;
case moderator:
type = 3;
break;
case admin:
type = 4;
break;
default:
type = null;
break;
}
return type;
} | [
"public",
"static",
"Integer",
"memberTypeToMemberTypeId",
"(",
"JinxConstants",
".",
"MemberType",
"memberType",
")",
"{",
"if",
"(",
"memberType",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"Integer",
"type",
";",
"switch",
"(",
"memberType",
")",
... | Convert a MemberType enum to the numeric Flickr member type id.
@param memberType the enum type to convert to a numeric id.
@return numeric id corresponding to the enum value, or null if the member type parameter is invalid. | [
"Convert",
"a",
"MemberType",
"enum",
"to",
"the",
"numeric",
"Flickr",
"member",
"type",
"id",
"."
] | ab7a4b7462d08bcbfd9b98bd3f5029771c20f6c6 | https://github.com/jeremybrooks/jinx/blob/ab7a4b7462d08bcbfd9b98bd3f5029771c20f6c6/src/main/java/net/jeremybrooks/jinx/JinxUtils.java#L746-L769 | train |
jeremybrooks/jinx | src/main/java/net/jeremybrooks/jinx/JinxUtils.java | JinxUtils.typeIdToMemberType | public static JinxConstants.MemberType typeIdToMemberType(Integer typeId) {
if (typeId == null) {
return null;
}
JinxConstants.MemberType memberType;
switch (typeId) {
case 1:
memberType = JinxConstants.MemberType.narwhal;
break;
case 2:
memberType = JinxConstants.MemberType.member;
break;
case 3:
memberType = JinxConstants.MemberType.moderator;
break;
case 4:
memberType = JinxConstants.MemberType.admin;
break;
default:
memberType = null;
break;
}
return memberType;
} | java | public static JinxConstants.MemberType typeIdToMemberType(Integer typeId) {
if (typeId == null) {
return null;
}
JinxConstants.MemberType memberType;
switch (typeId) {
case 1:
memberType = JinxConstants.MemberType.narwhal;
break;
case 2:
memberType = JinxConstants.MemberType.member;
break;
case 3:
memberType = JinxConstants.MemberType.moderator;
break;
case 4:
memberType = JinxConstants.MemberType.admin;
break;
default:
memberType = null;
break;
}
return memberType;
} | [
"public",
"static",
"JinxConstants",
".",
"MemberType",
"typeIdToMemberType",
"(",
"Integer",
"typeId",
")",
"{",
"if",
"(",
"typeId",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"JinxConstants",
".",
"MemberType",
"memberType",
";",
"switch",
"(",
"... | Convert a numeric Flickr member type id to a MemberType enum value.
@param typeId the numeric member type id to convert.
@return MemberType enum value corresponding to the id, or null if the typeId is not a valid Flickr member type. | [
"Convert",
"a",
"numeric",
"Flickr",
"member",
"type",
"id",
"to",
"a",
"MemberType",
"enum",
"value",
"."
] | ab7a4b7462d08bcbfd9b98bd3f5029771c20f6c6 | https://github.com/jeremybrooks/jinx/blob/ab7a4b7462d08bcbfd9b98bd3f5029771c20f6c6/src/main/java/net/jeremybrooks/jinx/JinxUtils.java#L777-L800 | train |
jeremybrooks/jinx | src/main/java/net/jeremybrooks/jinx/JinxUtils.java | JinxUtils.groupPrivacyEnumToPrivacyId | public static Integer groupPrivacyEnumToPrivacyId(JinxConstants.GroupPrivacy privacy) {
if (privacy == null) {
return null;
}
Integer id;
switch (privacy) {
case group_private:
id = 1;
break;
case group_invite_only_public:
id = 2;
break;
case group_open_public:
id = 3;
break;
default:
id = null;
break;
}
return id;
} | java | public static Integer groupPrivacyEnumToPrivacyId(JinxConstants.GroupPrivacy privacy) {
if (privacy == null) {
return null;
}
Integer id;
switch (privacy) {
case group_private:
id = 1;
break;
case group_invite_only_public:
id = 2;
break;
case group_open_public:
id = 3;
break;
default:
id = null;
break;
}
return id;
} | [
"public",
"static",
"Integer",
"groupPrivacyEnumToPrivacyId",
"(",
"JinxConstants",
".",
"GroupPrivacy",
"privacy",
")",
"{",
"if",
"(",
"privacy",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"Integer",
"id",
";",
"switch",
"(",
"privacy",
")",
"{",
... | Convert a GroupPrivacy enum value to the corresponding Flickr numeric identifier.
@param privacy group privacy enum to convert.
@return corresponding Flickr number id for the group privacy, or null if the parameter is invalid. | [
"Convert",
"a",
"GroupPrivacy",
"enum",
"value",
"to",
"the",
"corresponding",
"Flickr",
"numeric",
"identifier",
"."
] | ab7a4b7462d08bcbfd9b98bd3f5029771c20f6c6 | https://github.com/jeremybrooks/jinx/blob/ab7a4b7462d08bcbfd9b98bd3f5029771c20f6c6/src/main/java/net/jeremybrooks/jinx/JinxUtils.java#L808-L828 | train |
jeremybrooks/jinx | src/main/java/net/jeremybrooks/jinx/JinxUtils.java | JinxUtils.privacyIdToGroupPrivacyEnum | public static JinxConstants.GroupPrivacy privacyIdToGroupPrivacyEnum(Integer id) {
if (id == null) {
return null;
}
JinxConstants.GroupPrivacy privacy;
switch (id) {
case 1:
privacy = JinxConstants.GroupPrivacy.group_private;
break;
case 2:
privacy = JinxConstants.GroupPrivacy.group_invite_only_public;
break;
case 3:
privacy = JinxConstants.GroupPrivacy.group_open_public;
break;
default:
privacy = null;
break;
}
return privacy;
} | java | public static JinxConstants.GroupPrivacy privacyIdToGroupPrivacyEnum(Integer id) {
if (id == null) {
return null;
}
JinxConstants.GroupPrivacy privacy;
switch (id) {
case 1:
privacy = JinxConstants.GroupPrivacy.group_private;
break;
case 2:
privacy = JinxConstants.GroupPrivacy.group_invite_only_public;
break;
case 3:
privacy = JinxConstants.GroupPrivacy.group_open_public;
break;
default:
privacy = null;
break;
}
return privacy;
} | [
"public",
"static",
"JinxConstants",
".",
"GroupPrivacy",
"privacyIdToGroupPrivacyEnum",
"(",
"Integer",
"id",
")",
"{",
"if",
"(",
"id",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"JinxConstants",
".",
"GroupPrivacy",
"privacy",
";",
"switch",
"(",
... | Convert a Flickr group privacy numeric identifier to the corresponding GroupPrivacy enum value.
@param id Flickr group privacy id.
@return corresponding GroupPrivacy enum value, or null if the parameter is invalid. | [
"Convert",
"a",
"Flickr",
"group",
"privacy",
"numeric",
"identifier",
"to",
"the",
"corresponding",
"GroupPrivacy",
"enum",
"value",
"."
] | ab7a4b7462d08bcbfd9b98bd3f5029771c20f6c6 | https://github.com/jeremybrooks/jinx/blob/ab7a4b7462d08bcbfd9b98bd3f5029771c20f6c6/src/main/java/net/jeremybrooks/jinx/JinxUtils.java#L836-L856 | train |
jeremybrooks/jinx | src/main/java/net/jeremybrooks/jinx/JinxUtils.java | JinxUtils.suggestionStatusToFlickrSuggestionStatusId | public static Integer suggestionStatusToFlickrSuggestionStatusId(JinxConstants.SuggestionStatus status) {
if (status == null) {
return null;
}
Integer id;
switch (status) {
case pending:
id = 0;
break;
case approved:
id = 1;
break;
case rejected:
id = 2;
break;
default:
id = null;
break;
}
return id;
} | java | public static Integer suggestionStatusToFlickrSuggestionStatusId(JinxConstants.SuggestionStatus status) {
if (status == null) {
return null;
}
Integer id;
switch (status) {
case pending:
id = 0;
break;
case approved:
id = 1;
break;
case rejected:
id = 2;
break;
default:
id = null;
break;
}
return id;
} | [
"public",
"static",
"Integer",
"suggestionStatusToFlickrSuggestionStatusId",
"(",
"JinxConstants",
".",
"SuggestionStatus",
"status",
")",
"{",
"if",
"(",
"status",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"Integer",
"id",
";",
"switch",
"(",
"status"... | Convert a suggestion status to the corresponding Flickr suggestion status id.
@param status the suggestion status.
@return corresponding Flickr id. | [
"Convert",
"a",
"suggestion",
"status",
"to",
"the",
"corresponding",
"Flickr",
"suggestion",
"status",
"id",
"."
] | ab7a4b7462d08bcbfd9b98bd3f5029771c20f6c6 | https://github.com/jeremybrooks/jinx/blob/ab7a4b7462d08bcbfd9b98bd3f5029771c20f6c6/src/main/java/net/jeremybrooks/jinx/JinxUtils.java#L864-L884 | train |
jeremybrooks/jinx | src/main/java/net/jeremybrooks/jinx/JinxUtils.java | JinxUtils.suggestionStatusIdToSuggestionStatusEnum | public static JinxConstants.SuggestionStatus suggestionStatusIdToSuggestionStatusEnum(Integer id) {
if (id == null) {
return null;
}
JinxConstants.SuggestionStatus status;
switch (id) {
case 0:
status = JinxConstants.SuggestionStatus.pending;
break;
case 1:
status = JinxConstants.SuggestionStatus.approved;
break;
case 2:
status = JinxConstants.SuggestionStatus.rejected;
break;
default:
status = null;
break;
}
return status;
} | java | public static JinxConstants.SuggestionStatus suggestionStatusIdToSuggestionStatusEnum(Integer id) {
if (id == null) {
return null;
}
JinxConstants.SuggestionStatus status;
switch (id) {
case 0:
status = JinxConstants.SuggestionStatus.pending;
break;
case 1:
status = JinxConstants.SuggestionStatus.approved;
break;
case 2:
status = JinxConstants.SuggestionStatus.rejected;
break;
default:
status = null;
break;
}
return status;
} | [
"public",
"static",
"JinxConstants",
".",
"SuggestionStatus",
"suggestionStatusIdToSuggestionStatusEnum",
"(",
"Integer",
"id",
")",
"{",
"if",
"(",
"id",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"JinxConstants",
".",
"SuggestionStatus",
"status",
";",
... | Convert a Flickr suggestion status id to the corresponding SuggestionStatus value.
@param id the Flickr suggestion status id.
@return corresponding SuggestionStatus value. | [
"Convert",
"a",
"Flickr",
"suggestion",
"status",
"id",
"to",
"the",
"corresponding",
"SuggestionStatus",
"value",
"."
] | ab7a4b7462d08bcbfd9b98bd3f5029771c20f6c6 | https://github.com/jeremybrooks/jinx/blob/ab7a4b7462d08bcbfd9b98bd3f5029771c20f6c6/src/main/java/net/jeremybrooks/jinx/JinxUtils.java#L892-L912 | train |
jeremybrooks/jinx | src/main/java/net/jeremybrooks/jinx/api/PhotosetsApi.java | PhotosetsApi.getInfo | public PhotosetInfo getInfo(String photosetId) throws JinxException {
JinxUtils.validateParams(photosetId);
Map<String, String> params = new TreeMap<>();
params.put("method", "flickr.photosets.getInfo");
params.put("photoset_id", photosetId);
return jinx.flickrGet(params, PhotosetInfo.class);
} | java | public PhotosetInfo getInfo(String photosetId) throws JinxException {
JinxUtils.validateParams(photosetId);
Map<String, String> params = new TreeMap<>();
params.put("method", "flickr.photosets.getInfo");
params.put("photoset_id", photosetId);
return jinx.flickrGet(params, PhotosetInfo.class);
} | [
"public",
"PhotosetInfo",
"getInfo",
"(",
"String",
"photosetId",
")",
"throws",
"JinxException",
"{",
"JinxUtils",
".",
"validateParams",
"(",
"photosetId",
")",
";",
"Map",
"<",
"String",
",",
"String",
">",
"params",
"=",
"new",
"TreeMap",
"<>",
"(",
")",... | Gets information about a photoset.
This method does not require authentication.
@param photosetId the id of the photoset to fetch information for.
@return instance of {@link net.jeremybrooks.jinx.response.photosets.PhotosetInfo} with data returned by
the getInfo method. The url is not returned, and some of the counts are not returned by this method.
@throws JinxException if there are any errors.
@see <a href="https://www.flickr.com/services/api/flickr.photosets.getInfo.html">flickr.photosets.getInfo</a> | [
"Gets",
"information",
"about",
"a",
"photoset",
".",
"This",
"method",
"does",
"not",
"require",
"authentication",
"."
] | ab7a4b7462d08bcbfd9b98bd3f5029771c20f6c6 | https://github.com/jeremybrooks/jinx/blob/ab7a4b7462d08bcbfd9b98bd3f5029771c20f6c6/src/main/java/net/jeremybrooks/jinx/api/PhotosetsApi.java#L215-L221 | train |
jeremybrooks/jinx | src/main/java/net/jeremybrooks/jinx/api/StatsApi.java | StatsApi.getCollectionDomains | public Domains getCollectionDomains(Date date, String collectionId, Integer perPage, Integer page) throws JinxException {
JinxUtils.validateParams(date);
Map<String, String> params = new TreeMap<>();
params.put("method", "flickr.stats.getCollectionDomains");
params.put("date", JinxUtils.formatDateAsYMD(date));
if (!JinxUtils.isNullOrEmpty(collectionId)) {
params.put("collection_id", collectionId);
}
if (perPage != null) {
params.put("per_page", perPage.toString());
}
if (page != null) {
params.put("page", page.toString());
}
return jinx.flickrGet(params, Domains.class);
} | java | public Domains getCollectionDomains(Date date, String collectionId, Integer perPage, Integer page) throws JinxException {
JinxUtils.validateParams(date);
Map<String, String> params = new TreeMap<>();
params.put("method", "flickr.stats.getCollectionDomains");
params.put("date", JinxUtils.formatDateAsYMD(date));
if (!JinxUtils.isNullOrEmpty(collectionId)) {
params.put("collection_id", collectionId);
}
if (perPage != null) {
params.put("per_page", perPage.toString());
}
if (page != null) {
params.put("page", page.toString());
}
return jinx.flickrGet(params, Domains.class);
} | [
"public",
"Domains",
"getCollectionDomains",
"(",
"Date",
"date",
",",
"String",
"collectionId",
",",
"Integer",
"perPage",
",",
"Integer",
"page",
")",
"throws",
"JinxException",
"{",
"JinxUtils",
".",
"validateParams",
"(",
"date",
")",
";",
"Map",
"<",
"Str... | Get a list of referring domains for a collection
Authentication
This method requires authentication with 'read' permission.
@param date stats will be returned for this date. Required.
@param collectionId id of the collection to get stats for. If not provided,
stats for all collections will be returned. Optional.
@param perPage number of domains to return per page.
If this argument is omitted, it defaults to 25.
The maximum allowed value is 100. Optional.
@param page the page of results to return. If this argument is omitted, it defaults to 1. Optional.
@return referring domains for a collection.
@throws JinxException if required parameters are missing, or if there are any errors.
@see <a href="https://www.flickr.com/services/api/flickr.stats.getCollectionDomains.html">flickr.stats.getCollectionDomains</a> | [
"Get",
"a",
"list",
"of",
"referring",
"domains",
"for",
"a",
"collection"
] | ab7a4b7462d08bcbfd9b98bd3f5029771c20f6c6 | https://github.com/jeremybrooks/jinx/blob/ab7a4b7462d08bcbfd9b98bd3f5029771c20f6c6/src/main/java/net/jeremybrooks/jinx/api/StatsApi.java#L68-L83 | train |
jeremybrooks/jinx | src/main/java/net/jeremybrooks/jinx/api/StatsApi.java | StatsApi.getPhotosetStats | public Stats getPhotosetStats(Date date, String photosetId) throws JinxException {
JinxUtils.validateParams(date, photosetId);
Map<String, String> params = new TreeMap<>();
params.put("method", "flickr.stats.getPhotosetStats");
params.put("date", JinxUtils.formatDateAsYMD(date));
params.put("photoset_id", photosetId);
return jinx.flickrGet(params, Stats.class);
} | java | public Stats getPhotosetStats(Date date, String photosetId) throws JinxException {
JinxUtils.validateParams(date, photosetId);
Map<String, String> params = new TreeMap<>();
params.put("method", "flickr.stats.getPhotosetStats");
params.put("date", JinxUtils.formatDateAsYMD(date));
params.put("photoset_id", photosetId);
return jinx.flickrGet(params, Stats.class);
} | [
"public",
"Stats",
"getPhotosetStats",
"(",
"Date",
"date",
",",
"String",
"photosetId",
")",
"throws",
"JinxException",
"{",
"JinxUtils",
".",
"validateParams",
"(",
"date",
",",
"photosetId",
")",
";",
"Map",
"<",
"String",
",",
"String",
">",
"params",
"=... | Get the number of views on a photoset for a given date.
This method requires authentication with 'read' permission.
@param date stats will be returned for this date. Required.
@param photosetId id of the photoset to get stats for. Required.
@return number of views on a photoset for a given date.
@throws JinxException if required parameters are missing, or if there are any errors.
@see <a href="https://www.flickr.com/services/api/flickr.stats.getPhotosetStats.html">flickr.stats.getPhotosetStats</a> | [
"Get",
"the",
"number",
"of",
"views",
"on",
"a",
"photoset",
"for",
"a",
"given",
"date",
"."
] | ab7a4b7462d08bcbfd9b98bd3f5029771c20f6c6 | https://github.com/jeremybrooks/jinx/blob/ab7a4b7462d08bcbfd9b98bd3f5029771c20f6c6/src/main/java/net/jeremybrooks/jinx/api/StatsApi.java#L310-L317 | train |
jeremybrooks/jinx | src/main/java/net/jeremybrooks/jinx/api/StatsApi.java | StatsApi.getPopularPhotos | public Photos getPopularPhotos(Date date, JinxConstants.PopularPhotoSort sort, Integer perPage, Integer page) throws JinxException {
Map<String, String> params = new TreeMap<>();
params.put("method", "flickr.stats.getPopularPhotos");
if (date != null) {
params.put("date", JinxUtils.formatDateAsYMD(date));
}
if (sort != null) {
params.put("sort", sort.toString());
}
if (perPage != null) {
params.put("per_page", perPage.toString());
}
if (page != null) {
params.put("page", page.toString());
}
return jinx.flickrGet(params, Photos.class);
} | java | public Photos getPopularPhotos(Date date, JinxConstants.PopularPhotoSort sort, Integer perPage, Integer page) throws JinxException {
Map<String, String> params = new TreeMap<>();
params.put("method", "flickr.stats.getPopularPhotos");
if (date != null) {
params.put("date", JinxUtils.formatDateAsYMD(date));
}
if (sort != null) {
params.put("sort", sort.toString());
}
if (perPage != null) {
params.put("per_page", perPage.toString());
}
if (page != null) {
params.put("page", page.toString());
}
return jinx.flickrGet(params, Photos.class);
} | [
"public",
"Photos",
"getPopularPhotos",
"(",
"Date",
"date",
",",
"JinxConstants",
".",
"PopularPhotoSort",
"sort",
",",
"Integer",
"perPage",
",",
"Integer",
"page",
")",
"throws",
"JinxException",
"{",
"Map",
"<",
"String",
",",
"String",
">",
"params",
"=",... | List the photos with the most views, comments or favorites
This method requires authentication with 'read' permission.
@param date stats will be returned for this date. Optional.
@param sort order in which to sort returned photos. Defaults to views. Optional.
@param perPage number of referrers to return per page. If this argument is omitted, it defaults to
25. The maximum allowed value is 100. Optional.
@param page page of results to return. If this argument is omitted, it defaults to 1. Optional.
@return photos with the most views, comments, or favorites.
@throws JinxException if there are any errors.
@see <a href="https://www.flickr.com/services/api/flickr.stats.getPopularPhotos.html">flickr.stats.getPopularPhotos</a> | [
"List",
"the",
"photos",
"with",
"the",
"most",
"views",
"comments",
"or",
"favorites"
] | ab7a4b7462d08bcbfd9b98bd3f5029771c20f6c6 | https://github.com/jeremybrooks/jinx/blob/ab7a4b7462d08bcbfd9b98bd3f5029771c20f6c6/src/main/java/net/jeremybrooks/jinx/api/StatsApi.java#L427-L443 | train |
jeremybrooks/jinx | src/main/java/net/jeremybrooks/jinx/api/UrlsApi.java | UrlsApi.getGroup | public GroupUrls getGroup(String groupId) throws JinxException {
JinxUtils.validateParams(groupId);
Map<String, String> params = new TreeMap<>();
params.put("method", "flickr.urls.getGroup");
params.put("group_id", groupId);
return jinx.flickrGet(params, GroupUrls.class, false);
} | java | public GroupUrls getGroup(String groupId) throws JinxException {
JinxUtils.validateParams(groupId);
Map<String, String> params = new TreeMap<>();
params.put("method", "flickr.urls.getGroup");
params.put("group_id", groupId);
return jinx.flickrGet(params, GroupUrls.class, false);
} | [
"public",
"GroupUrls",
"getGroup",
"(",
"String",
"groupId",
")",
"throws",
"JinxException",
"{",
"JinxUtils",
".",
"validateParams",
"(",
"groupId",
")",
";",
"Map",
"<",
"String",
",",
"String",
">",
"params",
"=",
"new",
"TreeMap",
"<>",
"(",
")",
";",
... | Returns the url to a group's page.
This method does not require authentication.
@param groupId NSID of the group to fetch the url for. Required.
@return group NSID and URL.
@throws JinxException if groupId parameter is missing, or if there are any errors.
@see <a href="https://www.flickr.com/services/api/flickr.urls.getGroup.html">flickr.urls.getGroup</a> | [
"Returns",
"the",
"url",
"to",
"a",
"group",
"s",
"page",
"."
] | ab7a4b7462d08bcbfd9b98bd3f5029771c20f6c6 | https://github.com/jeremybrooks/jinx/blob/ab7a4b7462d08bcbfd9b98bd3f5029771c20f6c6/src/main/java/net/jeremybrooks/jinx/api/UrlsApi.java#L56-L62 | train |
jeremybrooks/jinx | src/main/java/net/jeremybrooks/jinx/api/UrlsApi.java | UrlsApi.getUserPhotos | public UserUrls getUserPhotos(String userId) throws JinxException {
Map<String, String> params = new TreeMap<>();
params.put("method", "flickr.urls.getUserPhotos");
if (!JinxUtils.isNullOrEmpty(userId)) {
params.put("user_id", userId);
}
return jinx.flickrGet(params, UserUrls.class);
} | java | public UserUrls getUserPhotos(String userId) throws JinxException {
Map<String, String> params = new TreeMap<>();
params.put("method", "flickr.urls.getUserPhotos");
if (!JinxUtils.isNullOrEmpty(userId)) {
params.put("user_id", userId);
}
return jinx.flickrGet(params, UserUrls.class);
} | [
"public",
"UserUrls",
"getUserPhotos",
"(",
"String",
"userId",
")",
"throws",
"JinxException",
"{",
"Map",
"<",
"String",
",",
"String",
">",
"params",
"=",
"new",
"TreeMap",
"<>",
"(",
")",
";",
"params",
".",
"put",
"(",
"\"method\"",
",",
"\"flickr.url... | Returns the url to a user's photos.
This method does not require authentication.
@param userId user id (NSID) of the user to fetch the url for. If omitted, the calling user is assumed. Optional.
@return user id and rl to the users photos.
@throws JinxException if there are any errors.
@see <a href="https://www.flickr.com/services/api/flickr.urls.getUserPhotos.html">flickr.urls.getUserPhotos</a> | [
"Returns",
"the",
"url",
"to",
"a",
"user",
"s",
"photos",
"."
] | ab7a4b7462d08bcbfd9b98bd3f5029771c20f6c6 | https://github.com/jeremybrooks/jinx/blob/ab7a4b7462d08bcbfd9b98bd3f5029771c20f6c6/src/main/java/net/jeremybrooks/jinx/api/UrlsApi.java#L75-L82 | train |
jeremybrooks/jinx | src/main/java/net/jeremybrooks/jinx/api/UrlsApi.java | UrlsApi.lookupGallery | public GalleryInfo lookupGallery(String url) throws JinxException {
JinxUtils.validateParams(url);
Map<String, String> params = new TreeMap<>();
params.put("method", "flickr.urls.lookupGallery");
params.put("url", url);
return jinx.flickrGet(params, GalleryInfo.class);
} | java | public GalleryInfo lookupGallery(String url) throws JinxException {
JinxUtils.validateParams(url);
Map<String, String> params = new TreeMap<>();
params.put("method", "flickr.urls.lookupGallery");
params.put("url", url);
return jinx.flickrGet(params, GalleryInfo.class);
} | [
"public",
"GalleryInfo",
"lookupGallery",
"(",
"String",
"url",
")",
"throws",
"JinxException",
"{",
"JinxUtils",
".",
"validateParams",
"(",
"url",
")",
";",
"Map",
"<",
"String",
",",
"String",
">",
"params",
"=",
"new",
"TreeMap",
"<>",
"(",
")",
";",
... | Returns gallery info, by url.
This method does not require authentication.
@param url gallery URL to look up. Required.
@return information about the gallery.
@throws JinxException if required parameters are missing, or if there are any errors.
@see <a href="https://www.flickr.com/services/api/flickr.urls.lookupGallery.html">flickr.urls.lookupGallery</a> | [
"Returns",
"gallery",
"info",
"by",
"url",
"."
] | ab7a4b7462d08bcbfd9b98bd3f5029771c20f6c6 | https://github.com/jeremybrooks/jinx/blob/ab7a4b7462d08bcbfd9b98bd3f5029771c20f6c6/src/main/java/net/jeremybrooks/jinx/api/UrlsApi.java#L113-L119 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.