id int32 0 165k | repo stringlengths 7 58 | path stringlengths 12 218 | func_name stringlengths 3 140 | original_string stringlengths 73 34.1k | language stringclasses 1
value | code stringlengths 73 34.1k | code_tokens list | docstring stringlengths 3 16k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 105 339 |
|---|---|---|---|---|---|---|---|---|---|---|---|
157,800 | uwolfer/gerrit-rest-java-client | src/main/java/com/urswolfer/gerrit/client/rest/http/PreemptiveAuthHttpRequestInterceptor.java | PreemptiveAuthHttpRequestInterceptor.isForGerritHost | private boolean isForGerritHost(HttpRequest request) {
if (!(request instanceof HttpRequestWrapper)) return false;
HttpRequest originalRequest = ((HttpRequestWrapper) request).getOriginal();
if (!(originalRequest instanceof HttpRequestBase)) return false;
URI uri = ((HttpRequestBase) ori... | java | private boolean isForGerritHost(HttpRequest request) {
if (!(request instanceof HttpRequestWrapper)) return false;
HttpRequest originalRequest = ((HttpRequestWrapper) request).getOriginal();
if (!(originalRequest instanceof HttpRequestBase)) return false;
URI uri = ((HttpRequestBase) ori... | [
"private",
"boolean",
"isForGerritHost",
"(",
"HttpRequest",
"request",
")",
"{",
"if",
"(",
"!",
"(",
"request",
"instanceof",
"HttpRequestWrapper",
")",
")",
"return",
"false",
";",
"HttpRequest",
"originalRequest",
"=",
"(",
"(",
"HttpRequestWrapper",
")",
"r... | Checks if request is intended for Gerrit host. | [
"Checks",
"if",
"request",
"is",
"intended",
"for",
"Gerrit",
"host",
"."
] | fa66cd76270cd12cff9e30e0d96826fe0253d209 | https://github.com/uwolfer/gerrit-rest-java-client/blob/fa66cd76270cd12cff9e30e0d96826fe0253d209/src/main/java/com/urswolfer/gerrit/client/rest/http/PreemptiveAuthHttpRequestInterceptor.java#L54-L64 |
157,801 | cloudfoundry/cf-java-client | cloudfoundry-util/src/main/java/org/cloudfoundry/util/FileUtils.java | FileUtils.getRelativePathName | public static String getRelativePathName(Path root, Path path) {
Path relative = root.relativize(path);
return Files.isDirectory(path) && !relative.toString().endsWith("/") ? String.format("%s/", relative.toString()) : relative.toString();
} | java | public static String getRelativePathName(Path root, Path path) {
Path relative = root.relativize(path);
return Files.isDirectory(path) && !relative.toString().endsWith("/") ? String.format("%s/", relative.toString()) : relative.toString();
} | [
"public",
"static",
"String",
"getRelativePathName",
"(",
"Path",
"root",
",",
"Path",
"path",
")",
"{",
"Path",
"relative",
"=",
"root",
".",
"relativize",
"(",
"path",
")",
";",
"return",
"Files",
".",
"isDirectory",
"(",
"path",
")",
"&&",
"!",
"relat... | Get the relative path of an application
@param root the root to relativize against
@param path the path to relativize
@return the relative path | [
"Get",
"the",
"relative",
"path",
"of",
"an",
"application"
] | caa1cb889cfe8717614c071703d833a1540784df | https://github.com/cloudfoundry/cf-java-client/blob/caa1cb889cfe8717614c071703d833a1540784df/cloudfoundry-util/src/main/java/org/cloudfoundry/util/FileUtils.java#L108-L111 |
157,802 | cloudfoundry/cf-java-client | cloudfoundry-client-reactor/src/main/java/org/cloudfoundry/reactor/_DefaultConnectionContext.java | _DefaultConnectionContext.dispose | @PreDestroy
public final void dispose() {
getConnectionPool().ifPresent(PoolResources::dispose);
getThreadPool().dispose();
try {
ObjectName name = getByteBufAllocatorObjectName();
if (ManagementFactory.getPlatformMBeanServer().isRegistered(name)) {
... | java | @PreDestroy
public final void dispose() {
getConnectionPool().ifPresent(PoolResources::dispose);
getThreadPool().dispose();
try {
ObjectName name = getByteBufAllocatorObjectName();
if (ManagementFactory.getPlatformMBeanServer().isRegistered(name)) {
... | [
"@",
"PreDestroy",
"public",
"final",
"void",
"dispose",
"(",
")",
"{",
"getConnectionPool",
"(",
")",
".",
"ifPresent",
"(",
"PoolResources",
"::",
"dispose",
")",
";",
"getThreadPool",
"(",
")",
".",
"dispose",
"(",
")",
";",
"try",
"{",
"ObjectName",
... | Disposes resources created to service this connection context | [
"Disposes",
"resources",
"created",
"to",
"service",
"this",
"connection",
"context"
] | caa1cb889cfe8717614c071703d833a1540784df | https://github.com/cloudfoundry/cf-java-client/blob/caa1cb889cfe8717614c071703d833a1540784df/cloudfoundry-client-reactor/src/main/java/org/cloudfoundry/reactor/_DefaultConnectionContext.java#L70-L84 |
157,803 | cloudfoundry/cf-java-client | cloudfoundry-util/src/main/java/org/cloudfoundry/util/ResourceUtils.java | ResourceUtils.getEntity | public static <T, R extends Resource<T>> T getEntity(R resource) {
return resource.getEntity();
} | java | public static <T, R extends Resource<T>> T getEntity(R resource) {
return resource.getEntity();
} | [
"public",
"static",
"<",
"T",
",",
"R",
"extends",
"Resource",
"<",
"T",
">",
">",
"T",
"getEntity",
"(",
"R",
"resource",
")",
"{",
"return",
"resource",
".",
"getEntity",
"(",
")",
";",
"}"
] | Return the entity of a resource
@param resource the resource
@param <T> the type of the resource's entity
@param <R> the resource type
@return the resource's entity | [
"Return",
"the",
"entity",
"of",
"a",
"resource"
] | caa1cb889cfe8717614c071703d833a1540784df | https://github.com/cloudfoundry/cf-java-client/blob/caa1cb889cfe8717614c071703d833a1540784df/cloudfoundry-util/src/main/java/org/cloudfoundry/util/ResourceUtils.java#L39-L41 |
157,804 | cloudfoundry/cf-java-client | cloudfoundry-util/src/main/java/org/cloudfoundry/util/ResourceUtils.java | ResourceUtils.getResources | public static <R extends Resource<?>, U extends PaginatedResponse<R>> Flux<R> getResources(U response) {
return Flux.fromIterable(response.getResources());
} | java | public static <R extends Resource<?>, U extends PaginatedResponse<R>> Flux<R> getResources(U response) {
return Flux.fromIterable(response.getResources());
} | [
"public",
"static",
"<",
"R",
"extends",
"Resource",
"<",
"?",
">",
",",
"U",
"extends",
"PaginatedResponse",
"<",
"R",
">",
">",
"Flux",
"<",
"R",
">",
"getResources",
"(",
"U",
"response",
")",
"{",
"return",
"Flux",
".",
"fromIterable",
"(",
"respon... | Return a stream of resources from a response
@param response the response
@param <R> the resource type
@param <U> the response type
@return a stream of resources from the response | [
"Return",
"a",
"stream",
"of",
"resources",
"from",
"a",
"response"
] | caa1cb889cfe8717614c071703d833a1540784df | https://github.com/cloudfoundry/cf-java-client/blob/caa1cb889cfe8717614c071703d833a1540784df/cloudfoundry-util/src/main/java/org/cloudfoundry/util/ResourceUtils.java#L61-L63 |
157,805 | cloudfoundry/cf-java-client | cloudfoundry-util/src/main/java/org/cloudfoundry/util/JobUtils.java | JobUtils.waitForCompletion | public static Mono<Void> waitForCompletion(CloudFoundryClient cloudFoundryClient, Duration completionTimeout, String jobId) {
return requestJobV3(cloudFoundryClient, jobId)
.filter(job -> JobState.PROCESSING != job.getState())
.repeatWhenEmpty(exponentialBackOff(Duration.ofSeconds(1), Du... | java | public static Mono<Void> waitForCompletion(CloudFoundryClient cloudFoundryClient, Duration completionTimeout, String jobId) {
return requestJobV3(cloudFoundryClient, jobId)
.filter(job -> JobState.PROCESSING != job.getState())
.repeatWhenEmpty(exponentialBackOff(Duration.ofSeconds(1), Du... | [
"public",
"static",
"Mono",
"<",
"Void",
">",
"waitForCompletion",
"(",
"CloudFoundryClient",
"cloudFoundryClient",
",",
"Duration",
"completionTimeout",
",",
"String",
"jobId",
")",
"{",
"return",
"requestJobV3",
"(",
"cloudFoundryClient",
",",
"jobId",
")",
".",
... | Waits for a job V3 to complete
@param cloudFoundryClient the client to use to request job status
@param completionTimeout the amount of time to wait for the job to complete.
@param jobId the id of the job
@return {@code onComplete} once job has completed | [
"Waits",
"for",
"a",
"job",
"V3",
"to",
"complete"
] | caa1cb889cfe8717614c071703d833a1540784df | https://github.com/cloudfoundry/cf-java-client/blob/caa1cb889cfe8717614c071703d833a1540784df/cloudfoundry-util/src/main/java/org/cloudfoundry/util/JobUtils.java#L93-L99 |
157,806 | cloudfoundry/cf-java-client | cloudfoundry-util/src/main/java/org/cloudfoundry/util/TimeUtils.java | TimeUtils.asTime | public static String asTime(long time) {
if (time > HOUR) {
return String.format("%.1f h", (time / HOUR));
} else if (time > MINUTE) {
return String.format("%.1f m", (time / MINUTE));
} else if (time > SECOND) {
return String.format("%.1f s", (time / SECOND));... | java | public static String asTime(long time) {
if (time > HOUR) {
return String.format("%.1f h", (time / HOUR));
} else if (time > MINUTE) {
return String.format("%.1f m", (time / MINUTE));
} else if (time > SECOND) {
return String.format("%.1f s", (time / SECOND));... | [
"public",
"static",
"String",
"asTime",
"(",
"long",
"time",
")",
"{",
"if",
"(",
"time",
">",
"HOUR",
")",
"{",
"return",
"String",
".",
"format",
"(",
"\"%.1f h\"",
",",
"(",
"time",
"/",
"HOUR",
")",
")",
";",
"}",
"else",
"if",
"(",
"time",
"... | Renders a time period in human readable form
@param time the time in milliseconds
@return the time in human readable form | [
"Renders",
"a",
"time",
"period",
"in",
"human",
"readable",
"form"
] | caa1cb889cfe8717614c071703d833a1540784df | https://github.com/cloudfoundry/cf-java-client/blob/caa1cb889cfe8717614c071703d833a1540784df/cloudfoundry-util/src/main/java/org/cloudfoundry/util/TimeUtils.java#L41-L51 |
157,807 | dspinellis/UMLGraph | src/main/java/org/umlgraph/doclet/View.java | View.buildMatcher | private ClassMatcher buildMatcher(String tagText) {
// check there are at least @match <type> and a parameter
String[] strings = StringUtil.tokenize(tagText);
if (strings.length < 2) {
System.err.println("Skipping uncomplete @match tag, type missing: " + tagText + " in view " + viewDoc);
return null;
}
... | java | private ClassMatcher buildMatcher(String tagText) {
// check there are at least @match <type> and a parameter
String[] strings = StringUtil.tokenize(tagText);
if (strings.length < 2) {
System.err.println("Skipping uncomplete @match tag, type missing: " + tagText + " in view " + viewDoc);
return null;
}
... | [
"private",
"ClassMatcher",
"buildMatcher",
"(",
"String",
"tagText",
")",
"{",
"// check there are at least @match <type> and a parameter",
"String",
"[",
"]",
"strings",
"=",
"StringUtil",
".",
"tokenize",
"(",
"tagText",
")",
";",
"if",
"(",
"strings",
".",
"lengt... | Factory method that builds the appropriate matcher for @match tags | [
"Factory",
"method",
"that",
"builds",
"the",
"appropriate",
"matcher",
"for"
] | 09576db5ae0ea63bfe30ef9fce88a513f9a8d843 | https://github.com/dspinellis/UMLGraph/blob/09576db5ae0ea63bfe30ef9fce88a513f9a8d843/src/main/java/org/umlgraph/doclet/View.java#L85-L118 |
157,808 | dspinellis/UMLGraph | src/main/java/org/umlgraph/doclet/ContextMatcher.java | ContextMatcher.addToGraph | private void addToGraph(ClassDoc cd) {
// avoid adding twice the same class, but don't rely on cg.getClassInfo
// since there are other ways to add a classInfor than printing the class
if (visited.contains(cd.toString()))
return;
visited.add(cd.toString());
cg.printClass(cd, false);
cg.printRelations(cd);
... | java | private void addToGraph(ClassDoc cd) {
// avoid adding twice the same class, but don't rely on cg.getClassInfo
// since there are other ways to add a classInfor than printing the class
if (visited.contains(cd.toString()))
return;
visited.add(cd.toString());
cg.printClass(cd, false);
cg.printRelations(cd);
... | [
"private",
"void",
"addToGraph",
"(",
"ClassDoc",
"cd",
")",
"{",
"// avoid adding twice the same class, but don't rely on cg.getClassInfo",
"// since there are other ways to add a classInfor than printing the class",
"if",
"(",
"visited",
".",
"contains",
"(",
"cd",
".",
"toStri... | Adds the specified class to the internal class graph along with its
relations and dependencies, eventually inferring them, according to the
Options specified for this matcher
@param cd | [
"Adds",
"the",
"specified",
"class",
"to",
"the",
"internal",
"class",
"graph",
"along",
"with",
"its",
"relations",
"and",
"dependencies",
"eventually",
"inferring",
"them",
"according",
"to",
"the",
"Options",
"specified",
"for",
"this",
"matcher"
] | 09576db5ae0ea63bfe30ef9fce88a513f9a8d843 | https://github.com/dspinellis/UMLGraph/blob/09576db5ae0ea63bfe30ef9fce88a513f9a8d843/src/main/java/org/umlgraph/doclet/ContextMatcher.java#L104-L117 |
157,809 | dspinellis/UMLGraph | src/main/java/org/umlgraph/doclet/UmlGraphDoc.java | UmlGraphDoc.optionLength | public static int optionLength(String option) {
int result = Standard.optionLength(option);
if (result != 0)
return result;
else
return UmlGraph.optionLength(option);
} | java | public static int optionLength(String option) {
int result = Standard.optionLength(option);
if (result != 0)
return result;
else
return UmlGraph.optionLength(option);
} | [
"public",
"static",
"int",
"optionLength",
"(",
"String",
"option",
")",
"{",
"int",
"result",
"=",
"Standard",
".",
"optionLength",
"(",
"option",
")",
";",
"if",
"(",
"result",
"!=",
"0",
")",
"return",
"result",
";",
"else",
"return",
"UmlGraph",
".",... | Option check, forwards options to the standard doclet, if that one refuses them,
they are sent to UmlGraph | [
"Option",
"check",
"forwards",
"options",
"to",
"the",
"standard",
"doclet",
"if",
"that",
"one",
"refuses",
"them",
"they",
"are",
"sent",
"to",
"UmlGraph"
] | 09576db5ae0ea63bfe30ef9fce88a513f9a8d843 | https://github.com/dspinellis/UMLGraph/blob/09576db5ae0ea63bfe30ef9fce88a513f9a8d843/src/main/java/org/umlgraph/doclet/UmlGraphDoc.java#L36-L42 |
157,810 | dspinellis/UMLGraph | src/main/java/org/umlgraph/doclet/UmlGraphDoc.java | UmlGraphDoc.start | public static boolean start(RootDoc root) {
root.printNotice("UmlGraphDoc version " + Version.VERSION + ", running the standard doclet");
Standard.start(root);
root.printNotice("UmlGraphDoc version " + Version.VERSION + ", altering javadocs");
try {
String outputFolder = findOutputPath(root.options());
... | java | public static boolean start(RootDoc root) {
root.printNotice("UmlGraphDoc version " + Version.VERSION + ", running the standard doclet");
Standard.start(root);
root.printNotice("UmlGraphDoc version " + Version.VERSION + ", altering javadocs");
try {
String outputFolder = findOutputPath(root.options());
... | [
"public",
"static",
"boolean",
"start",
"(",
"RootDoc",
"root",
")",
"{",
"root",
".",
"printNotice",
"(",
"\"UmlGraphDoc version \"",
"+",
"Version",
".",
"VERSION",
"+",
"\", running the standard doclet\"",
")",
";",
"Standard",
".",
"start",
"(",
"root",
")",... | Standard doclet entry point
@param root
@return | [
"Standard",
"doclet",
"entry",
"point"
] | 09576db5ae0ea63bfe30ef9fce88a513f9a8d843 | https://github.com/dspinellis/UMLGraph/blob/09576db5ae0ea63bfe30ef9fce88a513f9a8d843/src/main/java/org/umlgraph/doclet/UmlGraphDoc.java#L49-L73 |
157,811 | dspinellis/UMLGraph | src/main/java/org/umlgraph/doclet/UmlGraphDoc.java | UmlGraphDoc.generateContextDiagrams | private static void generateContextDiagrams(RootDoc root, Options opt, String outputFolder)
throws IOException {
Set<ClassDoc> classDocs = new TreeSet<ClassDoc>(new Comparator<ClassDoc>() {
public int compare(ClassDoc cd1, ClassDoc cd2) {
return cd1.name().compareTo(cd2.name());... | java | private static void generateContextDiagrams(RootDoc root, Options opt, String outputFolder)
throws IOException {
Set<ClassDoc> classDocs = new TreeSet<ClassDoc>(new Comparator<ClassDoc>() {
public int compare(ClassDoc cd1, ClassDoc cd2) {
return cd1.name().compareTo(cd2.name());... | [
"private",
"static",
"void",
"generateContextDiagrams",
"(",
"RootDoc",
"root",
",",
"Options",
"opt",
",",
"String",
"outputFolder",
")",
"throws",
"IOException",
"{",
"Set",
"<",
"ClassDoc",
">",
"classDocs",
"=",
"new",
"TreeSet",
"<",
"ClassDoc",
">",
"(",... | Generates the context diagram for a single class | [
"Generates",
"the",
"context",
"diagram",
"for",
"a",
"single",
"class"
] | 09576db5ae0ea63bfe30ef9fce88a513f9a8d843 | https://github.com/dspinellis/UMLGraph/blob/09576db5ae0ea63bfe30ef9fce88a513f9a8d843/src/main/java/org/umlgraph/doclet/UmlGraphDoc.java#L106-L131 |
157,812 | dspinellis/UMLGraph | src/main/java/org/umlgraph/doclet/UmlGraphDoc.java | UmlGraphDoc.alterHtmlDocs | private static void alterHtmlDocs(Options opt, String outputFolder, String packageName, String className,
String htmlFileName, Pattern insertPointPattern, RootDoc root) throws IOException {
// setup files
File output = new File(outputFolder, packageName.replace(".", "/"));
File htmlFile = new File(output, htmlF... | java | private static void alterHtmlDocs(Options opt, String outputFolder, String packageName, String className,
String htmlFileName, Pattern insertPointPattern, RootDoc root) throws IOException {
// setup files
File output = new File(outputFolder, packageName.replace(".", "/"));
File htmlFile = new File(output, htmlF... | [
"private",
"static",
"void",
"alterHtmlDocs",
"(",
"Options",
"opt",
",",
"String",
"outputFolder",
",",
"String",
"packageName",
",",
"String",
"className",
",",
"String",
"htmlFileName",
",",
"Pattern",
"insertPointPattern",
",",
"RootDoc",
"root",
")",
"throws"... | Takes an HTML file, looks for the first instance of the specified insertion point, and
inserts the diagram image reference and a client side map in that point. | [
"Takes",
"an",
"HTML",
"file",
"looks",
"for",
"the",
"first",
"instance",
"of",
"the",
"specified",
"insertion",
"point",
"and",
"inserts",
"the",
"diagram",
"image",
"reference",
"and",
"a",
"client",
"side",
"map",
"in",
"that",
"point",
"."
] | 09576db5ae0ea63bfe30ef9fce88a513f9a8d843 | https://github.com/dspinellis/UMLGraph/blob/09576db5ae0ea63bfe30ef9fce88a513f9a8d843/src/main/java/org/umlgraph/doclet/UmlGraphDoc.java#L199-L258 |
157,813 | dspinellis/UMLGraph | src/main/java/org/umlgraph/doclet/UmlGraphDoc.java | UmlGraphDoc.findOutputPath | private static String findOutputPath(String[][] options) {
for (int i = 0; i < options.length; i++) {
if (options[i][0].equals("-d"))
return options[i][1];
}
return ".";
} | java | private static String findOutputPath(String[][] options) {
for (int i = 0; i < options.length; i++) {
if (options[i][0].equals("-d"))
return options[i][1];
}
return ".";
} | [
"private",
"static",
"String",
"findOutputPath",
"(",
"String",
"[",
"]",
"[",
"]",
"options",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"options",
".",
"length",
";",
"i",
"++",
")",
"{",
"if",
"(",
"options",
"[",
"i",
"]",
"... | Returns the output path specified on the javadoc options | [
"Returns",
"the",
"output",
"path",
"specified",
"on",
"the",
"javadoc",
"options"
] | 09576db5ae0ea63bfe30ef9fce88a513f9a8d843 | https://github.com/dspinellis/UMLGraph/blob/09576db5ae0ea63bfe30ef9fce88a513f9a8d843/src/main/java/org/umlgraph/doclet/UmlGraphDoc.java#L263-L269 |
157,814 | dspinellis/UMLGraph | src/main/java/org/umlgraph/doclet/Options.java | Options.setAll | public void setAll() {
showAttributes = true;
showEnumerations = true;
showEnumConstants = true;
showOperations = true;
showConstructors = true;
showVisibility = true;
showType = true;
} | java | public void setAll() {
showAttributes = true;
showEnumerations = true;
showEnumConstants = true;
showOperations = true;
showConstructors = true;
showVisibility = true;
showType = true;
} | [
"public",
"void",
"setAll",
"(",
")",
"{",
"showAttributes",
"=",
"true",
";",
"showEnumerations",
"=",
"true",
";",
"showEnumConstants",
"=",
"true",
";",
"showOperations",
"=",
"true",
";",
"showConstructors",
"=",
"true",
";",
"showVisibility",
"=",
"true",... | Most complete output | [
"Most",
"complete",
"output"
] | 09576db5ae0ea63bfe30ef9fce88a513f9a8d843 | https://github.com/dspinellis/UMLGraph/blob/09576db5ae0ea63bfe30ef9fce88a513f9a8d843/src/main/java/org/umlgraph/doclet/Options.java#L149-L157 |
157,815 | dspinellis/UMLGraph | src/main/java/org/umlgraph/doclet/Options.java | Options.optionLength | public static int optionLength(String option) {
if(matchOption(option, "qualify", true) ||
matchOption(option, "qualifyGenerics", true) ||
matchOption(option, "hideGenerics", true) ||
matchOption(option, "horizontal", true) ||
matchOption(option, "all") ||
... | java | public static int optionLength(String option) {
if(matchOption(option, "qualify", true) ||
matchOption(option, "qualifyGenerics", true) ||
matchOption(option, "hideGenerics", true) ||
matchOption(option, "horizontal", true) ||
matchOption(option, "all") ||
... | [
"public",
"static",
"int",
"optionLength",
"(",
"String",
"option",
")",
"{",
"if",
"(",
"matchOption",
"(",
"option",
",",
"\"qualify\"",
",",
"true",
")",
"||",
"matchOption",
"(",
"option",
",",
"\"qualifyGenerics\"",
",",
"true",
")",
"||",
"matchOption"... | Return the number of arguments associated with the specified option.
The return value includes the actual option.
Will return 0 if the option is not supported. | [
"Return",
"the",
"number",
"of",
"arguments",
"associated",
"with",
"the",
"specified",
"option",
".",
"The",
"return",
"value",
"includes",
"the",
"actual",
"option",
".",
"Will",
"return",
"0",
"if",
"the",
"option",
"is",
"not",
"supported",
"."
] | 09576db5ae0ea63bfe30ef9fce88a513f9a8d843 | https://github.com/dspinellis/UMLGraph/blob/09576db5ae0ea63bfe30ef9fce88a513f9a8d843/src/main/java/org/umlgraph/doclet/Options.java#L192-L257 |
157,816 | dspinellis/UMLGraph | src/main/java/org/umlgraph/doclet/Options.java | Options.addApiDocRoots | private void addApiDocRoots(String packageListUrl) {
BufferedReader br = null;
packageListUrl = fixApiDocRoot(packageListUrl);
try {
URL url = new URL(packageListUrl + "/package-list");
br = new BufferedReader(new InputStreamReader(url.openStream()));
String line;
while((line = br.readLine()) != ... | java | private void addApiDocRoots(String packageListUrl) {
BufferedReader br = null;
packageListUrl = fixApiDocRoot(packageListUrl);
try {
URL url = new URL(packageListUrl + "/package-list");
br = new BufferedReader(new InputStreamReader(url.openStream()));
String line;
while((line = br.readLine()) != ... | [
"private",
"void",
"addApiDocRoots",
"(",
"String",
"packageListUrl",
")",
"{",
"BufferedReader",
"br",
"=",
"null",
";",
"packageListUrl",
"=",
"fixApiDocRoot",
"(",
"packageListUrl",
")",
";",
"try",
"{",
"URL",
"url",
"=",
"new",
"URL",
"(",
"packageListUrl... | Adds api doc roots from a link. The folder reffered by the link should contain a package-list
file that will be parsed in order to add api doc roots to this configuration
@param packageListUrl | [
"Adds",
"api",
"doc",
"roots",
"from",
"a",
"link",
".",
"The",
"folder",
"reffered",
"by",
"the",
"link",
"should",
"contain",
"a",
"package",
"-",
"list",
"file",
"that",
"will",
"be",
"parsed",
"in",
"order",
"to",
"add",
"api",
"doc",
"roots",
"to"... | 09576db5ae0ea63bfe30ef9fce88a513f9a8d843 | https://github.com/dspinellis/UMLGraph/blob/09576db5ae0ea63bfe30ef9fce88a513f9a8d843/src/main/java/org/umlgraph/doclet/Options.java#L459-L481 |
157,817 | dspinellis/UMLGraph | src/main/java/org/umlgraph/doclet/Options.java | Options.fixApiDocRoot | private String fixApiDocRoot(String str) {
if (str == null)
return null;
String fixed = str.trim();
if (fixed.isEmpty())
return "";
if (File.separatorChar != '/')
fixed = fixed.replace(File.separatorChar, '/');
if (!fixed.endsWith("/"))
fixed = fixed + "/";
return fixed;
} | java | private String fixApiDocRoot(String str) {
if (str == null)
return null;
String fixed = str.trim();
if (fixed.isEmpty())
return "";
if (File.separatorChar != '/')
fixed = fixed.replace(File.separatorChar, '/');
if (!fixed.endsWith("/"))
fixed = fixed + "/";
return fixed;
} | [
"private",
"String",
"fixApiDocRoot",
"(",
"String",
"str",
")",
"{",
"if",
"(",
"str",
"==",
"null",
")",
"return",
"null",
";",
"String",
"fixed",
"=",
"str",
".",
"trim",
"(",
")",
";",
"if",
"(",
"fixed",
".",
"isEmpty",
"(",
")",
")",
"return"... | Trim and append a file separator to the string | [
"Trim",
"and",
"append",
"a",
"file",
"separator",
"to",
"the",
"string"
] | 09576db5ae0ea63bfe30ef9fce88a513f9a8d843 | https://github.com/dspinellis/UMLGraph/blob/09576db5ae0ea63bfe30ef9fce88a513f9a8d843/src/main/java/org/umlgraph/doclet/Options.java#L564-L575 |
157,818 | dspinellis/UMLGraph | src/main/java/org/umlgraph/doclet/Options.java | Options.setOptions | public void setOptions(Doc p) {
if (p == null)
return;
for (Tag tag : p.tags("opt"))
setOption(StringUtil.tokenize(tag.text()));
}
/**
* Check if the supplied string matches an entity specified
* with the -hide parameter.
* @return true if the string matches.
*/
public bool... | java | public void setOptions(Doc p) {
if (p == null)
return;
for (Tag tag : p.tags("opt"))
setOption(StringUtil.tokenize(tag.text()));
}
/**
* Check if the supplied string matches an entity specified
* with the -hide parameter.
* @return true if the string matches.
*/
public bool... | [
"public",
"void",
"setOptions",
"(",
"Doc",
"p",
")",
"{",
"if",
"(",
"p",
"==",
"null",
")",
"return",
";",
"for",
"(",
"Tag",
"tag",
":",
"p",
".",
"tags",
"(",
"\"opt\"",
")",
")",
"setOption",
"(",
"StringUtil",
".",
"tokenize",
"(",
"tag",
"... | Set the options based on the tag elements of the ClassDoc parameter | [
"Set",
"the",
"options",
"based",
"on",
"the",
"tag",
"elements",
"of",
"the",
"ClassDoc",
"parameter"
] | 09576db5ae0ea63bfe30ef9fce88a513f9a8d843 | https://github.com/dspinellis/UMLGraph/blob/09576db5ae0ea63bfe30ef9fce88a513f9a8d843/src/main/java/org/umlgraph/doclet/Options.java#L585-L659 |
157,819 | dspinellis/UMLGraph | src/main/java/org/umlgraph/doclet/RelationPattern.java | RelationPattern.addRelation | public void addRelation(RelationType relationType, RelationDirection direction) {
int idx = relationType.ordinal();
directions[idx] = directions[idx].sum(direction);
} | java | public void addRelation(RelationType relationType, RelationDirection direction) {
int idx = relationType.ordinal();
directions[idx] = directions[idx].sum(direction);
} | [
"public",
"void",
"addRelation",
"(",
"RelationType",
"relationType",
",",
"RelationDirection",
"direction",
")",
"{",
"int",
"idx",
"=",
"relationType",
".",
"ordinal",
"(",
")",
";",
"directions",
"[",
"idx",
"]",
"=",
"directions",
"[",
"idx",
"]",
".",
... | Adds, eventually merging, a direction for the specified relation type
@param relationType
@param direction | [
"Adds",
"eventually",
"merging",
"a",
"direction",
"for",
"the",
"specified",
"relation",
"type"
] | 09576db5ae0ea63bfe30ef9fce88a513f9a8d843 | https://github.com/dspinellis/UMLGraph/blob/09576db5ae0ea63bfe30ef9fce88a513f9a8d843/src/main/java/org/umlgraph/doclet/RelationPattern.java#L30-L33 |
157,820 | dspinellis/UMLGraph | src/main/java/org/umlgraph/doclet/ClassGraph.java | ClassGraph.qualifiedName | private static String qualifiedName(Options opt, String r) {
if (opt.hideGenerics)
r = removeTemplate(r);
// Fast path - nothing to do:
if (opt.showQualified && (opt.showQualifiedGenerics || r.indexOf('<') < 0))
return r;
StringBuilder buf = new StringBuilder(r.length());
qualifiedNameInner(opt, r, buf, ... | java | private static String qualifiedName(Options opt, String r) {
if (opt.hideGenerics)
r = removeTemplate(r);
// Fast path - nothing to do:
if (opt.showQualified && (opt.showQualifiedGenerics || r.indexOf('<') < 0))
return r;
StringBuilder buf = new StringBuilder(r.length());
qualifiedNameInner(opt, r, buf, ... | [
"private",
"static",
"String",
"qualifiedName",
"(",
"Options",
"opt",
",",
"String",
"r",
")",
"{",
"if",
"(",
"opt",
".",
"hideGenerics",
")",
"r",
"=",
"removeTemplate",
"(",
"r",
")",
";",
"// Fast path - nothing to do:",
"if",
"(",
"opt",
".",
"showQu... | Return the class's name, possibly by stripping the leading path | [
"Return",
"the",
"class",
"s",
"name",
"possibly",
"by",
"stripping",
"the",
"leading",
"path"
] | 09576db5ae0ea63bfe30ef9fce88a513f9a8d843 | https://github.com/dspinellis/UMLGraph/blob/09576db5ae0ea63bfe30ef9fce88a513f9a8d843/src/main/java/org/umlgraph/doclet/ClassGraph.java#L136-L145 |
157,821 | dspinellis/UMLGraph | src/main/java/org/umlgraph/doclet/ClassGraph.java | ClassGraph.visibility | private String visibility(Options opt, ProgramElementDoc e) {
return opt.showVisibility ? Visibility.get(e).symbol : " ";
} | java | private String visibility(Options opt, ProgramElementDoc e) {
return opt.showVisibility ? Visibility.get(e).symbol : " ";
} | [
"private",
"String",
"visibility",
"(",
"Options",
"opt",
",",
"ProgramElementDoc",
"e",
")",
"{",
"return",
"opt",
".",
"showVisibility",
"?",
"Visibility",
".",
"get",
"(",
"e",
")",
".",
"symbol",
":",
"\" \"",
";",
"}"
] | Print the visibility adornment of element e prefixed by
any stereotypes | [
"Print",
"the",
"visibility",
"adornment",
"of",
"element",
"e",
"prefixed",
"by",
"any",
"stereotypes"
] | 09576db5ae0ea63bfe30ef9fce88a513f9a8d843 | https://github.com/dspinellis/UMLGraph/blob/09576db5ae0ea63bfe30ef9fce88a513f9a8d843/src/main/java/org/umlgraph/doclet/ClassGraph.java#L177-L179 |
157,822 | dspinellis/UMLGraph | src/main/java/org/umlgraph/doclet/ClassGraph.java | ClassGraph.parameter | private String parameter(Options opt, Parameter p[]) {
StringBuilder par = new StringBuilder(1000);
for (int i = 0; i < p.length; i++) {
par.append(p[i].name() + typeAnnotation(opt, p[i].type()));
if (i + 1 < p.length)
par.append(", ");
}
return par.toString();
} | java | private String parameter(Options opt, Parameter p[]) {
StringBuilder par = new StringBuilder(1000);
for (int i = 0; i < p.length; i++) {
par.append(p[i].name() + typeAnnotation(opt, p[i].type()));
if (i + 1 < p.length)
par.append(", ");
}
return par.toString();
} | [
"private",
"String",
"parameter",
"(",
"Options",
"opt",
",",
"Parameter",
"p",
"[",
"]",
")",
"{",
"StringBuilder",
"par",
"=",
"new",
"StringBuilder",
"(",
"1000",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"p",
".",
"length",
";"... | Print the method parameter p | [
"Print",
"the",
"method",
"parameter",
"p"
] | 09576db5ae0ea63bfe30ef9fce88a513f9a8d843 | https://github.com/dspinellis/UMLGraph/blob/09576db5ae0ea63bfe30ef9fce88a513f9a8d843/src/main/java/org/umlgraph/doclet/ClassGraph.java#L182-L190 |
157,823 | dspinellis/UMLGraph | src/main/java/org/umlgraph/doclet/ClassGraph.java | ClassGraph.type | private String type(Options opt, Type t, boolean generics) {
return ((generics ? opt.showQualifiedGenerics : opt.showQualified) ? //
t.qualifiedTypeName() : t.typeName()) //
+ (opt.hideGenerics ? "" : typeParameters(opt, t.asParameterizedType()));
} | java | private String type(Options opt, Type t, boolean generics) {
return ((generics ? opt.showQualifiedGenerics : opt.showQualified) ? //
t.qualifiedTypeName() : t.typeName()) //
+ (opt.hideGenerics ? "" : typeParameters(opt, t.asParameterizedType()));
} | [
"private",
"String",
"type",
"(",
"Options",
"opt",
",",
"Type",
"t",
",",
"boolean",
"generics",
")",
"{",
"return",
"(",
"(",
"generics",
"?",
"opt",
".",
"showQualifiedGenerics",
":",
"opt",
".",
"showQualified",
")",
"?",
"//",
"t",
".",
"qualifiedTy... | Print a a basic type t | [
"Print",
"a",
"a",
"basic",
"type",
"t"
] | 09576db5ae0ea63bfe30ef9fce88a513f9a8d843 | https://github.com/dspinellis/UMLGraph/blob/09576db5ae0ea63bfe30ef9fce88a513f9a8d843/src/main/java/org/umlgraph/doclet/ClassGraph.java#L193-L197 |
157,824 | dspinellis/UMLGraph | src/main/java/org/umlgraph/doclet/ClassGraph.java | ClassGraph.typeParameters | private String typeParameters(Options opt, ParameterizedType t) {
if (t == null)
return "";
StringBuffer tp = new StringBuffer(1000).append("<");
Type args[] = t.typeArguments();
for (int i = 0; i < args.length; i++) {
tp.append(type(opt, args[i], true));
if (i != args.length - 1)
tp.append(", "... | java | private String typeParameters(Options opt, ParameterizedType t) {
if (t == null)
return "";
StringBuffer tp = new StringBuffer(1000).append("<");
Type args[] = t.typeArguments();
for (int i = 0; i < args.length; i++) {
tp.append(type(opt, args[i], true));
if (i != args.length - 1)
tp.append(", "... | [
"private",
"String",
"typeParameters",
"(",
"Options",
"opt",
",",
"ParameterizedType",
"t",
")",
"{",
"if",
"(",
"t",
"==",
"null",
")",
"return",
"\"\"",
";",
"StringBuffer",
"tp",
"=",
"new",
"StringBuffer",
"(",
"1000",
")",
".",
"append",
"(",
"\"&l... | Print the parameters of the parameterized type t | [
"Print",
"the",
"parameters",
"of",
"the",
"parameterized",
"type",
"t"
] | 09576db5ae0ea63bfe30ef9fce88a513f9a8d843 | https://github.com/dspinellis/UMLGraph/blob/09576db5ae0ea63bfe30ef9fce88a513f9a8d843/src/main/java/org/umlgraph/doclet/ClassGraph.java#L200-L211 |
157,825 | dspinellis/UMLGraph | src/main/java/org/umlgraph/doclet/ClassGraph.java | ClassGraph.attributes | private void attributes(Options opt, FieldDoc fd[]) {
for (FieldDoc f : fd) {
if (hidden(f))
continue;
stereotype(opt, f, Align.LEFT);
String att = visibility(opt, f) + f.name();
if (opt.showType)
att += typeAnnotation(opt, f.type());
tableLine(Align.LEFT, att);
tagvalue(opt, f);
}
... | java | private void attributes(Options opt, FieldDoc fd[]) {
for (FieldDoc f : fd) {
if (hidden(f))
continue;
stereotype(opt, f, Align.LEFT);
String att = visibility(opt, f) + f.name();
if (opt.showType)
att += typeAnnotation(opt, f.type());
tableLine(Align.LEFT, att);
tagvalue(opt, f);
}
... | [
"private",
"void",
"attributes",
"(",
"Options",
"opt",
",",
"FieldDoc",
"fd",
"[",
"]",
")",
"{",
"for",
"(",
"FieldDoc",
"f",
":",
"fd",
")",
"{",
"if",
"(",
"hidden",
"(",
"f",
")",
")",
"continue",
";",
"stereotype",
"(",
"opt",
",",
"f",
","... | Print the class's attributes fd | [
"Print",
"the",
"class",
"s",
"attributes",
"fd"
] | 09576db5ae0ea63bfe30ef9fce88a513f9a8d843 | https://github.com/dspinellis/UMLGraph/blob/09576db5ae0ea63bfe30ef9fce88a513f9a8d843/src/main/java/org/umlgraph/doclet/ClassGraph.java#L221-L232 |
157,826 | dspinellis/UMLGraph | src/main/java/org/umlgraph/doclet/ClassGraph.java | ClassGraph.operations | private boolean operations(Options opt, ConstructorDoc m[]) {
boolean printed = false;
for (ConstructorDoc cd : m) {
if (hidden(cd))
continue;
stereotype(opt, cd, Align.LEFT);
String cs = visibility(opt, cd) + cd.name() //
+ (opt.showType ? "(" + parameter(opt, cd.parameters()) + ")" : "()");
... | java | private boolean operations(Options opt, ConstructorDoc m[]) {
boolean printed = false;
for (ConstructorDoc cd : m) {
if (hidden(cd))
continue;
stereotype(opt, cd, Align.LEFT);
String cs = visibility(opt, cd) + cd.name() //
+ (opt.showType ? "(" + parameter(opt, cd.parameters()) + ")" : "()");
... | [
"private",
"boolean",
"operations",
"(",
"Options",
"opt",
",",
"ConstructorDoc",
"m",
"[",
"]",
")",
"{",
"boolean",
"printed",
"=",
"false",
";",
"for",
"(",
"ConstructorDoc",
"cd",
":",
"m",
")",
"{",
"if",
"(",
"hidden",
"(",
"cd",
")",
")",
"con... | Print the class's constructors m | [
"Print",
"the",
"class",
"s",
"constructors",
"m"
] | 09576db5ae0ea63bfe30ef9fce88a513f9a8d843 | https://github.com/dspinellis/UMLGraph/blob/09576db5ae0ea63bfe30ef9fce88a513f9a8d843/src/main/java/org/umlgraph/doclet/ClassGraph.java#L241-L254 |
157,827 | dspinellis/UMLGraph | src/main/java/org/umlgraph/doclet/ClassGraph.java | ClassGraph.operations | private boolean operations(Options opt, MethodDoc m[]) {
boolean printed = false;
for (MethodDoc md : m) {
if (hidden(md))
continue;
// Filter-out static initializer method
if (md.name().equals("<clinit>") && md.isStatic() && md.isPackagePrivate())
continue;
stereotype(opt, md, Align.LEFT);
... | java | private boolean operations(Options opt, MethodDoc m[]) {
boolean printed = false;
for (MethodDoc md : m) {
if (hidden(md))
continue;
// Filter-out static initializer method
if (md.name().equals("<clinit>") && md.isStatic() && md.isPackagePrivate())
continue;
stereotype(opt, md, Align.LEFT);
... | [
"private",
"boolean",
"operations",
"(",
"Options",
"opt",
",",
"MethodDoc",
"m",
"[",
"]",
")",
"{",
"boolean",
"printed",
"=",
"false",
";",
"for",
"(",
"MethodDoc",
"md",
":",
"m",
")",
"{",
"if",
"(",
"hidden",
"(",
"md",
")",
")",
"continue",
... | Print the class's operations m | [
"Print",
"the",
"class",
"s",
"operations",
"m"
] | 09576db5ae0ea63bfe30ef9fce88a513f9a8d843 | https://github.com/dspinellis/UMLGraph/blob/09576db5ae0ea63bfe30ef9fce88a513f9a8d843/src/main/java/org/umlgraph/doclet/ClassGraph.java#L257-L275 |
157,828 | dspinellis/UMLGraph | src/main/java/org/umlgraph/doclet/ClassGraph.java | ClassGraph.nodeProperties | private void nodeProperties(Options opt) {
Options def = opt.getGlobalOptions();
if (opt.nodeFontName != def.nodeFontName)
w.print(",fontname=\"" + opt.nodeFontName + "\"");
if (opt.nodeFontColor != def.nodeFontColor)
w.print(",fontcolor=\"" + opt.nodeFontColor + "\"");
if (opt.nodeFontSize != def.nodeFon... | java | private void nodeProperties(Options opt) {
Options def = opt.getGlobalOptions();
if (opt.nodeFontName != def.nodeFontName)
w.print(",fontname=\"" + opt.nodeFontName + "\"");
if (opt.nodeFontColor != def.nodeFontColor)
w.print(",fontcolor=\"" + opt.nodeFontColor + "\"");
if (opt.nodeFontSize != def.nodeFon... | [
"private",
"void",
"nodeProperties",
"(",
"Options",
"opt",
")",
"{",
"Options",
"def",
"=",
"opt",
".",
"getGlobalOptions",
"(",
")",
";",
"if",
"(",
"opt",
".",
"nodeFontName",
"!=",
"def",
".",
"nodeFontName",
")",
"w",
".",
"print",
"(",
"\",fontname... | Print the common class node's properties | [
"Print",
"the",
"common",
"class",
"node",
"s",
"properties"
] | 09576db5ae0ea63bfe30ef9fce88a513f9a8d843 | https://github.com/dspinellis/UMLGraph/blob/09576db5ae0ea63bfe30ef9fce88a513f9a8d843/src/main/java/org/umlgraph/doclet/ClassGraph.java#L278-L288 |
157,829 | dspinellis/UMLGraph | src/main/java/org/umlgraph/doclet/ClassGraph.java | ClassGraph.tagvalue | private void tagvalue(Options opt, Doc c) {
Tag tags[] = c.tags("tagvalue");
if (tags.length == 0)
return;
for (Tag tag : tags) {
String t[] = tokenize(tag.text());
if (t.length != 2) {
System.err.println("@tagvalue expects two fields: " + tag.text());
continue;
}
tableLine(Align.RIGHT... | java | private void tagvalue(Options opt, Doc c) {
Tag tags[] = c.tags("tagvalue");
if (tags.length == 0)
return;
for (Tag tag : tags) {
String t[] = tokenize(tag.text());
if (t.length != 2) {
System.err.println("@tagvalue expects two fields: " + tag.text());
continue;
}
tableLine(Align.RIGHT... | [
"private",
"void",
"tagvalue",
"(",
"Options",
"opt",
",",
"Doc",
"c",
")",
"{",
"Tag",
"tags",
"[",
"]",
"=",
"c",
".",
"tags",
"(",
"\"tagvalue\"",
")",
";",
"if",
"(",
"tags",
".",
"length",
"==",
"0",
")",
"return",
";",
"for",
"(",
"Tag",
... | Return as a string the tagged values associated with c
@param opt the Options used to guess font names
@param c the Doc entry to look for @tagvalue
@param prevterm the termination string for the previous element
@param term the termination character for each tagged value | [
"Return",
"as",
"a",
"string",
"the",
"tagged",
"values",
"associated",
"with",
"c"
] | 09576db5ae0ea63bfe30ef9fce88a513f9a8d843 | https://github.com/dspinellis/UMLGraph/blob/09576db5ae0ea63bfe30ef9fce88a513f9a8d843/src/main/java/org/umlgraph/doclet/ClassGraph.java#L297-L310 |
157,830 | dspinellis/UMLGraph | src/main/java/org/umlgraph/doclet/ClassGraph.java | ClassGraph.stereotype | private void stereotype(Options opt, Doc c, Align align) {
for (Tag tag : c.tags("stereotype")) {
String t[] = tokenize(tag.text());
if (t.length != 1) {
System.err.println("@stereotype expects one field: " + tag.text());
continue;
}
tableLine(align, guilWrap(opt, t[0]));
}
} | java | private void stereotype(Options opt, Doc c, Align align) {
for (Tag tag : c.tags("stereotype")) {
String t[] = tokenize(tag.text());
if (t.length != 1) {
System.err.println("@stereotype expects one field: " + tag.text());
continue;
}
tableLine(align, guilWrap(opt, t[0]));
}
} | [
"private",
"void",
"stereotype",
"(",
"Options",
"opt",
",",
"Doc",
"c",
",",
"Align",
"align",
")",
"{",
"for",
"(",
"Tag",
"tag",
":",
"c",
".",
"tags",
"(",
"\"stereotype\"",
")",
")",
"{",
"String",
"t",
"[",
"]",
"=",
"tokenize",
"(",
"tag",
... | Return as a string the stereotypes associated with c
terminated by the escape character term | [
"Return",
"as",
"a",
"string",
"the",
"stereotypes",
"associated",
"with",
"c",
"terminated",
"by",
"the",
"escape",
"character",
"term"
] | 09576db5ae0ea63bfe30ef9fce88a513f9a8d843 | https://github.com/dspinellis/UMLGraph/blob/09576db5ae0ea63bfe30ef9fce88a513f9a8d843/src/main/java/org/umlgraph/doclet/ClassGraph.java#L316-L325 |
157,831 | dspinellis/UMLGraph | src/main/java/org/umlgraph/doclet/ClassGraph.java | ClassGraph.hidden | private boolean hidden(ProgramElementDoc c) {
if (c.tags("hidden").length > 0 || c.tags("view").length > 0)
return true;
Options opt = optionProvider.getOptionsFor(c instanceof ClassDoc ? (ClassDoc) c : c.containingClass());
return opt.matchesHideExpression(c.toString()) //
|| (opt.hidePrivateInner && c insta... | java | private boolean hidden(ProgramElementDoc c) {
if (c.tags("hidden").length > 0 || c.tags("view").length > 0)
return true;
Options opt = optionProvider.getOptionsFor(c instanceof ClassDoc ? (ClassDoc) c : c.containingClass());
return opt.matchesHideExpression(c.toString()) //
|| (opt.hidePrivateInner && c insta... | [
"private",
"boolean",
"hidden",
"(",
"ProgramElementDoc",
"c",
")",
"{",
"if",
"(",
"c",
".",
"tags",
"(",
"\"hidden\"",
")",
".",
"length",
">",
"0",
"||",
"c",
".",
"tags",
"(",
"\"view\"",
")",
".",
"length",
">",
"0",
")",
"return",
"true",
";"... | Return true if c has a @hidden tag associated with it | [
"Return",
"true",
"if",
"c",
"has",
"a"
] | 09576db5ae0ea63bfe30ef9fce88a513f9a8d843 | https://github.com/dspinellis/UMLGraph/blob/09576db5ae0ea63bfe30ef9fce88a513f9a8d843/src/main/java/org/umlgraph/doclet/ClassGraph.java#L328-L334 |
157,832 | dspinellis/UMLGraph | src/main/java/org/umlgraph/doclet/ClassGraph.java | ClassGraph.hidden | private boolean hidden(String className) {
className = removeTemplate(className);
ClassInfo ci = classnames.get(className);
return ci != null ? ci.hidden : optionProvider.getOptionsFor(className).matchesHideExpression(className);
} | java | private boolean hidden(String className) {
className = removeTemplate(className);
ClassInfo ci = classnames.get(className);
return ci != null ? ci.hidden : optionProvider.getOptionsFor(className).matchesHideExpression(className);
} | [
"private",
"boolean",
"hidden",
"(",
"String",
"className",
")",
"{",
"className",
"=",
"removeTemplate",
"(",
"className",
")",
";",
"ClassInfo",
"ci",
"=",
"classnames",
".",
"get",
"(",
"className",
")",
";",
"return",
"ci",
"!=",
"null",
"?",
"ci",
"... | Return true if the class name is associated to an hidden class or matches a hide expression | [
"Return",
"true",
"if",
"the",
"class",
"name",
"is",
"associated",
"to",
"an",
"hidden",
"class",
"or",
"matches",
"a",
"hide",
"expression"
] | 09576db5ae0ea63bfe30ef9fce88a513f9a8d843 | https://github.com/dspinellis/UMLGraph/blob/09576db5ae0ea63bfe30ef9fce88a513f9a8d843/src/main/java/org/umlgraph/doclet/ClassGraph.java#L356-L360 |
157,833 | dspinellis/UMLGraph | src/main/java/org/umlgraph/doclet/ClassGraph.java | ClassGraph.allRelation | private void allRelation(Options opt, RelationType rt, ClassDoc from) {
String tagname = rt.lower;
for (Tag tag : from.tags(tagname)) {
String t[] = tokenize(tag.text()); // l-src label l-dst target
t = t.length == 1 ? new String[] { "-", "-", "-", t[0] } : t; // Shorthand
if (t.length != 4) {
Sys... | java | private void allRelation(Options opt, RelationType rt, ClassDoc from) {
String tagname = rt.lower;
for (Tag tag : from.tags(tagname)) {
String t[] = tokenize(tag.text()); // l-src label l-dst target
t = t.length == 1 ? new String[] { "-", "-", "-", t[0] } : t; // Shorthand
if (t.length != 4) {
Sys... | [
"private",
"void",
"allRelation",
"(",
"Options",
"opt",
",",
"RelationType",
"rt",
",",
"ClassDoc",
"from",
")",
"{",
"String",
"tagname",
"=",
"rt",
".",
"lower",
";",
"for",
"(",
"Tag",
"tag",
":",
"from",
".",
"tags",
"(",
"tagname",
")",
")",
"{... | Print all relations for a given's class's tag
@param tagname the tag containing the given relation
@param from the source class
@param edgetype the dot edge specification | [
"Print",
"all",
"relations",
"for",
"a",
"given",
"s",
"class",
"s",
"tag"
] | 09576db5ae0ea63bfe30ef9fce88a513f9a8d843 | https://github.com/dspinellis/UMLGraph/blob/09576db5ae0ea63bfe30ef9fce88a513f9a8d843/src/main/java/org/umlgraph/doclet/ClassGraph.java#L495-L515 |
157,834 | dspinellis/UMLGraph | src/main/java/org/umlgraph/doclet/ClassGraph.java | ClassGraph.printRelations | public void printRelations(ClassDoc c) {
Options opt = optionProvider.getOptionsFor(c);
if (hidden(c) || c.name().equals("")) // avoid phantom classes, they may pop up when the source uses annotations
return;
// Print generalization (through the Java superclass)
Type s = c.superclassType();
ClassDoc sc = s !=... | java | public void printRelations(ClassDoc c) {
Options opt = optionProvider.getOptionsFor(c);
if (hidden(c) || c.name().equals("")) // avoid phantom classes, they may pop up when the source uses annotations
return;
// Print generalization (through the Java superclass)
Type s = c.superclassType();
ClassDoc sc = s !=... | [
"public",
"void",
"printRelations",
"(",
"ClassDoc",
"c",
")",
"{",
"Options",
"opt",
"=",
"optionProvider",
".",
"getOptionsFor",
"(",
"c",
")",
";",
"if",
"(",
"hidden",
"(",
"c",
")",
"||",
"c",
".",
"name",
"(",
")",
".",
"equals",
"(",
"\"\"",
... | Print a class's relations | [
"Print",
"a",
"class",
"s",
"relations"
] | 09576db5ae0ea63bfe30ef9fce88a513f9a8d843 | https://github.com/dspinellis/UMLGraph/blob/09576db5ae0ea63bfe30ef9fce88a513f9a8d843/src/main/java/org/umlgraph/doclet/ClassGraph.java#L573-L600 |
157,835 | dspinellis/UMLGraph | src/main/java/org/umlgraph/doclet/ClassGraph.java | ClassGraph.printExtraClasses | public void printExtraClasses(RootDoc root) {
Set<String> names = new HashSet<String>(classnames.keySet());
for(String className: names) {
ClassInfo info = getClassInfo(className, true);
if (info.nodePrinted)
continue;
ClassDoc c = root.classNamed(className);
if(c != null) {
printClass(c, fal... | java | public void printExtraClasses(RootDoc root) {
Set<String> names = new HashSet<String>(classnames.keySet());
for(String className: names) {
ClassInfo info = getClassInfo(className, true);
if (info.nodePrinted)
continue;
ClassDoc c = root.classNamed(className);
if(c != null) {
printClass(c, fal... | [
"public",
"void",
"printExtraClasses",
"(",
"RootDoc",
"root",
")",
"{",
"Set",
"<",
"String",
">",
"names",
"=",
"new",
"HashSet",
"<",
"String",
">",
"(",
"classnames",
".",
"keySet",
"(",
")",
")",
";",
"for",
"(",
"String",
"className",
":",
"names... | Print classes that were parts of relationships, but not parsed by javadoc | [
"Print",
"classes",
"that",
"were",
"parts",
"of",
"relationships",
"but",
"not",
"parsed",
"by",
"javadoc"
] | 09576db5ae0ea63bfe30ef9fce88a513f9a8d843 | https://github.com/dspinellis/UMLGraph/blob/09576db5ae0ea63bfe30ef9fce88a513f9a8d843/src/main/java/org/umlgraph/doclet/ClassGraph.java#L603-L639 |
157,836 | dspinellis/UMLGraph | src/main/java/org/umlgraph/doclet/ClassGraph.java | ClassGraph.printInferredRelations | public void printInferredRelations(ClassDoc c) {
// check if the source is excluded from inference
if (hidden(c))
return;
Options opt = optionProvider.getOptionsFor(c);
for (FieldDoc field : c.fields(false)) {
if(hidden(field))
continue;
// skip statics
if(field.isStatic())
continue;
... | java | public void printInferredRelations(ClassDoc c) {
// check if the source is excluded from inference
if (hidden(c))
return;
Options opt = optionProvider.getOptionsFor(c);
for (FieldDoc field : c.fields(false)) {
if(hidden(field))
continue;
// skip statics
if(field.isStatic())
continue;
... | [
"public",
"void",
"printInferredRelations",
"(",
"ClassDoc",
"c",
")",
"{",
"// check if the source is excluded from inference",
"if",
"(",
"hidden",
"(",
"c",
")",
")",
"return",
";",
"Options",
"opt",
"=",
"optionProvider",
".",
"getOptionsFor",
"(",
"c",
")",
... | Prints associations recovered from the fields of a class. An association is inferred only
if another relation between the two classes is not already in the graph.
@param classes | [
"Prints",
"associations",
"recovered",
"from",
"the",
"fields",
"of",
"a",
"class",
".",
"An",
"association",
"is",
"inferred",
"only",
"if",
"another",
"relation",
"between",
"the",
"two",
"classes",
"is",
"not",
"already",
"in",
"the",
"graph",
"."
] | 09576db5ae0ea63bfe30ef9fce88a513f9a8d843 | https://github.com/dspinellis/UMLGraph/blob/09576db5ae0ea63bfe30ef9fce88a513f9a8d843/src/main/java/org/umlgraph/doclet/ClassGraph.java#L646-L674 |
157,837 | dspinellis/UMLGraph | src/main/java/org/umlgraph/doclet/ClassGraph.java | ClassGraph.printInferredDependencies | public void printInferredDependencies(ClassDoc c) {
if (hidden(c))
return;
Options opt = optionProvider.getOptionsFor(c);
Set<Type> types = new HashSet<Type>();
// harvest method return and parameter types
for (MethodDoc method : filterByVisibility(c.methods(false), opt.inferDependencyVisibility)) {
typ... | java | public void printInferredDependencies(ClassDoc c) {
if (hidden(c))
return;
Options opt = optionProvider.getOptionsFor(c);
Set<Type> types = new HashSet<Type>();
// harvest method return and parameter types
for (MethodDoc method : filterByVisibility(c.methods(false), opt.inferDependencyVisibility)) {
typ... | [
"public",
"void",
"printInferredDependencies",
"(",
"ClassDoc",
"c",
")",
"{",
"if",
"(",
"hidden",
"(",
"c",
")",
")",
"return",
";",
"Options",
"opt",
"=",
"optionProvider",
".",
"getOptionsFor",
"(",
"c",
")",
";",
"Set",
"<",
"Type",
">",
"types",
... | Prints dependencies recovered from the methods of a class. A
dependency is inferred only if another relation between the two
classes is not already in the graph.
@param classes | [
"Prints",
"dependencies",
"recovered",
"from",
"the",
"methods",
"of",
"a",
"class",
".",
"A",
"dependency",
"is",
"inferred",
"only",
"if",
"another",
"relation",
"between",
"the",
"two",
"classes",
"is",
"not",
"already",
"in",
"the",
"graph",
"."
] | 09576db5ae0ea63bfe30ef9fce88a513f9a8d843 | https://github.com/dspinellis/UMLGraph/blob/09576db5ae0ea63bfe30ef9fce88a513f9a8d843/src/main/java/org/umlgraph/doclet/ClassGraph.java#L691-L751 |
157,838 | dspinellis/UMLGraph | src/main/java/org/umlgraph/doclet/ClassGraph.java | ClassGraph.filterByVisibility | private <T extends ProgramElementDoc> List<T> filterByVisibility(T[] docs, Visibility visibility) {
if (visibility == Visibility.PRIVATE)
return Arrays.asList(docs);
List<T> filtered = new ArrayList<T>();
for (T doc : docs) {
if (Visibility.get(doc).compareTo(visibility) > 0)
filtered.add(doc);
}
retu... | java | private <T extends ProgramElementDoc> List<T> filterByVisibility(T[] docs, Visibility visibility) {
if (visibility == Visibility.PRIVATE)
return Arrays.asList(docs);
List<T> filtered = new ArrayList<T>();
for (T doc : docs) {
if (Visibility.get(doc).compareTo(visibility) > 0)
filtered.add(doc);
}
retu... | [
"private",
"<",
"T",
"extends",
"ProgramElementDoc",
">",
"List",
"<",
"T",
">",
"filterByVisibility",
"(",
"T",
"[",
"]",
"docs",
",",
"Visibility",
"visibility",
")",
"{",
"if",
"(",
"visibility",
"==",
"Visibility",
".",
"PRIVATE",
")",
"return",
"Array... | Returns all program element docs that have a visibility greater or
equal than the specified level | [
"Returns",
"all",
"program",
"element",
"docs",
"that",
"have",
"a",
"visibility",
"greater",
"or",
"equal",
"than",
"the",
"specified",
"level"
] | 09576db5ae0ea63bfe30ef9fce88a513f9a8d843 | https://github.com/dspinellis/UMLGraph/blob/09576db5ae0ea63bfe30ef9fce88a513f9a8d843/src/main/java/org/umlgraph/doclet/ClassGraph.java#L757-L767 |
157,839 | dspinellis/UMLGraph | src/main/java/org/umlgraph/doclet/ClassGraph.java | ClassGraph.firstInnerTableStart | private void firstInnerTableStart(Options opt) {
w.print(linePrefix + linePrefix + "<tr>" + opt.shape.extraColumn() +
"<td><table border=\"0\" cellspacing=\"0\" " +
"cellpadding=\"1\">" + linePostfix);
} | java | private void firstInnerTableStart(Options opt) {
w.print(linePrefix + linePrefix + "<tr>" + opt.shape.extraColumn() +
"<td><table border=\"0\" cellspacing=\"0\" " +
"cellpadding=\"1\">" + linePostfix);
} | [
"private",
"void",
"firstInnerTableStart",
"(",
"Options",
"opt",
")",
"{",
"w",
".",
"print",
"(",
"linePrefix",
"+",
"linePrefix",
"+",
"\"<tr>\"",
"+",
"opt",
".",
"shape",
".",
"extraColumn",
"(",
")",
"+",
"\"<td><table border=\\\"0\\\" cellspacing=\\\"0\\\" ... | Start the first inner table of a class. | [
"Start",
"the",
"first",
"inner",
"table",
"of",
"a",
"class",
"."
] | 09576db5ae0ea63bfe30ef9fce88a513f9a8d843 | https://github.com/dspinellis/UMLGraph/blob/09576db5ae0ea63bfe30ef9fce88a513f9a8d843/src/main/java/org/umlgraph/doclet/ClassGraph.java#L927-L931 |
157,840 | twitter/scrooge | scrooge-maven-plugin/src/main/java/com/twitter/AbstractMavenScroogeMojo.java | AbstractMavenScroogeMojo.extractThriftFile | private File extractThriftFile(String artifactId, String fileName, Set<File> thriftFiles) {
for (File thriftFile : thriftFiles) {
boolean fileFound = false;
if (fileName.equals(thriftFile.getName())) {
for (String pathComponent : thriftFile.getPath().split(File.separator)) {
if (pathCo... | java | private File extractThriftFile(String artifactId, String fileName, Set<File> thriftFiles) {
for (File thriftFile : thriftFiles) {
boolean fileFound = false;
if (fileName.equals(thriftFile.getName())) {
for (String pathComponent : thriftFile.getPath().split(File.separator)) {
if (pathCo... | [
"private",
"File",
"extractThriftFile",
"(",
"String",
"artifactId",
",",
"String",
"fileName",
",",
"Set",
"<",
"File",
">",
"thriftFiles",
")",
"{",
"for",
"(",
"File",
"thriftFile",
":",
"thriftFiles",
")",
"{",
"boolean",
"fileFound",
"=",
"false",
";",
... | Picks out a File from `thriftFiles` corresponding to a given artifact ID
and file name. Returns null if `artifactId` and `fileName` do not map to a
thrift file path.
@parameter artifactId The artifact ID of which to look up the path
@parameter fileName the name of the thrift file for which to extract a path
@parameter... | [
"Picks",
"out",
"a",
"File",
"from",
"thriftFiles",
"corresponding",
"to",
"a",
"given",
"artifact",
"ID",
"and",
"file",
"name",
".",
"Returns",
"null",
"if",
"artifactId",
"and",
"fileName",
"do",
"not",
"map",
"to",
"a",
"thrift",
"file",
"path",
"."
] | 2aec9b19a610e12be9609cd97925d0b1284d48bc | https://github.com/twitter/scrooge/blob/2aec9b19a610e12be9609cd97925d0b1284d48bc/scrooge-maven-plugin/src/main/java/com/twitter/AbstractMavenScroogeMojo.java#L228-L244 |
157,841 | twitter/scrooge | scrooge-maven-plugin/src/main/java/com/twitter/AbstractMavenScroogeMojo.java | AbstractMavenScroogeMojo.execute | public void execute() throws MojoExecutionException, MojoFailureException {
try {
Set<File> thriftFiles = findThriftFiles();
final File outputDirectory = getOutputDirectory();
ImmutableSet<File> outputFiles = findGeneratedFilesInDirectory(getOutputDirectory());
Set<String> compileRoots = n... | java | public void execute() throws MojoExecutionException, MojoFailureException {
try {
Set<File> thriftFiles = findThriftFiles();
final File outputDirectory = getOutputDirectory();
ImmutableSet<File> outputFiles = findGeneratedFilesInDirectory(getOutputDirectory());
Set<String> compileRoots = n... | [
"public",
"void",
"execute",
"(",
")",
"throws",
"MojoExecutionException",
",",
"MojoFailureException",
"{",
"try",
"{",
"Set",
"<",
"File",
">",
"thriftFiles",
"=",
"findThriftFiles",
"(",
")",
";",
"final",
"File",
"outputDirectory",
"=",
"getOutputDirectory",
... | Executes the mojo. | [
"Executes",
"the",
"mojo",
"."
] | 2aec9b19a610e12be9609cd97925d0b1284d48bc | https://github.com/twitter/scrooge/blob/2aec9b19a610e12be9609cd97925d0b1284d48bc/scrooge-maven-plugin/src/main/java/com/twitter/AbstractMavenScroogeMojo.java#L249-L302 |
157,842 | twitter/scrooge | scrooge-maven-plugin/src/main/java/com/twitter/AbstractMavenScroogeMojo.java | AbstractMavenScroogeMojo.lastModified | private long lastModified(Set<File> files) {
long result = 0;
for (File file : files) {
if (file.lastModified() > result)
result = file.lastModified();
}
return result;
} | java | private long lastModified(Set<File> files) {
long result = 0;
for (File file : files) {
if (file.lastModified() > result)
result = file.lastModified();
}
return result;
} | [
"private",
"long",
"lastModified",
"(",
"Set",
"<",
"File",
">",
"files",
")",
"{",
"long",
"result",
"=",
"0",
";",
"for",
"(",
"File",
"file",
":",
"files",
")",
"{",
"if",
"(",
"file",
".",
"lastModified",
"(",
")",
">",
"result",
")",
"result",... | Get the last modified time for a set of files. | [
"Get",
"the",
"last",
"modified",
"time",
"for",
"a",
"set",
"of",
"files",
"."
] | 2aec9b19a610e12be9609cd97925d0b1284d48bc | https://github.com/twitter/scrooge/blob/2aec9b19a610e12be9609cd97925d0b1284d48bc/scrooge-maven-plugin/src/main/java/com/twitter/AbstractMavenScroogeMojo.java#L339-L346 |
157,843 | twitter/scrooge | scrooge-maven-plugin/src/main/java/com/twitter/AbstractMavenScroogeMojo.java | AbstractMavenScroogeMojo.findThriftFiles | private Set<File> findThriftFiles() throws IOException, MojoExecutionException {
final File thriftSourceRoot = getThriftSourceRoot();
Set<File> thriftFiles = new HashSet<File>();
if (thriftSourceRoot != null && thriftSourceRoot.exists()) {
thriftFiles.addAll(findThriftFilesInDirectory(thriftSourceRoot... | java | private Set<File> findThriftFiles() throws IOException, MojoExecutionException {
final File thriftSourceRoot = getThriftSourceRoot();
Set<File> thriftFiles = new HashSet<File>();
if (thriftSourceRoot != null && thriftSourceRoot.exists()) {
thriftFiles.addAll(findThriftFilesInDirectory(thriftSourceRoot... | [
"private",
"Set",
"<",
"File",
">",
"findThriftFiles",
"(",
")",
"throws",
"IOException",
",",
"MojoExecutionException",
"{",
"final",
"File",
"thriftSourceRoot",
"=",
"getThriftSourceRoot",
"(",
")",
";",
"Set",
"<",
"File",
">",
"thriftFiles",
"=",
"new",
"H... | build a complete set of local files, files from referenced projects, and dependencies. | [
"build",
"a",
"complete",
"set",
"of",
"local",
"files",
"files",
"from",
"referenced",
"projects",
"and",
"dependencies",
"."
] | 2aec9b19a610e12be9609cd97925d0b1284d48bc | https://github.com/twitter/scrooge/blob/2aec9b19a610e12be9609cd97925d0b1284d48bc/scrooge-maven-plugin/src/main/java/com/twitter/AbstractMavenScroogeMojo.java#L351-L365 |
157,844 | twitter/scrooge | scrooge-maven-plugin/src/main/java/com/twitter/AbstractMavenScroogeMojo.java | AbstractMavenScroogeMojo.findThriftDependencies | private Set<Artifact> findThriftDependencies() throws IOException, MojoExecutionException {
Set<Artifact> thriftDependencies = new HashSet<Artifact>();
Set<Artifact> deps = new HashSet<Artifact>();
deps.addAll(project.getArtifacts());
deps.addAll(project.getDependencyArtifacts());
Map<String, Arti... | java | private Set<Artifact> findThriftDependencies() throws IOException, MojoExecutionException {
Set<Artifact> thriftDependencies = new HashSet<Artifact>();
Set<Artifact> deps = new HashSet<Artifact>();
deps.addAll(project.getArtifacts());
deps.addAll(project.getDependencyArtifacts());
Map<String, Arti... | [
"private",
"Set",
"<",
"Artifact",
">",
"findThriftDependencies",
"(",
")",
"throws",
"IOException",
",",
"MojoExecutionException",
"{",
"Set",
"<",
"Artifact",
">",
"thriftDependencies",
"=",
"new",
"HashSet",
"<",
"Artifact",
">",
"(",
")",
";",
"Set",
"<",
... | Iterate through dependencies | [
"Iterate",
"through",
"dependencies"
] | 2aec9b19a610e12be9609cd97925d0b1284d48bc | https://github.com/twitter/scrooge/blob/2aec9b19a610e12be9609cd97925d0b1284d48bc/scrooge-maven-plugin/src/main/java/com/twitter/AbstractMavenScroogeMojo.java#L370-L408 |
157,845 | twitter/scrooge | scrooge-maven-plugin/src/main/java/com/twitter/AbstractMavenScroogeMojo.java | AbstractMavenScroogeMojo.getRecursiveThriftFiles | protected List<File> getRecursiveThriftFiles(MavenProject project, String outputDirectory) throws IOException {
return getRecursiveThriftFiles(project, outputDirectory, new ArrayList<File>());
} | java | protected List<File> getRecursiveThriftFiles(MavenProject project, String outputDirectory) throws IOException {
return getRecursiveThriftFiles(project, outputDirectory, new ArrayList<File>());
} | [
"protected",
"List",
"<",
"File",
">",
"getRecursiveThriftFiles",
"(",
"MavenProject",
"project",
",",
"String",
"outputDirectory",
")",
"throws",
"IOException",
"{",
"return",
"getRecursiveThriftFiles",
"(",
"project",
",",
"outputDirectory",
",",
"new",
"ArrayList",... | Walk project references recursively, building up a list of thrift files they provide, starting
with an empty file list. | [
"Walk",
"project",
"references",
"recursively",
"building",
"up",
"a",
"list",
"of",
"thrift",
"files",
"they",
"provide",
"starting",
"with",
"an",
"empty",
"file",
"list",
"."
] | 2aec9b19a610e12be9609cd97925d0b1284d48bc | https://github.com/twitter/scrooge/blob/2aec9b19a610e12be9609cd97925d0b1284d48bc/scrooge-maven-plugin/src/main/java/com/twitter/AbstractMavenScroogeMojo.java#L488-L490 |
157,846 | twitter/scrooge | scrooge-maven-plugin/src/main/java/com/twitter/AbstractMavenScroogeMojo.java | AbstractMavenScroogeMojo.getRecursiveThriftFiles | List<File> getRecursiveThriftFiles(MavenProject project, String outputDirectory, List<File> files) throws IOException {
HashFunction hashFun = Hashing.md5();
File dir = new File(new File(project.getFile().getParent(), "target"), outputDirectory);
if (dir.exists()) {
URI baseDir = getFileURI(dir);
... | java | List<File> getRecursiveThriftFiles(MavenProject project, String outputDirectory, List<File> files) throws IOException {
HashFunction hashFun = Hashing.md5();
File dir = new File(new File(project.getFile().getParent(), "target"), outputDirectory);
if (dir.exists()) {
URI baseDir = getFileURI(dir);
... | [
"List",
"<",
"File",
">",
"getRecursiveThriftFiles",
"(",
"MavenProject",
"project",
",",
"String",
"outputDirectory",
",",
"List",
"<",
"File",
">",
"files",
")",
"throws",
"IOException",
"{",
"HashFunction",
"hashFun",
"=",
"Hashing",
".",
"md5",
"(",
")",
... | Walk project references recursively, adding thrift files to the provided list. | [
"Walk",
"project",
"references",
"recursively",
"adding",
"thrift",
"files",
"to",
"the",
"provided",
"list",
"."
] | 2aec9b19a610e12be9609cd97925d0b1284d48bc | https://github.com/twitter/scrooge/blob/2aec9b19a610e12be9609cd97925d0b1284d48bc/scrooge-maven-plugin/src/main/java/com/twitter/AbstractMavenScroogeMojo.java#L495-L518 |
157,847 | twitter/scrooge | scrooge-maven-plugin/src/main/java/com/twitter/AbstractMavenScroogeMojo.java | AbstractMavenScroogeMojo.isDepOfIdlArtifact | private boolean isDepOfIdlArtifact(Artifact artifact, Map<String, Artifact> depsMap) {
List<String> depTrail = artifact.getDependencyTrail();
// depTrail can be null sometimes, which seems like a maven bug
if (depTrail != null) {
for (String name : depTrail) {
Artifact dep = depsMap.get(name);... | java | private boolean isDepOfIdlArtifact(Artifact artifact, Map<String, Artifact> depsMap) {
List<String> depTrail = artifact.getDependencyTrail();
// depTrail can be null sometimes, which seems like a maven bug
if (depTrail != null) {
for (String name : depTrail) {
Artifact dep = depsMap.get(name);... | [
"private",
"boolean",
"isDepOfIdlArtifact",
"(",
"Artifact",
"artifact",
",",
"Map",
"<",
"String",
",",
"Artifact",
">",
"depsMap",
")",
"{",
"List",
"<",
"String",
">",
"depTrail",
"=",
"artifact",
".",
"getDependencyTrail",
"(",
")",
";",
"// depTrail can b... | Checks if the artifact is dependency of an dependent idl artifact
@returns true if the artifact was a dependency of idl artifact | [
"Checks",
"if",
"the",
"artifact",
"is",
"dependency",
"of",
"an",
"dependent",
"idl",
"artifact"
] | 2aec9b19a610e12be9609cd97925d0b1284d48bc | https://github.com/twitter/scrooge/blob/2aec9b19a610e12be9609cd97925d0b1284d48bc/scrooge-maven-plugin/src/main/java/com/twitter/AbstractMavenScroogeMojo.java#L539-L551 |
157,848 | twitter/scrooge | scrooge-maven-plugin/src/main/java/com/twitter/MavenScroogeCompilerUtil.java | MavenScroogeCompilerUtil.getIdlArtifact | public static Artifact getIdlArtifact(Artifact artifact, ArtifactFactory artifactFactory,
ArtifactResolver artifactResolver,
ArtifactRepository localRepository,
List<ArtifactRepository> remoteRepos,
... | java | public static Artifact getIdlArtifact(Artifact artifact, ArtifactFactory artifactFactory,
ArtifactResolver artifactResolver,
ArtifactRepository localRepository,
List<ArtifactRepository> remoteRepos,
... | [
"public",
"static",
"Artifact",
"getIdlArtifact",
"(",
"Artifact",
"artifact",
",",
"ArtifactFactory",
"artifactFactory",
",",
"ArtifactResolver",
"artifactResolver",
",",
"ArtifactRepository",
"localRepository",
",",
"List",
"<",
"ArtifactRepository",
">",
"remoteRepos",
... | Resolves an idl jar for the artifact.
@return Returns idl artifact
@throws MojoExecutionException is idl jar is not present for the artifact. | [
"Resolves",
"an",
"idl",
"jar",
"for",
"the",
"artifact",
"."
] | 2aec9b19a610e12be9609cd97925d0b1284d48bc | https://github.com/twitter/scrooge/blob/2aec9b19a610e12be9609cd97925d0b1284d48bc/scrooge-maven-plugin/src/main/java/com/twitter/MavenScroogeCompilerUtil.java#L20-L42 |
157,849 | lift/framework | core/common/src/main/java/net/liftweb/common/Func.java | Func.lift | public static<Z> Function0<Z> lift(Func0<Z> f) {
return bridge.lift(f);
} | java | public static<Z> Function0<Z> lift(Func0<Z> f) {
return bridge.lift(f);
} | [
"public",
"static",
"<",
"Z",
">",
"Function0",
"<",
"Z",
">",
"lift",
"(",
"Func0",
"<",
"Z",
">",
"f",
")",
"{",
"return",
"bridge",
".",
"lift",
"(",
"f",
")",
";",
"}"
] | Lift a Java Func0 to a Scala Function0
@param f the function to lift
@returns the Scala function | [
"Lift",
"a",
"Java",
"Func0",
"to",
"a",
"Scala",
"Function0"
] | 975aa115e0a8e2450dd4905a17ebd19830ae97b2 | https://github.com/lift/framework/blob/975aa115e0a8e2450dd4905a17ebd19830ae97b2/core/common/src/main/java/net/liftweb/common/Func.java#L37-L39 |
157,850 | lift/framework | core/common/src/main/java/net/liftweb/common/Func.java | Func.lift | public static<A, Z> Function1<A, Z> lift(Func1<A, Z> f) {
return bridge.lift(f);
} | java | public static<A, Z> Function1<A, Z> lift(Func1<A, Z> f) {
return bridge.lift(f);
} | [
"public",
"static",
"<",
"A",
",",
"Z",
">",
"Function1",
"<",
"A",
",",
"Z",
">",
"lift",
"(",
"Func1",
"<",
"A",
",",
"Z",
">",
"f",
")",
"{",
"return",
"bridge",
".",
"lift",
"(",
"f",
")",
";",
"}"
] | Lift a Java Func1 to a Scala Function1
@param f the function to lift
@returns the Scala function | [
"Lift",
"a",
"Java",
"Func1",
"to",
"a",
"Scala",
"Function1"
] | 975aa115e0a8e2450dd4905a17ebd19830ae97b2 | https://github.com/lift/framework/blob/975aa115e0a8e2450dd4905a17ebd19830ae97b2/core/common/src/main/java/net/liftweb/common/Func.java#L48-L50 |
157,851 | lift/framework | core/common/src/main/java/net/liftweb/common/Func.java | Func.lift | public static<A, B, Z> Function2<A, B, Z> lift(Func2<A, B, Z> f) {
return bridge.lift(f);
} | java | public static<A, B, Z> Function2<A, B, Z> lift(Func2<A, B, Z> f) {
return bridge.lift(f);
} | [
"public",
"static",
"<",
"A",
",",
"B",
",",
"Z",
">",
"Function2",
"<",
"A",
",",
"B",
",",
"Z",
">",
"lift",
"(",
"Func2",
"<",
"A",
",",
"B",
",",
"Z",
">",
"f",
")",
"{",
"return",
"bridge",
".",
"lift",
"(",
"f",
")",
";",
"}"
] | Lift a Java Func2 to a Scala Function2
@param f the function to lift
@returns the Scala function | [
"Lift",
"a",
"Java",
"Func2",
"to",
"a",
"Scala",
"Function2"
] | 975aa115e0a8e2450dd4905a17ebd19830ae97b2 | https://github.com/lift/framework/blob/975aa115e0a8e2450dd4905a17ebd19830ae97b2/core/common/src/main/java/net/liftweb/common/Func.java#L59-L61 |
157,852 | lift/framework | core/common/src/main/java/net/liftweb/common/Func.java | Func.lift | public static<A, B, C, Z> Function3<A, B, C, Z> lift(Func3<A, B, C, Z> f) {
return bridge.lift(f);
} | java | public static<A, B, C, Z> Function3<A, B, C, Z> lift(Func3<A, B, C, Z> f) {
return bridge.lift(f);
} | [
"public",
"static",
"<",
"A",
",",
"B",
",",
"C",
",",
"Z",
">",
"Function3",
"<",
"A",
",",
"B",
",",
"C",
",",
"Z",
">",
"lift",
"(",
"Func3",
"<",
"A",
",",
"B",
",",
"C",
",",
"Z",
">",
"f",
")",
"{",
"return",
"bridge",
".",
"lift",
... | Lift a Java Func3 to a Scala Function3
@param f the function to lift
@returns the Scala function | [
"Lift",
"a",
"Java",
"Func3",
"to",
"a",
"Scala",
"Function3"
] | 975aa115e0a8e2450dd4905a17ebd19830ae97b2 | https://github.com/lift/framework/blob/975aa115e0a8e2450dd4905a17ebd19830ae97b2/core/common/src/main/java/net/liftweb/common/Func.java#L70-L72 |
157,853 | lift/framework | core/common/src/main/java/net/liftweb/common/Func.java | Func.lift | public static<A, B, C, D, Z> Function4<A, B, C, D, Z> lift(Func4<A, B, C, D, Z> f) {
return bridge.lift(f);
} | java | public static<A, B, C, D, Z> Function4<A, B, C, D, Z> lift(Func4<A, B, C, D, Z> f) {
return bridge.lift(f);
} | [
"public",
"static",
"<",
"A",
",",
"B",
",",
"C",
",",
"D",
",",
"Z",
">",
"Function4",
"<",
"A",
",",
"B",
",",
"C",
",",
"D",
",",
"Z",
">",
"lift",
"(",
"Func4",
"<",
"A",
",",
"B",
",",
"C",
",",
"D",
",",
"Z",
">",
"f",
")",
"{",... | Lift a Java Func4 to a Scala Function4
@param f the function to lift
@returns the Scala function | [
"Lift",
"a",
"Java",
"Func4",
"to",
"a",
"Scala",
"Function4"
] | 975aa115e0a8e2450dd4905a17ebd19830ae97b2 | https://github.com/lift/framework/blob/975aa115e0a8e2450dd4905a17ebd19830ae97b2/core/common/src/main/java/net/liftweb/common/Func.java#L81-L83 |
157,854 | lift/framework | core/common/src/main/java/net/liftweb/common/Func.java | Func.lift | public static<Z> Function0<Z> lift(Callable<Z> f) {
return bridge.lift(f);
} | java | public static<Z> Function0<Z> lift(Callable<Z> f) {
return bridge.lift(f);
} | [
"public",
"static",
"<",
"Z",
">",
"Function0",
"<",
"Z",
">",
"lift",
"(",
"Callable",
"<",
"Z",
">",
"f",
")",
"{",
"return",
"bridge",
".",
"lift",
"(",
"f",
")",
";",
"}"
] | Lift a Java Callable to a Scala Function0
@param f the function to lift
@returns the Scala function | [
"Lift",
"a",
"Java",
"Callable",
"to",
"a",
"Scala",
"Function0"
] | 975aa115e0a8e2450dd4905a17ebd19830ae97b2 | https://github.com/lift/framework/blob/975aa115e0a8e2450dd4905a17ebd19830ae97b2/core/common/src/main/java/net/liftweb/common/Func.java#L92-L94 |
157,855 | lift/framework | core/util/src/main/java/net/liftweb/util/Css.java | Css.sel | public static CssSel sel(String selector, String value) {
return j.sel(selector, value);
} | java | public static CssSel sel(String selector, String value) {
return j.sel(selector, value);
} | [
"public",
"static",
"CssSel",
"sel",
"(",
"String",
"selector",
",",
"String",
"value",
")",
"{",
"return",
"j",
".",
"sel",
"(",
"selector",
",",
"value",
")",
";",
"}"
] | Create a Css Selector Transform | [
"Create",
"a",
"Css",
"Selector",
"Transform"
] | 975aa115e0a8e2450dd4905a17ebd19830ae97b2 | https://github.com/lift/framework/blob/975aa115e0a8e2450dd4905a17ebd19830ae97b2/core/util/src/main/java/net/liftweb/util/Css.java#L31-L33 |
157,856 | lift/framework | core/util/src/main/java/net/liftweb/util/VendorJ.java | VendorJ.vendor | public static<T> Vendor<T> vendor(Func0<T> f) {
return j.vendor(f);
} | java | public static<T> Vendor<T> vendor(Func0<T> f) {
return j.vendor(f);
} | [
"public",
"static",
"<",
"T",
">",
"Vendor",
"<",
"T",
">",
"vendor",
"(",
"Func0",
"<",
"T",
">",
"f",
")",
"{",
"return",
"j",
".",
"vendor",
"(",
"f",
")",
";",
"}"
] | Create a Vendor from a Func0 | [
"Create",
"a",
"Vendor",
"from",
"a",
"Func0"
] | 975aa115e0a8e2450dd4905a17ebd19830ae97b2 | https://github.com/lift/framework/blob/975aa115e0a8e2450dd4905a17ebd19830ae97b2/core/util/src/main/java/net/liftweb/util/VendorJ.java#L31-L33 |
157,857 | lift/framework | core/util/src/main/java/net/liftweb/util/VendorJ.java | VendorJ.vendor | public static<T> Vendor<T> vendor(Callable<T> f) {
return j.vendor(f);
} | java | public static<T> Vendor<T> vendor(Callable<T> f) {
return j.vendor(f);
} | [
"public",
"static",
"<",
"T",
">",
"Vendor",
"<",
"T",
">",
"vendor",
"(",
"Callable",
"<",
"T",
">",
"f",
")",
"{",
"return",
"j",
".",
"vendor",
"(",
"f",
")",
";",
"}"
] | Create a Vendor from a Callable | [
"Create",
"a",
"Vendor",
"from",
"a",
"Callable"
] | 975aa115e0a8e2450dd4905a17ebd19830ae97b2 | https://github.com/lift/framework/blob/975aa115e0a8e2450dd4905a17ebd19830ae97b2/core/util/src/main/java/net/liftweb/util/VendorJ.java#L38-L40 |
157,858 | lift/framework | web/webkit/src/main/java/net/liftweb/http/VarsJ.java | VarsJ.vendSessionVar | public static<T> SessionVar<T> vendSessionVar(T defValue) {
return (new VarsJBridge()).vendSessionVar(defValue, new Exception());
} | java | public static<T> SessionVar<T> vendSessionVar(T defValue) {
return (new VarsJBridge()).vendSessionVar(defValue, new Exception());
} | [
"public",
"static",
"<",
"T",
">",
"SessionVar",
"<",
"T",
">",
"vendSessionVar",
"(",
"T",
"defValue",
")",
"{",
"return",
"(",
"new",
"VarsJBridge",
"(",
")",
")",
".",
"vendSessionVar",
"(",
"defValue",
",",
"new",
"Exception",
"(",
")",
")",
";",
... | Vend a SessionVar with the default value | [
"Vend",
"a",
"SessionVar",
"with",
"the",
"default",
"value"
] | 975aa115e0a8e2450dd4905a17ebd19830ae97b2 | https://github.com/lift/framework/blob/975aa115e0a8e2450dd4905a17ebd19830ae97b2/web/webkit/src/main/java/net/liftweb/http/VarsJ.java#L33-L35 |
157,859 | lift/framework | web/webkit/src/main/java/net/liftweb/http/VarsJ.java | VarsJ.vendSessionVar | public static<T> SessionVar<T> vendSessionVar(Callable<T> defFunc) {
return (new VarsJBridge()).vendSessionVar(defFunc, new Exception());
} | java | public static<T> SessionVar<T> vendSessionVar(Callable<T> defFunc) {
return (new VarsJBridge()).vendSessionVar(defFunc, new Exception());
} | [
"public",
"static",
"<",
"T",
">",
"SessionVar",
"<",
"T",
">",
"vendSessionVar",
"(",
"Callable",
"<",
"T",
">",
"defFunc",
")",
"{",
"return",
"(",
"new",
"VarsJBridge",
"(",
")",
")",
".",
"vendSessionVar",
"(",
"defFunc",
",",
"new",
"Exception",
"... | Vend a SessionVar with the function to create the default value | [
"Vend",
"a",
"SessionVar",
"with",
"the",
"function",
"to",
"create",
"the",
"default",
"value"
] | 975aa115e0a8e2450dd4905a17ebd19830ae97b2 | https://github.com/lift/framework/blob/975aa115e0a8e2450dd4905a17ebd19830ae97b2/web/webkit/src/main/java/net/liftweb/http/VarsJ.java#L40-L42 |
157,860 | vlingo/vlingo-actors | src/main/java/io/vlingo/actors/Router.java | Router.dispatchCommand | protected <T1> void dispatchCommand(final BiConsumer<P, T1> action, final T1 routable1) {
routingFor(routable1)
.routees()
.forEach(routee -> routee.receiveCommand(action, routable1));
} | java | protected <T1> void dispatchCommand(final BiConsumer<P, T1> action, final T1 routable1) {
routingFor(routable1)
.routees()
.forEach(routee -> routee.receiveCommand(action, routable1));
} | [
"protected",
"<",
"T1",
">",
"void",
"dispatchCommand",
"(",
"final",
"BiConsumer",
"<",
"P",
",",
"T1",
">",
"action",
",",
"final",
"T1",
"routable1",
")",
"{",
"routingFor",
"(",
"routable1",
")",
".",
"routees",
"(",
")",
".",
"forEach",
"(",
"rout... | DISPATCHING - COMMANDS | [
"DISPATCHING",
"-",
"COMMANDS"
] | c7d046fd139c0490cf0fd2588d7dc2f792f13493 | https://github.com/vlingo/vlingo-actors/blob/c7d046fd139c0490cf0fd2588d7dc2f792f13493/src/main/java/io/vlingo/actors/Router.java#L97-L101 |
157,861 | mongodb/stitch-android-sdk | core/services/mongodb-remote/src/main/java/com/mongodb/stitch/core/services/mongodb/remote/sync/internal/CoreSyncMongoIterableImpl.java | CoreSyncMongoIterableImpl.first | @Nullable
public ResultT first() {
final CoreRemoteMongoCursor<ResultT> cursor = iterator();
if (!cursor.hasNext()) {
return null;
}
return cursor.next();
} | java | @Nullable
public ResultT first() {
final CoreRemoteMongoCursor<ResultT> cursor = iterator();
if (!cursor.hasNext()) {
return null;
}
return cursor.next();
} | [
"@",
"Nullable",
"public",
"ResultT",
"first",
"(",
")",
"{",
"final",
"CoreRemoteMongoCursor",
"<",
"ResultT",
">",
"cursor",
"=",
"iterator",
"(",
")",
";",
"if",
"(",
"!",
"cursor",
".",
"hasNext",
"(",
")",
")",
"{",
"return",
"null",
";",
"}",
"... | Helper to return the first item in the iterator or null.
@return T the first item or null. | [
"Helper",
"to",
"return",
"the",
"first",
"item",
"in",
"the",
"iterator",
"or",
"null",
"."
] | 159b9334b1f1a827285544be5ee20cdf7b04e4cc | https://github.com/mongodb/stitch-android-sdk/blob/159b9334b1f1a827285544be5ee20cdf7b04e4cc/core/services/mongodb-remote/src/main/java/com/mongodb/stitch/core/services/mongodb/remote/sync/internal/CoreSyncMongoIterableImpl.java#L76-L83 |
157,862 | mongodb/stitch-android-sdk | core/services/mongodb-remote/src/main/java/com/mongodb/stitch/core/services/mongodb/remote/sync/internal/CoreSyncMongoIterableImpl.java | CoreSyncMongoIterableImpl.map | public <U> CoreRemoteMongoIterable<U> map(final Function<ResultT, U> mapper) {
return new CoreRemoteMappingIterable<>(this, mapper);
} | java | public <U> CoreRemoteMongoIterable<U> map(final Function<ResultT, U> mapper) {
return new CoreRemoteMappingIterable<>(this, mapper);
} | [
"public",
"<",
"U",
">",
"CoreRemoteMongoIterable",
"<",
"U",
">",
"map",
"(",
"final",
"Function",
"<",
"ResultT",
",",
"U",
">",
"mapper",
")",
"{",
"return",
"new",
"CoreRemoteMappingIterable",
"<>",
"(",
"this",
",",
"mapper",
")",
";",
"}"
] | Maps this iterable from the source document type to the target document type.
@param mapper a function that maps from the source to the target document type
@param <U> the target document type
@return an iterable which maps T to U | [
"Maps",
"this",
"iterable",
"from",
"the",
"source",
"document",
"type",
"to",
"the",
"target",
"document",
"type",
"."
] | 159b9334b1f1a827285544be5ee20cdf7b04e4cc | https://github.com/mongodb/stitch-android-sdk/blob/159b9334b1f1a827285544be5ee20cdf7b04e4cc/core/services/mongodb-remote/src/main/java/com/mongodb/stitch/core/services/mongodb/remote/sync/internal/CoreSyncMongoIterableImpl.java#L92-L94 |
157,863 | mongodb/stitch-android-sdk | core/services/mongodb-remote/src/main/java/com/mongodb/stitch/core/services/mongodb/remote/sync/internal/CoreSyncMongoIterableImpl.java | CoreSyncMongoIterableImpl.into | public <A extends Collection<? super ResultT>> A into(final A target) {
forEach(new Block<ResultT>() {
@Override
public void apply(@Nonnull final ResultT t) {
target.add(t);
}
});
return target;
} | java | public <A extends Collection<? super ResultT>> A into(final A target) {
forEach(new Block<ResultT>() {
@Override
public void apply(@Nonnull final ResultT t) {
target.add(t);
}
});
return target;
} | [
"public",
"<",
"A",
"extends",
"Collection",
"<",
"?",
"super",
"ResultT",
">",
">",
"A",
"into",
"(",
"final",
"A",
"target",
")",
"{",
"forEach",
"(",
"new",
"Block",
"<",
"ResultT",
">",
"(",
")",
"{",
"@",
"Override",
"public",
"void",
"apply",
... | Iterates over all the documents, adding each to the given target.
@param target the collection to insert into
@param <A> the collection type
@return the target | [
"Iterates",
"over",
"all",
"the",
"documents",
"adding",
"each",
"to",
"the",
"given",
"target",
"."
] | 159b9334b1f1a827285544be5ee20cdf7b04e4cc | https://github.com/mongodb/stitch-android-sdk/blob/159b9334b1f1a827285544be5ee20cdf7b04e4cc/core/services/mongodb-remote/src/main/java/com/mongodb/stitch/core/services/mongodb/remote/sync/internal/CoreSyncMongoIterableImpl.java#L116-L124 |
157,864 | mongodb/stitch-android-sdk | android/services/aws/src/main/java/com/mongodb/stitch/android/services/aws/internal/AwsServiceClientImpl.java | AwsServiceClientImpl.withCodecRegistry | public AwsServiceClient withCodecRegistry(@Nonnull final CodecRegistry codecRegistry) {
return new AwsServiceClientImpl(proxy.withCodecRegistry(codecRegistry), dispatcher);
} | java | public AwsServiceClient withCodecRegistry(@Nonnull final CodecRegistry codecRegistry) {
return new AwsServiceClientImpl(proxy.withCodecRegistry(codecRegistry), dispatcher);
} | [
"public",
"AwsServiceClient",
"withCodecRegistry",
"(",
"@",
"Nonnull",
"final",
"CodecRegistry",
"codecRegistry",
")",
"{",
"return",
"new",
"AwsServiceClientImpl",
"(",
"proxy",
".",
"withCodecRegistry",
"(",
"codecRegistry",
")",
",",
"dispatcher",
")",
";",
"}"
... | Create a new AwsServiceClient instance with a different codec registry.
@param codecRegistry the new {@link CodecRegistry} for the client.
@return a new AwsServiceClient instance with the different codec registry | [
"Create",
"a",
"new",
"AwsServiceClient",
"instance",
"with",
"a",
"different",
"codec",
"registry",
"."
] | 159b9334b1f1a827285544be5ee20cdf7b04e4cc | https://github.com/mongodb/stitch-android-sdk/blob/159b9334b1f1a827285544be5ee20cdf7b04e4cc/android/services/aws/src/main/java/com/mongodb/stitch/android/services/aws/internal/AwsServiceClientImpl.java#L243-L245 |
157,865 | mongodb/stitch-android-sdk | core/sdk/src/main/java/com/mongodb/stitch/core/internal/CoreStitchAppClient.java | CoreStitchAppClient.callFunction | public void callFunction(
final String name,
final List<?> args,
final @Nullable Long requestTimeout) {
this.functionService.callFunction(name, args, requestTimeout);
} | java | public void callFunction(
final String name,
final List<?> args,
final @Nullable Long requestTimeout) {
this.functionService.callFunction(name, args, requestTimeout);
} | [
"public",
"void",
"callFunction",
"(",
"final",
"String",
"name",
",",
"final",
"List",
"<",
"?",
">",
"args",
",",
"final",
"@",
"Nullable",
"Long",
"requestTimeout",
")",
"{",
"this",
".",
"functionService",
".",
"callFunction",
"(",
"name",
",",
"args",... | Calls the specified Stitch function.
@param name the name of the Stitch function to call.
@param args the arguments to pass to the Stitch function.
@param requestTimeout the number of milliseconds the client should wait for a response from the
server before failing with an error. | [
"Calls",
"the",
"specified",
"Stitch",
"function",
"."
] | 159b9334b1f1a827285544be5ee20cdf7b04e4cc | https://github.com/mongodb/stitch-android-sdk/blob/159b9334b1f1a827285544be5ee20cdf7b04e4cc/core/sdk/src/main/java/com/mongodb/stitch/core/internal/CoreStitchAppClient.java#L57-L62 |
157,866 | mongodb/stitch-android-sdk | core/sdk/src/main/java/com/mongodb/stitch/core/internal/CoreStitchAppClient.java | CoreStitchAppClient.callFunction | public <T> T callFunction(
final String name,
final List<?> args,
final @Nullable Long requestTimeout,
final Class<T> resultClass,
final CodecRegistry codecRegistry
) {
return this.functionService
.withCodecRegistry(codecRegistry)
.callFunction(name, args, requestTime... | java | public <T> T callFunction(
final String name,
final List<?> args,
final @Nullable Long requestTimeout,
final Class<T> resultClass,
final CodecRegistry codecRegistry
) {
return this.functionService
.withCodecRegistry(codecRegistry)
.callFunction(name, args, requestTime... | [
"public",
"<",
"T",
">",
"T",
"callFunction",
"(",
"final",
"String",
"name",
",",
"final",
"List",
"<",
"?",
">",
"args",
",",
"final",
"@",
"Nullable",
"Long",
"requestTimeout",
",",
"final",
"Class",
"<",
"T",
">",
"resultClass",
",",
"final",
"Code... | Calls the specified Stitch function, and decodes the response into an instance of the specified
type. The response will be decoded using the codec registry given.
@param name the name of the Stitch function to call.
@param args the arguments to pass to the Stitch function.
@param requestTimeout the number of milliseco... | [
"Calls",
"the",
"specified",
"Stitch",
"function",
"and",
"decodes",
"the",
"response",
"into",
"an",
"instance",
"of",
"the",
"specified",
"type",
".",
"The",
"response",
"will",
"be",
"decoded",
"using",
"the",
"codec",
"registry",
"given",
"."
] | 159b9334b1f1a827285544be5ee20cdf7b04e4cc | https://github.com/mongodb/stitch-android-sdk/blob/159b9334b1f1a827285544be5ee20cdf7b04e4cc/core/sdk/src/main/java/com/mongodb/stitch/core/internal/CoreStitchAppClient.java#L120-L130 |
157,867 | mongodb/stitch-android-sdk | core/services/mongodb-remote/src/main/java/com/mongodb/stitch/core/services/mongodb/remote/sync/internal/InstanceChangeStreamListenerImpl.java | InstanceChangeStreamListenerImpl.start | public void start() {
instanceLock.writeLock().lock();
try {
for (final Map.Entry<MongoNamespace, NamespaceChangeStreamListener> streamerEntry :
nsStreamers.entrySet()) {
streamerEntry.getValue().start();
}
} finally {
instanceLock.writeLock().unlock();
}
} | java | public void start() {
instanceLock.writeLock().lock();
try {
for (final Map.Entry<MongoNamespace, NamespaceChangeStreamListener> streamerEntry :
nsStreamers.entrySet()) {
streamerEntry.getValue().start();
}
} finally {
instanceLock.writeLock().unlock();
}
} | [
"public",
"void",
"start",
"(",
")",
"{",
"instanceLock",
".",
"writeLock",
"(",
")",
".",
"lock",
"(",
")",
";",
"try",
"{",
"for",
"(",
"final",
"Map",
".",
"Entry",
"<",
"MongoNamespace",
",",
"NamespaceChangeStreamListener",
">",
"streamerEntry",
":",
... | Starts all streams. | [
"Starts",
"all",
"streams",
"."
] | 159b9334b1f1a827285544be5ee20cdf7b04e4cc | https://github.com/mongodb/stitch-android-sdk/blob/159b9334b1f1a827285544be5ee20cdf7b04e4cc/core/services/mongodb-remote/src/main/java/com/mongodb/stitch/core/services/mongodb/remote/sync/internal/InstanceChangeStreamListenerImpl.java#L79-L89 |
157,868 | mongodb/stitch-android-sdk | core/services/mongodb-remote/src/main/java/com/mongodb/stitch/core/services/mongodb/remote/sync/internal/InstanceChangeStreamListenerImpl.java | InstanceChangeStreamListenerImpl.stop | public void stop() {
instanceLock.writeLock().lock();
try {
for (final NamespaceChangeStreamListener streamer : nsStreamers.values()) {
streamer.stop();
}
} finally {
instanceLock.writeLock().unlock();
}
} | java | public void stop() {
instanceLock.writeLock().lock();
try {
for (final NamespaceChangeStreamListener streamer : nsStreamers.values()) {
streamer.stop();
}
} finally {
instanceLock.writeLock().unlock();
}
} | [
"public",
"void",
"stop",
"(",
")",
"{",
"instanceLock",
".",
"writeLock",
"(",
")",
".",
"lock",
"(",
")",
";",
"try",
"{",
"for",
"(",
"final",
"NamespaceChangeStreamListener",
"streamer",
":",
"nsStreamers",
".",
"values",
"(",
")",
")",
"{",
"streame... | Stops all streams. | [
"Stops",
"all",
"streams",
"."
] | 159b9334b1f1a827285544be5ee20cdf7b04e4cc | https://github.com/mongodb/stitch-android-sdk/blob/159b9334b1f1a827285544be5ee20cdf7b04e4cc/core/services/mongodb-remote/src/main/java/com/mongodb/stitch/core/services/mongodb/remote/sync/internal/InstanceChangeStreamListenerImpl.java#L105-L114 |
157,869 | mongodb/stitch-android-sdk | core/services/mongodb-remote/src/main/java/com/mongodb/stitch/core/services/mongodb/remote/sync/internal/InstanceChangeStreamListenerImpl.java | InstanceChangeStreamListenerImpl.addNamespace | public void addNamespace(final MongoNamespace namespace) {
this.instanceLock.writeLock().lock();
try {
if (this.nsStreamers.containsKey(namespace)) {
return;
}
final NamespaceChangeStreamListener streamer =
new NamespaceChangeStreamListener(
namespace,
... | java | public void addNamespace(final MongoNamespace namespace) {
this.instanceLock.writeLock().lock();
try {
if (this.nsStreamers.containsKey(namespace)) {
return;
}
final NamespaceChangeStreamListener streamer =
new NamespaceChangeStreamListener(
namespace,
... | [
"public",
"void",
"addNamespace",
"(",
"final",
"MongoNamespace",
"namespace",
")",
"{",
"this",
".",
"instanceLock",
".",
"writeLock",
"(",
")",
".",
"lock",
"(",
")",
";",
"try",
"{",
"if",
"(",
"this",
".",
"nsStreamers",
".",
"containsKey",
"(",
"nam... | Requests that the given namespace be started listening to for change events.
@param namespace the namespace to listen for change events on. | [
"Requests",
"that",
"the",
"given",
"namespace",
"be",
"started",
"listening",
"to",
"for",
"change",
"events",
"."
] | 159b9334b1f1a827285544be5ee20cdf7b04e4cc | https://github.com/mongodb/stitch-android-sdk/blob/159b9334b1f1a827285544be5ee20cdf7b04e4cc/core/services/mongodb-remote/src/main/java/com/mongodb/stitch/core/services/mongodb/remote/sync/internal/InstanceChangeStreamListenerImpl.java#L172-L190 |
157,870 | mongodb/stitch-android-sdk | core/services/mongodb-remote/src/main/java/com/mongodb/stitch/core/services/mongodb/remote/sync/internal/InstanceChangeStreamListenerImpl.java | InstanceChangeStreamListenerImpl.removeNamespace | @Override
public void removeNamespace(final MongoNamespace namespace) {
this.instanceLock.writeLock().lock();
try {
if (!this.nsStreamers.containsKey(namespace)) {
return;
}
final NamespaceChangeStreamListener streamer = this.nsStreamers.get(namespace);
streamer.stop();
t... | java | @Override
public void removeNamespace(final MongoNamespace namespace) {
this.instanceLock.writeLock().lock();
try {
if (!this.nsStreamers.containsKey(namespace)) {
return;
}
final NamespaceChangeStreamListener streamer = this.nsStreamers.get(namespace);
streamer.stop();
t... | [
"@",
"Override",
"public",
"void",
"removeNamespace",
"(",
"final",
"MongoNamespace",
"namespace",
")",
"{",
"this",
".",
"instanceLock",
".",
"writeLock",
"(",
")",
".",
"lock",
"(",
")",
";",
"try",
"{",
"if",
"(",
"!",
"this",
".",
"nsStreamers",
".",... | Requests that the given namespace stopped being listened to for change events.
@param namespace the namespace to stop listening for change events on. | [
"Requests",
"that",
"the",
"given",
"namespace",
"stopped",
"being",
"listened",
"to",
"for",
"change",
"events",
"."
] | 159b9334b1f1a827285544be5ee20cdf7b04e4cc | https://github.com/mongodb/stitch-android-sdk/blob/159b9334b1f1a827285544be5ee20cdf7b04e4cc/core/services/mongodb-remote/src/main/java/com/mongodb/stitch/core/services/mongodb/remote/sync/internal/InstanceChangeStreamListenerImpl.java#L197-L210 |
157,871 | mongodb/stitch-android-sdk | core/services/mongodb-remote/src/main/java/com/mongodb/stitch/core/services/mongodb/remote/sync/internal/InstanceChangeStreamListenerImpl.java | InstanceChangeStreamListenerImpl.getEventsForNamespace | public Map<BsonValue, ChangeEvent<BsonDocument>> getEventsForNamespace(
final MongoNamespace namespace
) {
this.instanceLock.readLock().lock();
final NamespaceChangeStreamListener streamer;
try {
streamer = nsStreamers.get(namespace);
} finally {
this.instanceLock.readLock().unlock()... | java | public Map<BsonValue, ChangeEvent<BsonDocument>> getEventsForNamespace(
final MongoNamespace namespace
) {
this.instanceLock.readLock().lock();
final NamespaceChangeStreamListener streamer;
try {
streamer = nsStreamers.get(namespace);
} finally {
this.instanceLock.readLock().unlock()... | [
"public",
"Map",
"<",
"BsonValue",
",",
"ChangeEvent",
"<",
"BsonDocument",
">",
">",
"getEventsForNamespace",
"(",
"final",
"MongoNamespace",
"namespace",
")",
"{",
"this",
".",
"instanceLock",
".",
"readLock",
"(",
")",
".",
"lock",
"(",
")",
";",
"final",... | Returns the latest change events for a given namespace.
@param namespace the namespace to get events for.
@return the latest change events for a given namespace. | [
"Returns",
"the",
"latest",
"change",
"events",
"for",
"a",
"given",
"namespace",
"."
] | 159b9334b1f1a827285544be5ee20cdf7b04e4cc | https://github.com/mongodb/stitch-android-sdk/blob/159b9334b1f1a827285544be5ee20cdf7b04e4cc/core/services/mongodb-remote/src/main/java/com/mongodb/stitch/core/services/mongodb/remote/sync/internal/InstanceChangeStreamListenerImpl.java#L218-L232 |
157,872 | mongodb/stitch-android-sdk | core/services/mongodb-remote/src/main/java/com/mongodb/stitch/core/services/mongodb/remote/sync/internal/InstanceChangeStreamListenerImpl.java | InstanceChangeStreamListenerImpl.getUnprocessedEventForDocumentId | public @Nullable ChangeEvent<BsonDocument> getUnprocessedEventForDocumentId(
final MongoNamespace namespace,
final BsonValue documentId
) {
this.instanceLock.readLock().lock();
final NamespaceChangeStreamListener streamer;
try {
streamer = nsStreamers.get(namespace);
} finall... | java | public @Nullable ChangeEvent<BsonDocument> getUnprocessedEventForDocumentId(
final MongoNamespace namespace,
final BsonValue documentId
) {
this.instanceLock.readLock().lock();
final NamespaceChangeStreamListener streamer;
try {
streamer = nsStreamers.get(namespace);
} finall... | [
"public",
"@",
"Nullable",
"ChangeEvent",
"<",
"BsonDocument",
">",
"getUnprocessedEventForDocumentId",
"(",
"final",
"MongoNamespace",
"namespace",
",",
"final",
"BsonValue",
"documentId",
")",
"{",
"this",
".",
"instanceLock",
".",
"readLock",
"(",
")",
".",
"lo... | If there is an unprocessed change event for a particular document ID, fetch it from the
appropriate namespace change stream listener, and remove it. By reading the event here, we are
assuming it will be processed by the consumer.
@return the latest unprocessed change event for the given document ID and namespace, or n... | [
"If",
"there",
"is",
"an",
"unprocessed",
"change",
"event",
"for",
"a",
"particular",
"document",
"ID",
"fetch",
"it",
"from",
"the",
"appropriate",
"namespace",
"change",
"stream",
"listener",
"and",
"remove",
"it",
".",
"By",
"reading",
"the",
"event",
"h... | 159b9334b1f1a827285544be5ee20cdf7b04e4cc | https://github.com/mongodb/stitch-android-sdk/blob/159b9334b1f1a827285544be5ee20cdf7b04e4cc/core/services/mongodb-remote/src/main/java/com/mongodb/stitch/core/services/mongodb/remote/sync/internal/InstanceChangeStreamListenerImpl.java#L258-L275 |
157,873 | mongodb/stitch-android-sdk | core/services/mongodb-remote/src/main/java/com/mongodb/stitch/core/services/mongodb/remote/sync/internal/CoreDocumentSynchronizationConfig.java | CoreDocumentSynchronizationConfig.setPaused | void setPaused(final boolean isPaused) {
docLock.writeLock().lock();
try {
docsColl.updateOne(
getDocFilter(namespace, documentId),
new BsonDocument("$set",
new BsonDocument(
ConfigCodec.Fields.IS_PAUSED,
new BsonBoolean(isPaused))));
... | java | void setPaused(final boolean isPaused) {
docLock.writeLock().lock();
try {
docsColl.updateOne(
getDocFilter(namespace, documentId),
new BsonDocument("$set",
new BsonDocument(
ConfigCodec.Fields.IS_PAUSED,
new BsonBoolean(isPaused))));
... | [
"void",
"setPaused",
"(",
"final",
"boolean",
"isPaused",
")",
"{",
"docLock",
".",
"writeLock",
"(",
")",
".",
"lock",
"(",
")",
";",
"try",
"{",
"docsColl",
".",
"updateOne",
"(",
"getDocFilter",
"(",
"namespace",
",",
"documentId",
")",
",",
"new",
... | A document that is paused no longer has remote updates applied to it.
Any local updates to this document cause it to be thawed. An example of pausing a document
is when a conflict is being resolved for that document and the handler throws an exception.
@param isPaused whether or not this config is frozen | [
"A",
"document",
"that",
"is",
"paused",
"no",
"longer",
"has",
"remote",
"updates",
"applied",
"to",
"it",
".",
"Any",
"local",
"updates",
"to",
"this",
"document",
"cause",
"it",
"to",
"be",
"thawed",
".",
"An",
"example",
"of",
"pausing",
"a",
"docume... | 159b9334b1f1a827285544be5ee20cdf7b04e4cc | https://github.com/mongodb/stitch-android-sdk/blob/159b9334b1f1a827285544be5ee20cdf7b04e4cc/core/services/mongodb-remote/src/main/java/com/mongodb/stitch/core/services/mongodb/remote/sync/internal/CoreDocumentSynchronizationConfig.java#L160-L175 |
157,874 | mongodb/stitch-android-sdk | core/services/mongodb-remote/src/main/java/com/mongodb/stitch/core/services/mongodb/remote/sync/internal/CoreDocumentSynchronizationConfig.java | CoreDocumentSynchronizationConfig.setSomePendingWritesAndSave | public void setSomePendingWritesAndSave(
final long atTime,
final ChangeEvent<BsonDocument> changeEvent
) {
docLock.writeLock().lock();
try {
// if we were frozen
if (isPaused) {
// unfreeze the document due to the local write
setPaused(false);
// and now the un... | java | public void setSomePendingWritesAndSave(
final long atTime,
final ChangeEvent<BsonDocument> changeEvent
) {
docLock.writeLock().lock();
try {
// if we were frozen
if (isPaused) {
// unfreeze the document due to the local write
setPaused(false);
// and now the un... | [
"public",
"void",
"setSomePendingWritesAndSave",
"(",
"final",
"long",
"atTime",
",",
"final",
"ChangeEvent",
"<",
"BsonDocument",
">",
"changeEvent",
")",
"{",
"docLock",
".",
"writeLock",
"(",
")",
".",
"lock",
"(",
")",
";",
"try",
"{",
"// if we were froze... | Sets that there are some pending writes that occurred at a time for an associated
locally emitted change event. This variant maintains the last version set.
@param atTime the time at which the write occurred.
@param changeEvent the description of the write/change. | [
"Sets",
"that",
"there",
"are",
"some",
"pending",
"writes",
"that",
"occurred",
"at",
"a",
"time",
"for",
"an",
"associated",
"locally",
"emitted",
"change",
"event",
".",
"This",
"variant",
"maintains",
"the",
"last",
"version",
"set",
"."
] | 159b9334b1f1a827285544be5ee20cdf7b04e4cc | https://github.com/mongodb/stitch-android-sdk/blob/159b9334b1f1a827285544be5ee20cdf7b04e4cc/core/services/mongodb-remote/src/main/java/com/mongodb/stitch/core/services/mongodb/remote/sync/internal/CoreDocumentSynchronizationConfig.java#L188-L211 |
157,875 | mongodb/stitch-android-sdk | core/services/mongodb-remote/src/main/java/com/mongodb/stitch/core/services/mongodb/remote/sync/internal/CoreDocumentSynchronizationConfig.java | CoreDocumentSynchronizationConfig.coalesceChangeEvents | private static ChangeEvent<BsonDocument> coalesceChangeEvents(
final ChangeEvent<BsonDocument> lastUncommittedChangeEvent,
final ChangeEvent<BsonDocument> newestChangeEvent
) {
if (lastUncommittedChangeEvent == null) {
return newestChangeEvent;
}
switch (lastUncommittedChangeEvent.getOpe... | java | private static ChangeEvent<BsonDocument> coalesceChangeEvents(
final ChangeEvent<BsonDocument> lastUncommittedChangeEvent,
final ChangeEvent<BsonDocument> newestChangeEvent
) {
if (lastUncommittedChangeEvent == null) {
return newestChangeEvent;
}
switch (lastUncommittedChangeEvent.getOpe... | [
"private",
"static",
"ChangeEvent",
"<",
"BsonDocument",
">",
"coalesceChangeEvents",
"(",
"final",
"ChangeEvent",
"<",
"BsonDocument",
">",
"lastUncommittedChangeEvent",
",",
"final",
"ChangeEvent",
"<",
"BsonDocument",
">",
"newestChangeEvent",
")",
"{",
"if",
"(",
... | Possibly coalesces the newest change event to match the user's original intent. For example,
an unsynchronized insert and update is still an insert.
@param lastUncommittedChangeEvent the last change event known about for a document.
@param newestChangeEvent the newest change event known about for a document.
... | [
"Possibly",
"coalesces",
"the",
"newest",
"change",
"event",
"to",
"match",
"the",
"user",
"s",
"original",
"intent",
".",
"For",
"example",
"an",
"unsynchronized",
"insert",
"and",
"update",
"is",
"still",
"an",
"insert",
"."
] | 159b9334b1f1a827285544be5ee20cdf7b04e4cc | https://github.com/mongodb/stitch-android-sdk/blob/159b9334b1f1a827285544be5ee20cdf7b04e4cc/core/services/mongodb-remote/src/main/java/com/mongodb/stitch/core/services/mongodb/remote/sync/internal/CoreDocumentSynchronizationConfig.java#L373-L470 |
157,876 | mongodb/stitch-android-sdk | core/services/mongodb-remote/src/main/java/com/mongodb/stitch/core/services/mongodb/remote/sync/internal/DocumentVersionInfo.java | DocumentVersionInfo.getRemoteVersionInfo | static DocumentVersionInfo getRemoteVersionInfo(final BsonDocument remoteDocument) {
final BsonDocument version = getDocumentVersionDoc(remoteDocument);
return new DocumentVersionInfo(
version,
remoteDocument != null
? BsonUtils.getDocumentId(remoteDocument) : null
... | java | static DocumentVersionInfo getRemoteVersionInfo(final BsonDocument remoteDocument) {
final BsonDocument version = getDocumentVersionDoc(remoteDocument);
return new DocumentVersionInfo(
version,
remoteDocument != null
? BsonUtils.getDocumentId(remoteDocument) : null
... | [
"static",
"DocumentVersionInfo",
"getRemoteVersionInfo",
"(",
"final",
"BsonDocument",
"remoteDocument",
")",
"{",
"final",
"BsonDocument",
"version",
"=",
"getDocumentVersionDoc",
"(",
"remoteDocument",
")",
";",
"return",
"new",
"DocumentVersionInfo",
"(",
"version",
... | Returns the current version info for a provided remote document.
@param remoteDocument the remote BSON document from which to extract version info
@return a DocumentVersionInfo | [
"Returns",
"the",
"current",
"version",
"info",
"for",
"a",
"provided",
"remote",
"document",
"."
] | 159b9334b1f1a827285544be5ee20cdf7b04e4cc | https://github.com/mongodb/stitch-android-sdk/blob/159b9334b1f1a827285544be5ee20cdf7b04e4cc/core/services/mongodb-remote/src/main/java/com/mongodb/stitch/core/services/mongodb/remote/sync/internal/DocumentVersionInfo.java#L185-L192 |
157,877 | mongodb/stitch-android-sdk | core/services/mongodb-remote/src/main/java/com/mongodb/stitch/core/services/mongodb/remote/sync/internal/DocumentVersionInfo.java | DocumentVersionInfo.getFreshVersionDocument | static BsonDocument getFreshVersionDocument() {
final BsonDocument versionDoc = new BsonDocument();
versionDoc.append(Fields.SYNC_PROTOCOL_VERSION_FIELD, new BsonInt32(1));
versionDoc.append(Fields.INSTANCE_ID_FIELD, new BsonString(UUID.randomUUID().toString()));
versionDoc.append(Fields.VERSION_COUNTE... | java | static BsonDocument getFreshVersionDocument() {
final BsonDocument versionDoc = new BsonDocument();
versionDoc.append(Fields.SYNC_PROTOCOL_VERSION_FIELD, new BsonInt32(1));
versionDoc.append(Fields.INSTANCE_ID_FIELD, new BsonString(UUID.randomUUID().toString()));
versionDoc.append(Fields.VERSION_COUNTE... | [
"static",
"BsonDocument",
"getFreshVersionDocument",
"(",
")",
"{",
"final",
"BsonDocument",
"versionDoc",
"=",
"new",
"BsonDocument",
"(",
")",
";",
"versionDoc",
".",
"append",
"(",
"Fields",
".",
"SYNC_PROTOCOL_VERSION_FIELD",
",",
"new",
"BsonInt32",
"(",
"1",... | Returns a BSON version document representing a new version with a new instance ID, and
version counter of zero.
@return a BsonDocument representing a synchronization version | [
"Returns",
"a",
"BSON",
"version",
"document",
"representing",
"a",
"new",
"version",
"with",
"a",
"new",
"instance",
"ID",
"and",
"version",
"counter",
"of",
"zero",
"."
] | 159b9334b1f1a827285544be5ee20cdf7b04e4cc | https://github.com/mongodb/stitch-android-sdk/blob/159b9334b1f1a827285544be5ee20cdf7b04e4cc/core/services/mongodb-remote/src/main/java/com/mongodb/stitch/core/services/mongodb/remote/sync/internal/DocumentVersionInfo.java#L210-L218 |
157,878 | mongodb/stitch-android-sdk | core/services/mongodb-remote/src/main/java/com/mongodb/stitch/core/services/mongodb/remote/sync/internal/DocumentVersionInfo.java | DocumentVersionInfo.getDocumentVersionDoc | static BsonDocument getDocumentVersionDoc(final BsonDocument document) {
if (document == null || !document.containsKey(DOCUMENT_VERSION_FIELD)) {
return null;
}
return document.getDocument(DOCUMENT_VERSION_FIELD, null);
} | java | static BsonDocument getDocumentVersionDoc(final BsonDocument document) {
if (document == null || !document.containsKey(DOCUMENT_VERSION_FIELD)) {
return null;
}
return document.getDocument(DOCUMENT_VERSION_FIELD, null);
} | [
"static",
"BsonDocument",
"getDocumentVersionDoc",
"(",
"final",
"BsonDocument",
"document",
")",
"{",
"if",
"(",
"document",
"==",
"null",
"||",
"!",
"document",
".",
"containsKey",
"(",
"DOCUMENT_VERSION_FIELD",
")",
")",
"{",
"return",
"null",
";",
"}",
"re... | Returns the version document of the given document, if any; returns null otherwise.
@param document the document to get the version from.
@return the version of the given document, if any; returns null otherwise. | [
"Returns",
"the",
"version",
"document",
"of",
"the",
"given",
"document",
"if",
"any",
";",
"returns",
"null",
"otherwise",
"."
] | 159b9334b1f1a827285544be5ee20cdf7b04e4cc | https://github.com/mongodb/stitch-android-sdk/blob/159b9334b1f1a827285544be5ee20cdf7b04e4cc/core/services/mongodb-remote/src/main/java/com/mongodb/stitch/core/services/mongodb/remote/sync/internal/DocumentVersionInfo.java#L225-L230 |
157,879 | mongodb/stitch-android-sdk | core/services/mongodb-remote/src/main/java/com/mongodb/stitch/core/services/mongodb/remote/sync/internal/DocumentVersionInfo.java | DocumentVersionInfo.getVersionedFilter | static BsonDocument getVersionedFilter(
@Nonnull final BsonValue documentId,
@Nullable final BsonValue version
) {
final BsonDocument filter = new BsonDocument("_id", documentId);
if (version == null) {
filter.put(DOCUMENT_VERSION_FIELD, new BsonDocument("$exists", BsonBoolean.FALSE));
}... | java | static BsonDocument getVersionedFilter(
@Nonnull final BsonValue documentId,
@Nullable final BsonValue version
) {
final BsonDocument filter = new BsonDocument("_id", documentId);
if (version == null) {
filter.put(DOCUMENT_VERSION_FIELD, new BsonDocument("$exists", BsonBoolean.FALSE));
}... | [
"static",
"BsonDocument",
"getVersionedFilter",
"(",
"@",
"Nonnull",
"final",
"BsonValue",
"documentId",
",",
"@",
"Nullable",
"final",
"BsonValue",
"version",
")",
"{",
"final",
"BsonDocument",
"filter",
"=",
"new",
"BsonDocument",
"(",
"\"_id\"",
",",
"documentI... | Returns a query filter for the given document _id and version. The version is allowed to be
null. The query will match only if there is either no version on the document in the database
in question if we have no reference of the version or if the version matches the database's
version.
@param documentId the _id of the... | [
"Returns",
"a",
"query",
"filter",
"for",
"the",
"given",
"document",
"_id",
"and",
"version",
".",
"The",
"version",
"is",
"allowed",
"to",
"be",
"null",
".",
"The",
"query",
"will",
"match",
"only",
"if",
"there",
"is",
"either",
"no",
"version",
"on",... | 159b9334b1f1a827285544be5ee20cdf7b04e4cc | https://github.com/mongodb/stitch-android-sdk/blob/159b9334b1f1a827285544be5ee20cdf7b04e4cc/core/services/mongodb-remote/src/main/java/com/mongodb/stitch/core/services/mongodb/remote/sync/internal/DocumentVersionInfo.java#L242-L253 |
157,880 | mongodb/stitch-android-sdk | core/services/mongodb-remote/src/main/java/com/mongodb/stitch/core/services/mongodb/remote/sync/internal/DocumentVersionInfo.java | DocumentVersionInfo.getNextVersion | BsonDocument getNextVersion() {
if (!this.hasVersion() || this.getVersionDoc() == null) {
return getFreshVersionDocument();
}
final BsonDocument nextVersion = BsonUtils.copyOfDocument(this.getVersionDoc());
nextVersion.put(
Fields.VERSION_COUNTER_FIELD,
new BsonInt64(this.g... | java | BsonDocument getNextVersion() {
if (!this.hasVersion() || this.getVersionDoc() == null) {
return getFreshVersionDocument();
}
final BsonDocument nextVersion = BsonUtils.copyOfDocument(this.getVersionDoc());
nextVersion.put(
Fields.VERSION_COUNTER_FIELD,
new BsonInt64(this.g... | [
"BsonDocument",
"getNextVersion",
"(",
")",
"{",
"if",
"(",
"!",
"this",
".",
"hasVersion",
"(",
")",
"||",
"this",
".",
"getVersionDoc",
"(",
")",
"==",
"null",
")",
"{",
"return",
"getFreshVersionDocument",
"(",
")",
";",
"}",
"final",
"BsonDocument",
... | Given a DocumentVersionInfo, returns a BSON document representing the next version. This means
and incremented version count for a non-empty version, or a fresh version document for an
empty version.
@return a BsonDocument representing a synchronization version | [
"Given",
"a",
"DocumentVersionInfo",
"returns",
"a",
"BSON",
"document",
"representing",
"the",
"next",
"version",
".",
"This",
"means",
"and",
"incremented",
"version",
"count",
"for",
"a",
"non",
"-",
"empty",
"version",
"or",
"a",
"fresh",
"version",
"docum... | 159b9334b1f1a827285544be5ee20cdf7b04e4cc | https://github.com/mongodb/stitch-android-sdk/blob/159b9334b1f1a827285544be5ee20cdf7b04e4cc/core/services/mongodb-remote/src/main/java/com/mongodb/stitch/core/services/mongodb/remote/sync/internal/DocumentVersionInfo.java#L261-L270 |
157,881 | mongodb/stitch-android-sdk | android/services/mongodb-remote/src/main/java/com/mongodb/stitch/android/services/mongodb/remote/internal/RemoteMongoDatabaseImpl.java | RemoteMongoDatabaseImpl.getCollection | public RemoteMongoCollection<Document> getCollection(final String collectionName) {
return new RemoteMongoCollectionImpl<>(proxy.getCollection(collectionName), dispatcher);
} | java | public RemoteMongoCollection<Document> getCollection(final String collectionName) {
return new RemoteMongoCollectionImpl<>(proxy.getCollection(collectionName), dispatcher);
} | [
"public",
"RemoteMongoCollection",
"<",
"Document",
">",
"getCollection",
"(",
"final",
"String",
"collectionName",
")",
"{",
"return",
"new",
"RemoteMongoCollectionImpl",
"<>",
"(",
"proxy",
".",
"getCollection",
"(",
"collectionName",
")",
",",
"dispatcher",
")",
... | Gets a collection.
@param collectionName the name of the collection to return
@return the collection | [
"Gets",
"a",
"collection",
"."
] | 159b9334b1f1a827285544be5ee20cdf7b04e4cc | https://github.com/mongodb/stitch-android-sdk/blob/159b9334b1f1a827285544be5ee20cdf7b04e4cc/android/services/mongodb-remote/src/main/java/com/mongodb/stitch/android/services/mongodb/remote/internal/RemoteMongoDatabaseImpl.java#L54-L56 |
157,882 | mongodb/stitch-android-sdk | core/sdk/src/main/java/com/mongodb/stitch/core/internal/net/StitchEvent.java | StitchEvent.fromEvent | static <T> StitchEvent<T> fromEvent(final Event event,
final Decoder<T> decoder) {
return new StitchEvent<>(event.getEventName(), event.getData(), decoder);
} | java | static <T> StitchEvent<T> fromEvent(final Event event,
final Decoder<T> decoder) {
return new StitchEvent<>(event.getEventName(), event.getData(), decoder);
} | [
"static",
"<",
"T",
">",
"StitchEvent",
"<",
"T",
">",
"fromEvent",
"(",
"final",
"Event",
"event",
",",
"final",
"Decoder",
"<",
"T",
">",
"decoder",
")",
"{",
"return",
"new",
"StitchEvent",
"<>",
"(",
"event",
".",
"getEventName",
"(",
")",
",",
"... | Convert a SSE to a Stitch SSE
@param event SSE to convert
@param decoder decoder for decoding data
@param <T> type to decode data to
@return a Stitch server-sent event | [
"Convert",
"a",
"SSE",
"to",
"a",
"Stitch",
"SSE"
] | 159b9334b1f1a827285544be5ee20cdf7b04e4cc | https://github.com/mongodb/stitch-android-sdk/blob/159b9334b1f1a827285544be5ee20cdf7b04e4cc/core/sdk/src/main/java/com/mongodb/stitch/core/internal/net/StitchEvent.java#L142-L145 |
157,883 | mongodb/stitch-android-sdk | core/sdk/src/main/java/com/mongodb/stitch/core/internal/net/EventStreamReader.java | EventStreamReader.processEvent | protected final Event processEvent() throws IOException {
while (true) {
String line;
try {
line = readLine();
} catch (final EOFException ex) {
if (doneOnce) {
throw ex;
}
doneOnce = true;
line = "";
}
// If the line is empty (a blank... | java | protected final Event processEvent() throws IOException {
while (true) {
String line;
try {
line = readLine();
} catch (final EOFException ex) {
if (doneOnce) {
throw ex;
}
doneOnce = true;
line = "";
}
// If the line is empty (a blank... | [
"protected",
"final",
"Event",
"processEvent",
"(",
")",
"throws",
"IOException",
"{",
"while",
"(",
"true",
")",
"{",
"String",
"line",
";",
"try",
"{",
"line",
"=",
"readLine",
"(",
")",
";",
"}",
"catch",
"(",
"final",
"EOFException",
"ex",
")",
"{"... | Process the next event in a given stream.
@return the fully processed event
@throws IOException if a stream is in the wrong state, IO errors can be thrown | [
"Process",
"the",
"next",
"event",
"in",
"a",
"given",
"stream",
"."
] | 159b9334b1f1a827285544be5ee20cdf7b04e4cc | https://github.com/mongodb/stitch-android-sdk/blob/159b9334b1f1a827285544be5ee20cdf7b04e4cc/core/sdk/src/main/java/com/mongodb/stitch/core/internal/net/EventStreamReader.java#L86-L144 |
157,884 | mongodb/stitch-android-sdk | core/sdk/src/main/java/com/mongodb/stitch/core/internal/common/StitchError.java | StitchError.handleRichError | private static String handleRichError(final Response response, final String body) {
if (!response.getHeaders().containsKey(Headers.CONTENT_TYPE)
|| !response.getHeaders().get(Headers.CONTENT_TYPE).equals(ContentTypes.APPLICATION_JSON)) {
return body;
}
final Document doc;
try {
doc ... | java | private static String handleRichError(final Response response, final String body) {
if (!response.getHeaders().containsKey(Headers.CONTENT_TYPE)
|| !response.getHeaders().get(Headers.CONTENT_TYPE).equals(ContentTypes.APPLICATION_JSON)) {
return body;
}
final Document doc;
try {
doc ... | [
"private",
"static",
"String",
"handleRichError",
"(",
"final",
"Response",
"response",
",",
"final",
"String",
"body",
")",
"{",
"if",
"(",
"!",
"response",
".",
"getHeaders",
"(",
")",
".",
"containsKey",
"(",
"Headers",
".",
"CONTENT_TYPE",
")",
"||",
"... | Private helper method which decodes the Stitch error from the body of an HTTP `Response`
object. If the error is successfully decoded, this function will throw the error for the end
user to eventually consume. If the error cannot be decoded, this is likely not an error from
the Stitch server, and this function will ret... | [
"Private",
"helper",
"method",
"which",
"decodes",
"the",
"Stitch",
"error",
"from",
"the",
"body",
"of",
"an",
"HTTP",
"Response",
"object",
".",
"If",
"the",
"error",
"is",
"successfully",
"decoded",
"this",
"function",
"will",
"throw",
"the",
"error",
"fo... | 159b9334b1f1a827285544be5ee20cdf7b04e4cc | https://github.com/mongodb/stitch-android-sdk/blob/159b9334b1f1a827285544be5ee20cdf7b04e4cc/core/sdk/src/main/java/com/mongodb/stitch/core/internal/common/StitchError.java#L72-L95 |
157,885 | mongodb/stitch-android-sdk | android/core/src/main/java/com/mongodb/stitch/android/core/Stitch.java | Stitch.initialize | public static void initialize(final Context context) {
if (!initialized.compareAndSet(false, true)) {
return;
}
applicationContext = context.getApplicationContext();
final String packageName = applicationContext.getPackageName();
localAppName = packageName;
final PackageManager manager ... | java | public static void initialize(final Context context) {
if (!initialized.compareAndSet(false, true)) {
return;
}
applicationContext = context.getApplicationContext();
final String packageName = applicationContext.getPackageName();
localAppName = packageName;
final PackageManager manager ... | [
"public",
"static",
"void",
"initialize",
"(",
"final",
"Context",
"context",
")",
"{",
"if",
"(",
"!",
"initialized",
".",
"compareAndSet",
"(",
"false",
",",
"true",
")",
")",
"{",
"return",
";",
"}",
"applicationContext",
"=",
"context",
".",
"getApplic... | Initializes the Stitch SDK so that app clients can be created.
@param context An Android context value. | [
"Initializes",
"the",
"Stitch",
"SDK",
"so",
"that",
"app",
"clients",
"can",
"be",
"created",
"."
] | 159b9334b1f1a827285544be5ee20cdf7b04e4cc | https://github.com/mongodb/stitch-android-sdk/blob/159b9334b1f1a827285544be5ee20cdf7b04e4cc/android/core/src/main/java/com/mongodb/stitch/android/core/Stitch.java#L62-L81 |
157,886 | mongodb/stitch-android-sdk | android/core/src/main/java/com/mongodb/stitch/android/core/Stitch.java | Stitch.getAppClient | public static StitchAppClient getAppClient(
@Nonnull final String clientAppId
) {
ensureInitialized();
synchronized (Stitch.class) {
if (!appClients.containsKey(clientAppId)) {
throw new IllegalStateException(
String.format("client for app '%s' has not yet been initialized", c... | java | public static StitchAppClient getAppClient(
@Nonnull final String clientAppId
) {
ensureInitialized();
synchronized (Stitch.class) {
if (!appClients.containsKey(clientAppId)) {
throw new IllegalStateException(
String.format("client for app '%s' has not yet been initialized", c... | [
"public",
"static",
"StitchAppClient",
"getAppClient",
"(",
"@",
"Nonnull",
"final",
"String",
"clientAppId",
")",
"{",
"ensureInitialized",
"(",
")",
";",
"synchronized",
"(",
"Stitch",
".",
"class",
")",
"{",
"if",
"(",
"!",
"appClients",
".",
"containsKey",... | Gets an app client by its client app id if it has been initialized; throws if none can be
found.
@param clientAppId the client app id of the app client to get.
@return the app client associated with the client app id. | [
"Gets",
"an",
"app",
"client",
"by",
"its",
"client",
"app",
"id",
"if",
"it",
"has",
"been",
"initialized",
";",
"throws",
"if",
"none",
"can",
"be",
"found",
"."
] | 159b9334b1f1a827285544be5ee20cdf7b04e4cc | https://github.com/mongodb/stitch-android-sdk/blob/159b9334b1f1a827285544be5ee20cdf7b04e4cc/android/core/src/main/java/com/mongodb/stitch/android/core/Stitch.java#L114-L126 |
157,887 | mongodb/stitch-android-sdk | core/services/mongodb-remote/src/main/java/com/mongodb/stitch/core/services/mongodb/remote/sync/internal/NamespaceChangeStreamListener.java | NamespaceChangeStreamListener.start | public void start() {
nsLock.writeLock().lock();
try {
if (runnerThread != null) {
return;
}
runnerThread =
new Thread(new NamespaceChangeStreamRunner(
new WeakReference<>(this), networkMonitor, logger));
runnerThread.start();
} finally {
nsLock.... | java | public void start() {
nsLock.writeLock().lock();
try {
if (runnerThread != null) {
return;
}
runnerThread =
new Thread(new NamespaceChangeStreamRunner(
new WeakReference<>(this), networkMonitor, logger));
runnerThread.start();
} finally {
nsLock.... | [
"public",
"void",
"start",
"(",
")",
"{",
"nsLock",
".",
"writeLock",
"(",
")",
".",
"lock",
"(",
")",
";",
"try",
"{",
"if",
"(",
"runnerThread",
"!=",
"null",
")",
"{",
"return",
";",
"}",
"runnerThread",
"=",
"new",
"Thread",
"(",
"new",
"Namesp... | Opens the stream in a background thread. | [
"Opens",
"the",
"stream",
"in",
"a",
"background",
"thread",
"."
] | 159b9334b1f1a827285544be5ee20cdf7b04e4cc | https://github.com/mongodb/stitch-android-sdk/blob/159b9334b1f1a827285544be5ee20cdf7b04e4cc/core/services/mongodb-remote/src/main/java/com/mongodb/stitch/core/services/mongodb/remote/sync/internal/NamespaceChangeStreamListener.java#L91-L104 |
157,888 | mongodb/stitch-android-sdk | core/services/mongodb-remote/src/main/java/com/mongodb/stitch/core/services/mongodb/remote/sync/internal/NamespaceChangeStreamListener.java | NamespaceChangeStreamListener.stop | public void stop() {
if (runnerThread == null) {
return;
}
runnerThread.interrupt();
nsLock.writeLock().lock();
try {
if (runnerThread == null) {
return;
}
this.cancel();
this.close();
while (runnerThread.isAlive()) {
runnerThread.interrupt();
... | java | public void stop() {
if (runnerThread == null) {
return;
}
runnerThread.interrupt();
nsLock.writeLock().lock();
try {
if (runnerThread == null) {
return;
}
this.cancel();
this.close();
while (runnerThread.isAlive()) {
runnerThread.interrupt();
... | [
"public",
"void",
"stop",
"(",
")",
"{",
"if",
"(",
"runnerThread",
"==",
"null",
")",
"{",
"return",
";",
"}",
"runnerThread",
".",
"interrupt",
"(",
")",
";",
"nsLock",
".",
"writeLock",
"(",
")",
".",
"lock",
"(",
")",
";",
"try",
"{",
"if",
"... | Stops the background stream thread. | [
"Stops",
"the",
"background",
"stream",
"thread",
"."
] | 159b9334b1f1a827285544be5ee20cdf7b04e4cc | https://github.com/mongodb/stitch-android-sdk/blob/159b9334b1f1a827285544be5ee20cdf7b04e4cc/core/services/mongodb-remote/src/main/java/com/mongodb/stitch/core/services/mongodb/remote/sync/internal/NamespaceChangeStreamListener.java#L109-L140 |
157,889 | mongodb/stitch-android-sdk | core/services/mongodb-remote/src/main/java/com/mongodb/stitch/core/services/mongodb/remote/sync/internal/NamespaceChangeStreamListener.java | NamespaceChangeStreamListener.openStream | boolean openStream() throws InterruptedException, IOException {
logger.info("stream START");
final boolean isOpen;
final Set<BsonValue> idsToWatch = nsConfig.getSynchronizedDocumentIds();
if (!networkMonitor.isConnected()) {
logger.info("stream END - Network disconnected");
return false;
... | java | boolean openStream() throws InterruptedException, IOException {
logger.info("stream START");
final boolean isOpen;
final Set<BsonValue> idsToWatch = nsConfig.getSynchronizedDocumentIds();
if (!networkMonitor.isConnected()) {
logger.info("stream END - Network disconnected");
return false;
... | [
"boolean",
"openStream",
"(",
")",
"throws",
"InterruptedException",
",",
"IOException",
"{",
"logger",
".",
"info",
"(",
"\"stream START\"",
")",
";",
"final",
"boolean",
"isOpen",
";",
"final",
"Set",
"<",
"BsonValue",
">",
"idsToWatch",
"=",
"nsConfig",
"."... | Open the event stream
@return true if successfully opened, false if not | [
"Open",
"the",
"event",
"stream"
] | 159b9334b1f1a827285544be5ee20cdf7b04e4cc | https://github.com/mongodb/stitch-android-sdk/blob/159b9334b1f1a827285544be5ee20cdf7b04e4cc/core/services/mongodb-remote/src/main/java/com/mongodb/stitch/core/services/mongodb/remote/sync/internal/NamespaceChangeStreamListener.java#L193-L236 |
157,890 | mongodb/stitch-android-sdk | core/services/mongodb-remote/src/main/java/com/mongodb/stitch/core/services/mongodb/remote/sync/internal/NamespaceChangeStreamListener.java | NamespaceChangeStreamListener.getEvents | @SuppressWarnings("unchecked")
public Map<BsonValue, ChangeEvent<BsonDocument>> getEvents() {
nsLock.readLock().lock();
final Map<BsonValue, ChangeEvent<BsonDocument>> events;
try {
events = new HashMap<>(this.events);
} finally {
nsLock.readLock().unlock();
}
nsLock.writeLock().l... | java | @SuppressWarnings("unchecked")
public Map<BsonValue, ChangeEvent<BsonDocument>> getEvents() {
nsLock.readLock().lock();
final Map<BsonValue, ChangeEvent<BsonDocument>> events;
try {
events = new HashMap<>(this.events);
} finally {
nsLock.readLock().unlock();
}
nsLock.writeLock().l... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"Map",
"<",
"BsonValue",
",",
"ChangeEvent",
"<",
"BsonDocument",
">",
">",
"getEvents",
"(",
")",
"{",
"nsLock",
".",
"readLock",
"(",
")",
".",
"lock",
"(",
")",
";",
"final",
"Map",
"<",
... | Returns the latest change events, and clears them from the change stream listener.
@return the latest change events. | [
"Returns",
"the",
"latest",
"change",
"events",
"and",
"clears",
"them",
"from",
"the",
"change",
"stream",
"listener",
"."
] | 159b9334b1f1a827285544be5ee20cdf7b04e4cc | https://github.com/mongodb/stitch-android-sdk/blob/159b9334b1f1a827285544be5ee20cdf7b04e4cc/core/services/mongodb-remote/src/main/java/com/mongodb/stitch/core/services/mongodb/remote/sync/internal/NamespaceChangeStreamListener.java#L301-L318 |
157,891 | mongodb/stitch-android-sdk | core/services/mongodb-remote/src/main/java/com/mongodb/stitch/core/services/mongodb/remote/sync/internal/NamespaceChangeStreamListener.java | NamespaceChangeStreamListener.getUnprocessedEventForDocumentId | public @Nullable ChangeEvent<BsonDocument> getUnprocessedEventForDocumentId(
final BsonValue documentId
) {
final ChangeEvent<BsonDocument> event;
nsLock.readLock().lock();
try {
event = this.events.get(documentId);
} finally {
nsLock.readLock().unlock();
}
nsLock.writeLock(... | java | public @Nullable ChangeEvent<BsonDocument> getUnprocessedEventForDocumentId(
final BsonValue documentId
) {
final ChangeEvent<BsonDocument> event;
nsLock.readLock().lock();
try {
event = this.events.get(documentId);
} finally {
nsLock.readLock().unlock();
}
nsLock.writeLock(... | [
"public",
"@",
"Nullable",
"ChangeEvent",
"<",
"BsonDocument",
">",
"getUnprocessedEventForDocumentId",
"(",
"final",
"BsonValue",
"documentId",
")",
"{",
"final",
"ChangeEvent",
"<",
"BsonDocument",
">",
"event",
";",
"nsLock",
".",
"readLock",
"(",
")",
".",
"... | If there is an unprocessed change event for a particular document ID, fetch it from the
change stream listener, and remove it. By reading the event here, we are assuming it will be
processed by the consumer.
@return the latest unprocessed change event for the given document ID, or null if none exists. | [
"If",
"there",
"is",
"an",
"unprocessed",
"change",
"event",
"for",
"a",
"particular",
"document",
"ID",
"fetch",
"it",
"from",
"the",
"change",
"stream",
"listener",
"and",
"remove",
"it",
".",
"By",
"reading",
"the",
"event",
"here",
"we",
"are",
"assumi... | 159b9334b1f1a827285544be5ee20cdf7b04e4cc | https://github.com/mongodb/stitch-android-sdk/blob/159b9334b1f1a827285544be5ee20cdf7b04e4cc/core/services/mongodb-remote/src/main/java/com/mongodb/stitch/core/services/mongodb/remote/sync/internal/NamespaceChangeStreamListener.java#L327-L345 |
157,892 | mongodb/stitch-android-sdk | core/services/mongodb-remote/src/main/java/com/mongodb/stitch/core/services/mongodb/remote/sync/internal/HashUtils.java | HashUtils.hash | public static long hash(final BsonDocument doc) {
if (doc == null) {
return 0L;
}
final byte[] docBytes = toBytes(doc);
long hashValue = FNV_64BIT_OFFSET_BASIS;
for (int offset = 0; offset < docBytes.length; offset++) {
hashValue ^= (0xFF & docBytes[offset]);
hashValue *= FNV_64B... | java | public static long hash(final BsonDocument doc) {
if (doc == null) {
return 0L;
}
final byte[] docBytes = toBytes(doc);
long hashValue = FNV_64BIT_OFFSET_BASIS;
for (int offset = 0; offset < docBytes.length; offset++) {
hashValue ^= (0xFF & docBytes[offset]);
hashValue *= FNV_64B... | [
"public",
"static",
"long",
"hash",
"(",
"final",
"BsonDocument",
"doc",
")",
"{",
"if",
"(",
"doc",
"==",
"null",
")",
"{",
"return",
"0L",
";",
"}",
"final",
"byte",
"[",
"]",
"docBytes",
"=",
"toBytes",
"(",
"doc",
")",
";",
"long",
"hashValue",
... | Implementation of FNV-1a hash algorithm.
@see <a href="https://en.wikipedia.org/wiki/Fowler%E2%80%93Noll%E2%80%93Vo_hash_function">
ttps://en.wikipedia.org/wiki/Fowler%E2%80%93Noll%E2%80%93Vo_hash_function</a>
@param doc the document to hash
@return | [
"Implementation",
"of",
"FNV",
"-",
"1a",
"hash",
"algorithm",
"."
] | 159b9334b1f1a827285544be5ee20cdf7b04e4cc | https://github.com/mongodb/stitch-android-sdk/blob/159b9334b1f1a827285544be5ee20cdf7b04e4cc/core/services/mongodb-remote/src/main/java/com/mongodb/stitch/core/services/mongodb/remote/sync/internal/HashUtils.java#L45-L59 |
157,893 | mongodb/stitch-android-sdk | core/services/mongodb-remote/src/main/java/com/mongodb/stitch/core/services/mongodb/remote/sync/internal/SyncMongoClientFactory.java | SyncMongoClientFactory.deleteDatabase | public static boolean deleteDatabase(final StitchAppClientInfo appInfo,
final String serviceName,
final EmbeddedMongoClientFactory clientFactory,
final String userId) {
final String dataDir = appInfo... | java | public static boolean deleteDatabase(final StitchAppClientInfo appInfo,
final String serviceName,
final EmbeddedMongoClientFactory clientFactory,
final String userId) {
final String dataDir = appInfo... | [
"public",
"static",
"boolean",
"deleteDatabase",
"(",
"final",
"StitchAppClientInfo",
"appInfo",
",",
"final",
"String",
"serviceName",
",",
"final",
"EmbeddedMongoClientFactory",
"clientFactory",
",",
"final",
"String",
"userId",
")",
"{",
"final",
"String",
"dataDir... | Delete a database for a given path and userId.
@param appInfo the info for this application
@param serviceName the name of the associated service
@param clientFactory the associated factory that creates clients
@param userId the id of the user's to delete
@return true if successfully deleted, false if not | [
"Delete",
"a",
"database",
"for",
"a",
"given",
"path",
"and",
"userId",
"."
] | 159b9334b1f1a827285544be5ee20cdf7b04e4cc | https://github.com/mongodb/stitch-android-sdk/blob/159b9334b1f1a827285544be5ee20cdf7b04e4cc/core/services/mongodb-remote/src/main/java/com/mongodb/stitch/core/services/mongodb/remote/sync/internal/SyncMongoClientFactory.java#L53-L81 |
157,894 | mongodb/stitch-android-sdk | android/services/mongodb-remote/src/main/java/com/mongodb/stitch/android/services/mongodb/remote/internal/RemoteMongoCollectionImpl.java | RemoteMongoCollectionImpl.count | public Task<Long> count() {
return dispatcher.dispatchTask(new Callable<Long>() {
@Override
public Long call() {
return proxy.count();
}
});
} | java | public Task<Long> count() {
return dispatcher.dispatchTask(new Callable<Long>() {
@Override
public Long call() {
return proxy.count();
}
});
} | [
"public",
"Task",
"<",
"Long",
">",
"count",
"(",
")",
"{",
"return",
"dispatcher",
".",
"dispatchTask",
"(",
"new",
"Callable",
"<",
"Long",
">",
"(",
")",
"{",
"@",
"Override",
"public",
"Long",
"call",
"(",
")",
"{",
"return",
"proxy",
".",
"count... | Counts the number of documents in the collection.
@return a task containing the number of documents in the collection | [
"Counts",
"the",
"number",
"of",
"documents",
"in",
"the",
"collection",
"."
] | 159b9334b1f1a827285544be5ee20cdf7b04e4cc | https://github.com/mongodb/stitch-android-sdk/blob/159b9334b1f1a827285544be5ee20cdf7b04e4cc/android/services/mongodb-remote/src/main/java/com/mongodb/stitch/android/services/mongodb/remote/internal/RemoteMongoCollectionImpl.java#L106-L113 |
157,895 | mongodb/stitch-android-sdk | android/services/mongodb-remote/src/main/java/com/mongodb/stitch/android/services/mongodb/remote/internal/RemoteMongoCollectionImpl.java | RemoteMongoCollectionImpl.insertOne | public Task<RemoteInsertOneResult> insertOne(final DocumentT document) {
return dispatcher.dispatchTask(new Callable<RemoteInsertOneResult>() {
@Override
public RemoteInsertOneResult call() {
return proxy.insertOne(document);
}
});
} | java | public Task<RemoteInsertOneResult> insertOne(final DocumentT document) {
return dispatcher.dispatchTask(new Callable<RemoteInsertOneResult>() {
@Override
public RemoteInsertOneResult call() {
return proxy.insertOne(document);
}
});
} | [
"public",
"Task",
"<",
"RemoteInsertOneResult",
">",
"insertOne",
"(",
"final",
"DocumentT",
"document",
")",
"{",
"return",
"dispatcher",
".",
"dispatchTask",
"(",
"new",
"Callable",
"<",
"RemoteInsertOneResult",
">",
"(",
")",
"{",
"@",
"Override",
"public",
... | Inserts the provided document. If the document is missing an identifier, the client should
generate one.
@param document the document to insert
@return a task containing the result of the insert one operation | [
"Inserts",
"the",
"provided",
"document",
".",
"If",
"the",
"document",
"is",
"missing",
"an",
"identifier",
"the",
"client",
"should",
"generate",
"one",
"."
] | 159b9334b1f1a827285544be5ee20cdf7b04e4cc | https://github.com/mongodb/stitch-android-sdk/blob/159b9334b1f1a827285544be5ee20cdf7b04e4cc/android/services/mongodb-remote/src/main/java/com/mongodb/stitch/android/services/mongodb/remote/internal/RemoteMongoCollectionImpl.java#L324-L331 |
157,896 | mongodb/stitch-android-sdk | android/core/src/main/java/com/mongodb/stitch/android/core/auth/providers/userpassword/internal/UserPasswordAuthProviderClientImpl.java | UserPasswordAuthProviderClientImpl.registerWithEmail | public Task<Void> registerWithEmail(@NonNull final String email, @NonNull final String password) {
return dispatcher.dispatchTask(
new Callable<Void>() {
@Override
public Void call() {
registerWithEmailInternal(email, password);
return null;
}
})... | java | public Task<Void> registerWithEmail(@NonNull final String email, @NonNull final String password) {
return dispatcher.dispatchTask(
new Callable<Void>() {
@Override
public Void call() {
registerWithEmailInternal(email, password);
return null;
}
})... | [
"public",
"Task",
"<",
"Void",
">",
"registerWithEmail",
"(",
"@",
"NonNull",
"final",
"String",
"email",
",",
"@",
"NonNull",
"final",
"String",
"password",
")",
"{",
"return",
"dispatcher",
".",
"dispatchTask",
"(",
"new",
"Callable",
"<",
"Void",
">",
"... | Registers a new user with the given email and password.
@param email the email to register with. This will be the username used during log in.
@param password the password to associated with the email. The password must be between
6 and 128 characters long.
@return A {@link Task} that completes when registration compl... | [
"Registers",
"a",
"new",
"user",
"with",
"the",
"given",
"email",
"and",
"password",
"."
] | 159b9334b1f1a827285544be5ee20cdf7b04e4cc | https://github.com/mongodb/stitch-android-sdk/blob/159b9334b1f1a827285544be5ee20cdf7b04e4cc/android/core/src/main/java/com/mongodb/stitch/android/core/auth/providers/userpassword/internal/UserPasswordAuthProviderClientImpl.java#L62-L71 |
157,897 | mongodb/stitch-android-sdk | android/core/src/main/java/com/mongodb/stitch/android/core/auth/providers/userpassword/internal/UserPasswordAuthProviderClientImpl.java | UserPasswordAuthProviderClientImpl.confirmUser | public Task<Void> confirmUser(@NonNull final String token, @NonNull final String tokenId) {
return dispatcher.dispatchTask(
new Callable<Void>() {
@Override
public Void call() {
confirmUserInternal(token, tokenId);
return null;
}
});
} | java | public Task<Void> confirmUser(@NonNull final String token, @NonNull final String tokenId) {
return dispatcher.dispatchTask(
new Callable<Void>() {
@Override
public Void call() {
confirmUserInternal(token, tokenId);
return null;
}
});
} | [
"public",
"Task",
"<",
"Void",
">",
"confirmUser",
"(",
"@",
"NonNull",
"final",
"String",
"token",
",",
"@",
"NonNull",
"final",
"String",
"tokenId",
")",
"{",
"return",
"dispatcher",
".",
"dispatchTask",
"(",
"new",
"Callable",
"<",
"Void",
">",
"(",
"... | Confirms a user with the given token and token id.
@param token the confirmation token.
@param tokenId the id of the confirmation token.
@return A {@link Task} that completes when confirmation completes/fails. | [
"Confirms",
"a",
"user",
"with",
"the",
"given",
"token",
"and",
"token",
"id",
"."
] | 159b9334b1f1a827285544be5ee20cdf7b04e4cc | https://github.com/mongodb/stitch-android-sdk/blob/159b9334b1f1a827285544be5ee20cdf7b04e4cc/android/core/src/main/java/com/mongodb/stitch/android/core/auth/providers/userpassword/internal/UserPasswordAuthProviderClientImpl.java#L80-L89 |
157,898 | mongodb/stitch-android-sdk | android/core/src/main/java/com/mongodb/stitch/android/core/auth/providers/userpassword/internal/UserPasswordAuthProviderClientImpl.java | UserPasswordAuthProviderClientImpl.resendConfirmationEmail | public Task<Void> resendConfirmationEmail(@NonNull final String email) {
return dispatcher.dispatchTask(
new Callable<Void>() {
@Override
public Void call() {
resendConfirmationEmailInternal(email);
return null;
}
});
} | java | public Task<Void> resendConfirmationEmail(@NonNull final String email) {
return dispatcher.dispatchTask(
new Callable<Void>() {
@Override
public Void call() {
resendConfirmationEmailInternal(email);
return null;
}
});
} | [
"public",
"Task",
"<",
"Void",
">",
"resendConfirmationEmail",
"(",
"@",
"NonNull",
"final",
"String",
"email",
")",
"{",
"return",
"dispatcher",
".",
"dispatchTask",
"(",
"new",
"Callable",
"<",
"Void",
">",
"(",
")",
"{",
"@",
"Override",
"public",
"Void... | Resend the confirmation for a user to the given email.
@param email the email of the user.
@return A {@link Task} that completes when the resend request completes/fails. | [
"Resend",
"the",
"confirmation",
"for",
"a",
"user",
"to",
"the",
"given",
"email",
"."
] | 159b9334b1f1a827285544be5ee20cdf7b04e4cc | https://github.com/mongodb/stitch-android-sdk/blob/159b9334b1f1a827285544be5ee20cdf7b04e4cc/android/core/src/main/java/com/mongodb/stitch/android/core/auth/providers/userpassword/internal/UserPasswordAuthProviderClientImpl.java#L97-L106 |
157,899 | mongodb/stitch-android-sdk | android/core/src/main/java/com/mongodb/stitch/android/core/auth/providers/userpassword/internal/UserPasswordAuthProviderClientImpl.java | UserPasswordAuthProviderClientImpl.sendResetPasswordEmail | public Task<Void> sendResetPasswordEmail(@NonNull final String email) {
return dispatcher.dispatchTask(
new Callable<Void>() {
@Override
public Void call() {
sendResetPasswordEmailInternal(email);
return null;
}
});
} | java | public Task<Void> sendResetPasswordEmail(@NonNull final String email) {
return dispatcher.dispatchTask(
new Callable<Void>() {
@Override
public Void call() {
sendResetPasswordEmailInternal(email);
return null;
}
});
} | [
"public",
"Task",
"<",
"Void",
">",
"sendResetPasswordEmail",
"(",
"@",
"NonNull",
"final",
"String",
"email",
")",
"{",
"return",
"dispatcher",
".",
"dispatchTask",
"(",
"new",
"Callable",
"<",
"Void",
">",
"(",
")",
"{",
"@",
"Override",
"public",
"Void"... | Sends a user a password reset email for the given email.
@param email the email of the user.
@return A {@link Task} that completes when the reqest request completes/fails. | [
"Sends",
"a",
"user",
"a",
"password",
"reset",
"email",
"for",
"the",
"given",
"email",
"."
] | 159b9334b1f1a827285544be5ee20cdf7b04e4cc | https://github.com/mongodb/stitch-android-sdk/blob/159b9334b1f1a827285544be5ee20cdf7b04e4cc/android/core/src/main/java/com/mongodb/stitch/android/core/auth/providers/userpassword/internal/UserPasswordAuthProviderClientImpl.java#L135-L144 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.