repo stringlengths 7 58 | path stringlengths 12 218 | func_name stringlengths 3 140 | original_string stringlengths 73 34.1k | language stringclasses 1
value | code stringlengths 73 34.1k | code_tokens list | docstring stringlengths 3 16k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 105 339 | partition stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|
Asana/java-asana | src/main/java/com/asana/resources/gen/WebhooksBase.java | WebhooksBase.getById | public ItemRequest<Webhook> getById(String webhook) {
String path = String.format("/webhooks/%s", webhook);
return new ItemRequest<Webhook>(this, Webhook.class, path, "GET");
} | java | public ItemRequest<Webhook> getById(String webhook) {
String path = String.format("/webhooks/%s", webhook);
return new ItemRequest<Webhook>(this, Webhook.class, path, "GET");
} | [
"public",
"ItemRequest",
"<",
"Webhook",
">",
"getById",
"(",
"String",
"webhook",
")",
"{",
"String",
"path",
"=",
"String",
".",
"format",
"(",
"\"/webhooks/%s\"",
",",
"webhook",
")",
";",
"return",
"new",
"ItemRequest",
"<",
"Webhook",
">",
"(",
"this"... | Returns the full record for the given webhook.
@param webhook The webhook to get.
@return Request object | [
"Returns",
"the",
"full",
"record",
"for",
"the",
"given",
"webhook",
"."
] | abeea92fd5a71260a5d804db4da94e52fd7a15a7 | https://github.com/Asana/java-asana/blob/abeea92fd5a71260a5d804db4da94e52fd7a15a7/src/main/java/com/asana/resources/gen/WebhooksBase.java#L104-L108 | train |
Asana/java-asana | src/main/java/com/asana/resources/gen/WebhooksBase.java | WebhooksBase.deleteById | public ItemRequest<Webhook> deleteById(String webhook) {
String path = String.format("/webhooks/%s", webhook);
return new ItemRequest<Webhook>(this, Webhook.class, path, "DELETE");
} | java | public ItemRequest<Webhook> deleteById(String webhook) {
String path = String.format("/webhooks/%s", webhook);
return new ItemRequest<Webhook>(this, Webhook.class, path, "DELETE");
} | [
"public",
"ItemRequest",
"<",
"Webhook",
">",
"deleteById",
"(",
"String",
"webhook",
")",
"{",
"String",
"path",
"=",
"String",
".",
"format",
"(",
"\"/webhooks/%s\"",
",",
"webhook",
")",
";",
"return",
"new",
"ItemRequest",
"<",
"Webhook",
">",
"(",
"th... | This method permanently removes a webhook. Note that it may be possible
to receive a request that was already in flight after deleting the
webhook, but no further requests will be issued.
@param webhook The webhook to delete.
@return Request object | [
"This",
"method",
"permanently",
"removes",
"a",
"webhook",
".",
"Note",
"that",
"it",
"may",
"be",
"possible",
"to",
"receive",
"a",
"request",
"that",
"was",
"already",
"in",
"flight",
"after",
"deleting",
"the",
"webhook",
"but",
"no",
"further",
"request... | abeea92fd5a71260a5d804db4da94e52fd7a15a7 | https://github.com/Asana/java-asana/blob/abeea92fd5a71260a5d804db4da94e52fd7a15a7/src/main/java/com/asana/resources/gen/WebhooksBase.java#L118-L122 | train |
Asana/java-asana | src/main/java/com/asana/resources/Events.java | Events.get | public EventsRequest<Event> get(String resource, String sync) {
return new EventsRequest<Event>(this, Event.class, "/events", "GET")
.query("resource", resource)
.query("sync", sync);
} | java | public EventsRequest<Event> get(String resource, String sync) {
return new EventsRequest<Event>(this, Event.class, "/events", "GET")
.query("resource", resource)
.query("sync", sync);
} | [
"public",
"EventsRequest",
"<",
"Event",
">",
"get",
"(",
"String",
"resource",
",",
"String",
"sync",
")",
"{",
"return",
"new",
"EventsRequest",
"<",
"Event",
">",
"(",
"this",
",",
"Event",
".",
"class",
",",
"\"/events\"",
",",
"\"GET\"",
")",
".",
... | Returns any events for the given resource ID since the last sync token
@param resource Globally unique identifier for the resource.
@param sync Sync token provided by a previous call to the events API
@return Request object | [
"Returns",
"any",
"events",
"for",
"the",
"given",
"resource",
"ID",
"since",
"the",
"last",
"sync",
"token"
] | abeea92fd5a71260a5d804db4da94e52fd7a15a7 | https://github.com/Asana/java-asana/blob/abeea92fd5a71260a5d804db4da94e52fd7a15a7/src/main/java/com/asana/resources/Events.java#L20-L24 | train |
Asana/java-asana | src/main/java/com/asana/resources/gen/ProjectMembershipsBase.java | ProjectMembershipsBase.findByProject | public CollectionRequest<ProjectMembership> findByProject(String project) {
String path = String.format("/projects/%s/project_memberships", project);
return new CollectionRequest<ProjectMembership>(this, ProjectMembership.class, path, "GET");
} | java | public CollectionRequest<ProjectMembership> findByProject(String project) {
String path = String.format("/projects/%s/project_memberships", project);
return new CollectionRequest<ProjectMembership>(this, ProjectMembership.class, path, "GET");
} | [
"public",
"CollectionRequest",
"<",
"ProjectMembership",
">",
"findByProject",
"(",
"String",
"project",
")",
"{",
"String",
"path",
"=",
"String",
".",
"format",
"(",
"\"/projects/%s/project_memberships\"",
",",
"project",
")",
";",
"return",
"new",
"CollectionRequ... | Returns the compact project membership records for the project.
@param project The project for which to fetch memberships.
@return Request object | [
"Returns",
"the",
"compact",
"project",
"membership",
"records",
"for",
"the",
"project",
"."
] | abeea92fd5a71260a5d804db4da94e52fd7a15a7 | https://github.com/Asana/java-asana/blob/abeea92fd5a71260a5d804db4da94e52fd7a15a7/src/main/java/com/asana/resources/gen/ProjectMembershipsBase.java#L29-L33 | train |
Asana/java-asana | src/main/java/com/asana/resources/gen/ProjectMembershipsBase.java | ProjectMembershipsBase.findById | public ItemRequest<ProjectMembership> findById(String projectMembership) {
String path = String.format("/project_memberships/%s", projectMembership);
return new ItemRequest<ProjectMembership>(this, ProjectMembership.class, path, "GET");
} | java | public ItemRequest<ProjectMembership> findById(String projectMembership) {
String path = String.format("/project_memberships/%s", projectMembership);
return new ItemRequest<ProjectMembership>(this, ProjectMembership.class, path, "GET");
} | [
"public",
"ItemRequest",
"<",
"ProjectMembership",
">",
"findById",
"(",
"String",
"projectMembership",
")",
"{",
"String",
"path",
"=",
"String",
".",
"format",
"(",
"\"/project_memberships/%s\"",
",",
"projectMembership",
")",
";",
"return",
"new",
"ItemRequest",
... | Returns the project membership record.
@param projectMembership Globally unique identifier for the project membership.
@return Request object | [
"Returns",
"the",
"project",
"membership",
"record",
"."
] | abeea92fd5a71260a5d804db4da94e52fd7a15a7 | https://github.com/Asana/java-asana/blob/abeea92fd5a71260a5d804db4da94e52fd7a15a7/src/main/java/com/asana/resources/gen/ProjectMembershipsBase.java#L41-L45 | train |
Asana/java-asana | src/main/java/com/asana/resources/gen/StoriesBase.java | StoriesBase.findByTask | public CollectionRequest<Story> findByTask(String task) {
String path = String.format("/tasks/%s/stories", task);
return new CollectionRequest<Story>(this, Story.class, path, "GET");
} | java | public CollectionRequest<Story> findByTask(String task) {
String path = String.format("/tasks/%s/stories", task);
return new CollectionRequest<Story>(this, Story.class, path, "GET");
} | [
"public",
"CollectionRequest",
"<",
"Story",
">",
"findByTask",
"(",
"String",
"task",
")",
"{",
"String",
"path",
"=",
"String",
".",
"format",
"(",
"\"/tasks/%s/stories\"",
",",
"task",
")",
";",
"return",
"new",
"CollectionRequest",
"<",
"Story",
">",
"("... | Returns the compact records for all stories on the task.
@param task Globally unique identifier for the task.
@return Request object | [
"Returns",
"the",
"compact",
"records",
"for",
"all",
"stories",
"on",
"the",
"task",
"."
] | abeea92fd5a71260a5d804db4da94e52fd7a15a7 | https://github.com/Asana/java-asana/blob/abeea92fd5a71260a5d804db4da94e52fd7a15a7/src/main/java/com/asana/resources/gen/StoriesBase.java#L32-L36 | train |
Asana/java-asana | src/main/java/com/asana/resources/gen/StoriesBase.java | StoriesBase.findById | public ItemRequest<Story> findById(String story) {
String path = String.format("/stories/%s", story);
return new ItemRequest<Story>(this, Story.class, path, "GET");
} | java | public ItemRequest<Story> findById(String story) {
String path = String.format("/stories/%s", story);
return new ItemRequest<Story>(this, Story.class, path, "GET");
} | [
"public",
"ItemRequest",
"<",
"Story",
">",
"findById",
"(",
"String",
"story",
")",
"{",
"String",
"path",
"=",
"String",
".",
"format",
"(",
"\"/stories/%s\"",
",",
"story",
")",
";",
"return",
"new",
"ItemRequest",
"<",
"Story",
">",
"(",
"this",
",",... | Returns the full record for a single story.
@param story Globally unique identifier for the story.
@return Request object | [
"Returns",
"the",
"full",
"record",
"for",
"a",
"single",
"story",
"."
] | abeea92fd5a71260a5d804db4da94e52fd7a15a7 | https://github.com/Asana/java-asana/blob/abeea92fd5a71260a5d804db4da94e52fd7a15a7/src/main/java/com/asana/resources/gen/StoriesBase.java#L44-L48 | train |
Asana/java-asana | src/main/java/com/asana/resources/gen/StoriesBase.java | StoriesBase.update | public ItemRequest<Story> update(String story) {
String path = String.format("/stories/%s", story);
return new ItemRequest<Story>(this, Story.class, path, "PUT");
} | java | public ItemRequest<Story> update(String story) {
String path = String.format("/stories/%s", story);
return new ItemRequest<Story>(this, Story.class, path, "PUT");
} | [
"public",
"ItemRequest",
"<",
"Story",
">",
"update",
"(",
"String",
"story",
")",
"{",
"String",
"path",
"=",
"String",
".",
"format",
"(",
"\"/stories/%s\"",
",",
"story",
")",
";",
"return",
"new",
"ItemRequest",
"<",
"Story",
">",
"(",
"this",
",",
... | Updates the story and returns the full record for the updated story.
Only comment stories can have their text updated, and only comment stories and
attachment stories can be pinned. Only one of `text` and `html_text` can be specified.
@param story Globally unique identifier for the story.
@return Request object | [
"Updates",
"the",
"story",
"and",
"returns",
"the",
"full",
"record",
"for",
"the",
"updated",
"story",
".",
"Only",
"comment",
"stories",
"can",
"have",
"their",
"text",
"updated",
"and",
"only",
"comment",
"stories",
"and",
"attachment",
"stories",
"can",
... | abeea92fd5a71260a5d804db4da94e52fd7a15a7 | https://github.com/Asana/java-asana/blob/abeea92fd5a71260a5d804db4da94e52fd7a15a7/src/main/java/com/asana/resources/gen/StoriesBase.java#L74-L78 | train |
Asana/java-asana | src/main/java/com/asana/resources/gen/StoriesBase.java | StoriesBase.delete | public ItemRequest<Story> delete(String story) {
String path = String.format("/stories/%s", story);
return new ItemRequest<Story>(this, Story.class, path, "DELETE");
} | java | public ItemRequest<Story> delete(String story) {
String path = String.format("/stories/%s", story);
return new ItemRequest<Story>(this, Story.class, path, "DELETE");
} | [
"public",
"ItemRequest",
"<",
"Story",
">",
"delete",
"(",
"String",
"story",
")",
"{",
"String",
"path",
"=",
"String",
".",
"format",
"(",
"\"/stories/%s\"",
",",
"story",
")",
";",
"return",
"new",
"ItemRequest",
"<",
"Story",
">",
"(",
"this",
",",
... | Deletes a story. A user can only delete stories they have created. Returns an empty data record.
@param story Globally unique identifier for the story.
@return Request object | [
"Deletes",
"a",
"story",
".",
"A",
"user",
"can",
"only",
"delete",
"stories",
"they",
"have",
"created",
".",
"Returns",
"an",
"empty",
"data",
"record",
"."
] | abeea92fd5a71260a5d804db4da94e52fd7a15a7 | https://github.com/Asana/java-asana/blob/abeea92fd5a71260a5d804db4da94e52fd7a15a7/src/main/java/com/asana/resources/gen/StoriesBase.java#L86-L90 | train |
Asana/java-asana | src/main/java/com/asana/resources/gen/WorkspacesBase.java | WorkspacesBase.findById | public ItemRequest<Workspace> findById(String workspace) {
String path = String.format("/workspaces/%s", workspace);
return new ItemRequest<Workspace>(this, Workspace.class, path, "GET");
} | java | public ItemRequest<Workspace> findById(String workspace) {
String path = String.format("/workspaces/%s", workspace);
return new ItemRequest<Workspace>(this, Workspace.class, path, "GET");
} | [
"public",
"ItemRequest",
"<",
"Workspace",
">",
"findById",
"(",
"String",
"workspace",
")",
"{",
"String",
"path",
"=",
"String",
".",
"format",
"(",
"\"/workspaces/%s\"",
",",
"workspace",
")",
";",
"return",
"new",
"ItemRequest",
"<",
"Workspace",
">",
"(... | Returns the full workspace record for a single workspace.
@param workspace Globally unique identifier for the workspace or organization.
@return Request object | [
"Returns",
"the",
"full",
"workspace",
"record",
"for",
"a",
"single",
"workspace",
"."
] | abeea92fd5a71260a5d804db4da94e52fd7a15a7 | https://github.com/Asana/java-asana/blob/abeea92fd5a71260a5d804db4da94e52fd7a15a7/src/main/java/com/asana/resources/gen/WorkspacesBase.java#L39-L43 | train |
Asana/java-asana | src/main/java/com/asana/resources/gen/WorkspacesBase.java | WorkspacesBase.update | public ItemRequest<Workspace> update(String workspace) {
String path = String.format("/workspaces/%s", workspace);
return new ItemRequest<Workspace>(this, Workspace.class, path, "PUT");
} | java | public ItemRequest<Workspace> update(String workspace) {
String path = String.format("/workspaces/%s", workspace);
return new ItemRequest<Workspace>(this, Workspace.class, path, "PUT");
} | [
"public",
"ItemRequest",
"<",
"Workspace",
">",
"update",
"(",
"String",
"workspace",
")",
"{",
"String",
"path",
"=",
"String",
".",
"format",
"(",
"\"/workspaces/%s\"",
",",
"workspace",
")",
";",
"return",
"new",
"ItemRequest",
"<",
"Workspace",
">",
"(",... | A specific, existing workspace can be updated by making a PUT request on
the URL for that workspace. Only the fields provided in the data block
will be updated; any unspecified fields will remain unchanged.
Currently the only field that can be modified for a workspace is its `name`.
Returns the complete, updated work... | [
"A",
"specific",
"existing",
"workspace",
"can",
"be",
"updated",
"by",
"making",
"a",
"PUT",
"request",
"on",
"the",
"URL",
"for",
"that",
"workspace",
".",
"Only",
"the",
"fields",
"provided",
"in",
"the",
"data",
"block",
"will",
"be",
"updated",
";",
... | abeea92fd5a71260a5d804db4da94e52fd7a15a7 | https://github.com/Asana/java-asana/blob/abeea92fd5a71260a5d804db4da94e52fd7a15a7/src/main/java/com/asana/resources/gen/WorkspacesBase.java#L67-L71 | train |
Asana/java-asana | src/main/java/com/asana/resources/gen/WorkspacesBase.java | WorkspacesBase.addUser | public ItemRequest<Workspace> addUser(String workspace) {
String path = String.format("/workspaces/%s/addUser", workspace);
return new ItemRequest<Workspace>(this, Workspace.class, path, "POST");
} | java | public ItemRequest<Workspace> addUser(String workspace) {
String path = String.format("/workspaces/%s/addUser", workspace);
return new ItemRequest<Workspace>(this, Workspace.class, path, "POST");
} | [
"public",
"ItemRequest",
"<",
"Workspace",
">",
"addUser",
"(",
"String",
"workspace",
")",
"{",
"String",
"path",
"=",
"String",
".",
"format",
"(",
"\"/workspaces/%s/addUser\"",
",",
"workspace",
")",
";",
"return",
"new",
"ItemRequest",
"<",
"Workspace",
">... | The user can be referenced by their globally unique user ID or their email address.
Returns the full user record for the invited user.
@param workspace The workspace or organization to invite the user to.
@return Request object | [
"The",
"user",
"can",
"be",
"referenced",
"by",
"their",
"globally",
"unique",
"user",
"ID",
"or",
"their",
"email",
"address",
".",
"Returns",
"the",
"full",
"user",
"record",
"for",
"the",
"invited",
"user",
"."
] | abeea92fd5a71260a5d804db4da94e52fd7a15a7 | https://github.com/Asana/java-asana/blob/abeea92fd5a71260a5d804db4da94e52fd7a15a7/src/main/java/com/asana/resources/gen/WorkspacesBase.java#L96-L100 | train |
Asana/java-asana | src/main/java/com/asana/resources/gen/WorkspacesBase.java | WorkspacesBase.removeUser | public ItemRequest<Workspace> removeUser(String workspace) {
String path = String.format("/workspaces/%s/removeUser", workspace);
return new ItemRequest<Workspace>(this, Workspace.class, path, "POST");
} | java | public ItemRequest<Workspace> removeUser(String workspace) {
String path = String.format("/workspaces/%s/removeUser", workspace);
return new ItemRequest<Workspace>(this, Workspace.class, path, "POST");
} | [
"public",
"ItemRequest",
"<",
"Workspace",
">",
"removeUser",
"(",
"String",
"workspace",
")",
"{",
"String",
"path",
"=",
"String",
".",
"format",
"(",
"\"/workspaces/%s/removeUser\"",
",",
"workspace",
")",
";",
"return",
"new",
"ItemRequest",
"<",
"Workspace"... | The user making this call must be an admin in the workspace.
Returns an empty data record.
@param workspace The workspace or organization to invite the user to.
@return Request object | [
"The",
"user",
"making",
"this",
"call",
"must",
"be",
"an",
"admin",
"in",
"the",
"workspace",
".",
"Returns",
"an",
"empty",
"data",
"record",
"."
] | abeea92fd5a71260a5d804db4da94e52fd7a15a7 | https://github.com/Asana/java-asana/blob/abeea92fd5a71260a5d804db4da94e52fd7a15a7/src/main/java/com/asana/resources/gen/WorkspacesBase.java#L109-L113 | train |
Asana/java-asana | src/main/java/com/asana/resources/Attachments.java | Attachments.createOnTask | public ItemRequest<Attachment> createOnTask(String task, InputStream fileContent, String fileName, String fileType) {
MultipartContent.Part part = new MultipartContent.Part()
.setContent(new InputStreamContent(fileType, fileContent))
.setHeaders(new HttpHeaders().set(
... | java | public ItemRequest<Attachment> createOnTask(String task, InputStream fileContent, String fileName, String fileType) {
MultipartContent.Part part = new MultipartContent.Part()
.setContent(new InputStreamContent(fileType, fileContent))
.setHeaders(new HttpHeaders().set(
... | [
"public",
"ItemRequest",
"<",
"Attachment",
">",
"createOnTask",
"(",
"String",
"task",
",",
"InputStream",
"fileContent",
",",
"String",
"fileName",
",",
"String",
"fileType",
")",
"{",
"MultipartContent",
".",
"Part",
"part",
"=",
"new",
"MultipartContent",
".... | Upload a file and attach it to a task
@param task Globally unique identifier for the task.
@param fileContent Content of the file to be uploaded
@param fileName Name of the file to be uploaded
@param fileType MIME type of the file to be uploaded
@return Request object | [
"Upload",
"a",
"file",
"and",
"attach",
"it",
"to",
"a",
"task"
] | abeea92fd5a71260a5d804db4da94e52fd7a15a7 | https://github.com/Asana/java-asana/blob/abeea92fd5a71260a5d804db4da94e52fd7a15a7/src/main/java/com/asana/resources/Attachments.java#L29-L43 | train |
Asana/java-asana | src/main/java/com/asana/resources/gen/OrganizationExportsBase.java | OrganizationExportsBase.findById | public ItemRequest<OrganizationExport> findById(String organizationExport) {
String path = String.format("/organization_exports/%s", organizationExport);
return new ItemRequest<OrganizationExport>(this, OrganizationExport.class, path, "GET");
} | java | public ItemRequest<OrganizationExport> findById(String organizationExport) {
String path = String.format("/organization_exports/%s", organizationExport);
return new ItemRequest<OrganizationExport>(this, OrganizationExport.class, path, "GET");
} | [
"public",
"ItemRequest",
"<",
"OrganizationExport",
">",
"findById",
"(",
"String",
"organizationExport",
")",
"{",
"String",
"path",
"=",
"String",
".",
"format",
"(",
"\"/organization_exports/%s\"",
",",
"organizationExport",
")",
";",
"return",
"new",
"ItemReques... | Returns details of a previously-requested Organization export.
@param organizationExport Globally unique identifier for the Organization export.
@return Request object | [
"Returns",
"details",
"of",
"a",
"previously",
"-",
"requested",
"Organization",
"export",
"."
] | abeea92fd5a71260a5d804db4da94e52fd7a15a7 | https://github.com/Asana/java-asana/blob/abeea92fd5a71260a5d804db4da94e52fd7a15a7/src/main/java/com/asana/resources/gen/OrganizationExportsBase.java#L37-L41 | train |
Asana/java-asana | src/main/java/com/asana/requests/Request.java | Request.option | public Request option(String key, Object value) {
this.options.put(key, value);
return this;
} | java | public Request option(String key, Object value) {
this.options.put(key, value);
return this;
} | [
"public",
"Request",
"option",
"(",
"String",
"key",
",",
"Object",
"value",
")",
"{",
"this",
".",
"options",
".",
"put",
"(",
"key",
",",
"value",
")",
";",
"return",
"this",
";",
"}"
] | Sets a client option per-request
@param key Option name
@param value Option value
@return The request itself | [
"Sets",
"a",
"client",
"option",
"per",
"-",
"request"
] | abeea92fd5a71260a5d804db4da94e52fd7a15a7 | https://github.com/Asana/java-asana/blob/abeea92fd5a71260a5d804db4da94e52fd7a15a7/src/main/java/com/asana/requests/Request.java#L114-L117 | train |
Asana/java-asana | src/main/java/com/asana/requests/Request.java | Request.header | public Request header(String key, String value) {
this.headers.put(key, value);
return this;
} | java | public Request header(String key, String value) {
this.headers.put(key, value);
return this;
} | [
"public",
"Request",
"header",
"(",
"String",
"key",
",",
"String",
"value",
")",
"{",
"this",
".",
"headers",
".",
"put",
"(",
"key",
",",
"value",
")",
";",
"return",
"this",
";",
"}"
] | Sets a header per-request
@param key Header key
@param value Header value
@return The request itself | [
"Sets",
"a",
"header",
"per",
"-",
"request"
] | abeea92fd5a71260a5d804db4da94e52fd7a15a7 | https://github.com/Asana/java-asana/blob/abeea92fd5a71260a5d804db4da94e52fd7a15a7/src/main/java/com/asana/requests/Request.java#L126-L129 | train |
Asana/java-asana | src/main/java/com/asana/resources/gen/AttachmentsBase.java | AttachmentsBase.findById | public ItemRequest<Attachment> findById(String attachment) {
String path = String.format("/attachments/%s", attachment);
return new ItemRequest<Attachment>(this, Attachment.class, path, "GET");
} | java | public ItemRequest<Attachment> findById(String attachment) {
String path = String.format("/attachments/%s", attachment);
return new ItemRequest<Attachment>(this, Attachment.class, path, "GET");
} | [
"public",
"ItemRequest",
"<",
"Attachment",
">",
"findById",
"(",
"String",
"attachment",
")",
"{",
"String",
"path",
"=",
"String",
".",
"format",
"(",
"\"/attachments/%s\"",
",",
"attachment",
")",
";",
"return",
"new",
"ItemRequest",
"<",
"Attachment",
">",... | Returns the full record for a single attachment.
@param attachment Globally unique identifier for the attachment.
@return Request object | [
"Returns",
"the",
"full",
"record",
"for",
"a",
"single",
"attachment",
"."
] | abeea92fd5a71260a5d804db4da94e52fd7a15a7 | https://github.com/Asana/java-asana/blob/abeea92fd5a71260a5d804db4da94e52fd7a15a7/src/main/java/com/asana/resources/gen/AttachmentsBase.java#L28-L32 | train |
Asana/java-asana | src/main/java/com/asana/resources/gen/AttachmentsBase.java | AttachmentsBase.findByTask | public CollectionRequest<Attachment> findByTask(String task) {
String path = String.format("/tasks/%s/attachments", task);
return new CollectionRequest<Attachment>(this, Attachment.class, path, "GET");
} | java | public CollectionRequest<Attachment> findByTask(String task) {
String path = String.format("/tasks/%s/attachments", task);
return new CollectionRequest<Attachment>(this, Attachment.class, path, "GET");
} | [
"public",
"CollectionRequest",
"<",
"Attachment",
">",
"findByTask",
"(",
"String",
"task",
")",
"{",
"String",
"path",
"=",
"String",
".",
"format",
"(",
"\"/tasks/%s/attachments\"",
",",
"task",
")",
";",
"return",
"new",
"CollectionRequest",
"<",
"Attachment"... | Returns the compact records for all attachments on the task.
@param task Globally unique identifier for the task.
@return Request object | [
"Returns",
"the",
"compact",
"records",
"for",
"all",
"attachments",
"on",
"the",
"task",
"."
] | abeea92fd5a71260a5d804db4da94e52fd7a15a7 | https://github.com/Asana/java-asana/blob/abeea92fd5a71260a5d804db4da94e52fd7a15a7/src/main/java/com/asana/resources/gen/AttachmentsBase.java#L40-L44 | train |
Asana/java-asana | src/main/java/com/asana/resources/gen/SectionsBase.java | SectionsBase.createInProject | public ItemRequest<Section> createInProject(String project) {
String path = String.format("/projects/%s/sections", project);
return new ItemRequest<Section>(this, Section.class, path, "POST");
} | java | public ItemRequest<Section> createInProject(String project) {
String path = String.format("/projects/%s/sections", project);
return new ItemRequest<Section>(this, Section.class, path, "POST");
} | [
"public",
"ItemRequest",
"<",
"Section",
">",
"createInProject",
"(",
"String",
"project",
")",
"{",
"String",
"path",
"=",
"String",
".",
"format",
"(",
"\"/projects/%s/sections\"",
",",
"project",
")",
";",
"return",
"new",
"ItemRequest",
"<",
"Section",
">"... | Creates a new section in a project.
Returns the full record of the newly created section.
@param project The project to create the section in
@return Request object | [
"Creates",
"a",
"new",
"section",
"in",
"a",
"project",
"."
] | abeea92fd5a71260a5d804db4da94e52fd7a15a7 | https://github.com/Asana/java-asana/blob/abeea92fd5a71260a5d804db4da94e52fd7a15a7/src/main/java/com/asana/resources/gen/SectionsBase.java#L30-L34 | train |
Asana/java-asana | src/main/java/com/asana/resources/gen/SectionsBase.java | SectionsBase.findByProject | public CollectionRequest<Section> findByProject(String project) {
String path = String.format("/projects/%s/sections", project);
return new CollectionRequest<Section>(this, Section.class, path, "GET");
} | java | public CollectionRequest<Section> findByProject(String project) {
String path = String.format("/projects/%s/sections", project);
return new CollectionRequest<Section>(this, Section.class, path, "GET");
} | [
"public",
"CollectionRequest",
"<",
"Section",
">",
"findByProject",
"(",
"String",
"project",
")",
"{",
"String",
"path",
"=",
"String",
".",
"format",
"(",
"\"/projects/%s/sections\"",
",",
"project",
")",
";",
"return",
"new",
"CollectionRequest",
"<",
"Secti... | Returns the compact records for all sections in the specified project.
@param project The project to get sections from.
@return Request object | [
"Returns",
"the",
"compact",
"records",
"for",
"all",
"sections",
"in",
"the",
"specified",
"project",
"."
] | abeea92fd5a71260a5d804db4da94e52fd7a15a7 | https://github.com/Asana/java-asana/blob/abeea92fd5a71260a5d804db4da94e52fd7a15a7/src/main/java/com/asana/resources/gen/SectionsBase.java#L42-L46 | train |
Asana/java-asana | src/main/java/com/asana/resources/gen/SectionsBase.java | SectionsBase.findById | public ItemRequest<Section> findById(String section) {
String path = String.format("/sections/%s", section);
return new ItemRequest<Section>(this, Section.class, path, "GET");
} | java | public ItemRequest<Section> findById(String section) {
String path = String.format("/sections/%s", section);
return new ItemRequest<Section>(this, Section.class, path, "GET");
} | [
"public",
"ItemRequest",
"<",
"Section",
">",
"findById",
"(",
"String",
"section",
")",
"{",
"String",
"path",
"=",
"String",
".",
"format",
"(",
"\"/sections/%s\"",
",",
"section",
")",
";",
"return",
"new",
"ItemRequest",
"<",
"Section",
">",
"(",
"this... | Returns the complete record for a single section.
@param section The section to get.
@return Request object | [
"Returns",
"the",
"complete",
"record",
"for",
"a",
"single",
"section",
"."
] | abeea92fd5a71260a5d804db4da94e52fd7a15a7 | https://github.com/Asana/java-asana/blob/abeea92fd5a71260a5d804db4da94e52fd7a15a7/src/main/java/com/asana/resources/gen/SectionsBase.java#L54-L58 | train |
Asana/java-asana | src/main/java/com/asana/resources/gen/SectionsBase.java | SectionsBase.delete | public ItemRequest<Section> delete(String section) {
String path = String.format("/sections/%s", section);
return new ItemRequest<Section>(this, Section.class, path, "DELETE");
} | java | public ItemRequest<Section> delete(String section) {
String path = String.format("/sections/%s", section);
return new ItemRequest<Section>(this, Section.class, path, "DELETE");
} | [
"public",
"ItemRequest",
"<",
"Section",
">",
"delete",
"(",
"String",
"section",
")",
"{",
"String",
"path",
"=",
"String",
".",
"format",
"(",
"\"/sections/%s\"",
",",
"section",
")",
";",
"return",
"new",
"ItemRequest",
"<",
"Section",
">",
"(",
"this",... | A specific, existing section can be deleted by making a DELETE request
on the URL for that section.
Note that sections must be empty to be deleted.
The last remaining section in a board view cannot be deleted.
Returns an empty data block.
@param section The section to delete.
@return Request object | [
"A",
"specific",
"existing",
"section",
"can",
"be",
"deleted",
"by",
"making",
"a",
"DELETE",
"request",
"on",
"the",
"URL",
"for",
"that",
"section",
"."
] | abeea92fd5a71260a5d804db4da94e52fd7a15a7 | https://github.com/Asana/java-asana/blob/abeea92fd5a71260a5d804db4da94e52fd7a15a7/src/main/java/com/asana/resources/gen/SectionsBase.java#L94-L98 | train |
Asana/java-asana | src/main/java/com/asana/resources/gen/SectionsBase.java | SectionsBase.insertInProject | public ItemRequest<Section> insertInProject(String project) {
String path = String.format("/projects/%s/sections/insert", project);
return new ItemRequest<Section>(this, Section.class, path, "POST");
} | java | public ItemRequest<Section> insertInProject(String project) {
String path = String.format("/projects/%s/sections/insert", project);
return new ItemRequest<Section>(this, Section.class, path, "POST");
} | [
"public",
"ItemRequest",
"<",
"Section",
">",
"insertInProject",
"(",
"String",
"project",
")",
"{",
"String",
"path",
"=",
"String",
".",
"format",
"(",
"\"/projects/%s/sections/insert\"",
",",
"project",
")",
";",
"return",
"new",
"ItemRequest",
"<",
"Section"... | Move sections relative to each other in a board view. One of
`before_section` or `after_section` is required.
Sections cannot be moved between projects.
At this point in time, moving sections is not supported in list views, only board views.
Returns an empty data block.
@param project The project in which to reord... | [
"Move",
"sections",
"relative",
"to",
"each",
"other",
"in",
"a",
"board",
"view",
".",
"One",
"of",
"before_section",
"or",
"after_section",
"is",
"required",
"."
] | abeea92fd5a71260a5d804db4da94e52fd7a15a7 | https://github.com/Asana/java-asana/blob/abeea92fd5a71260a5d804db4da94e52fd7a15a7/src/main/java/com/asana/resources/gen/SectionsBase.java#L113-L117 | train |
Asana/java-asana | src/main/java/com/asana/resources/gen/TeamsBase.java | TeamsBase.findById | public ItemRequest<Team> findById(String team) {
String path = String.format("/teams/%s", team);
return new ItemRequest<Team>(this, Team.class, path, "GET");
} | java | public ItemRequest<Team> findById(String team) {
String path = String.format("/teams/%s", team);
return new ItemRequest<Team>(this, Team.class, path, "GET");
} | [
"public",
"ItemRequest",
"<",
"Team",
">",
"findById",
"(",
"String",
"team",
")",
"{",
"String",
"path",
"=",
"String",
".",
"format",
"(",
"\"/teams/%s\"",
",",
"team",
")",
";",
"return",
"new",
"ItemRequest",
"<",
"Team",
">",
"(",
"this",
",",
"Te... | Returns the full record for a single team.
@param team Globally unique identifier for the team.
@return Request object | [
"Returns",
"the",
"full",
"record",
"for",
"a",
"single",
"team",
"."
] | abeea92fd5a71260a5d804db4da94e52fd7a15a7 | https://github.com/Asana/java-asana/blob/abeea92fd5a71260a5d804db4da94e52fd7a15a7/src/main/java/com/asana/resources/gen/TeamsBase.java#L27-L31 | train |
Asana/java-asana | src/main/java/com/asana/resources/gen/TeamsBase.java | TeamsBase.findByOrganization | public CollectionRequest<Team> findByOrganization(String organization) {
String path = String.format("/organizations/%s/teams", organization);
return new CollectionRequest<Team>(this, Team.class, path, "GET");
} | java | public CollectionRequest<Team> findByOrganization(String organization) {
String path = String.format("/organizations/%s/teams", organization);
return new CollectionRequest<Team>(this, Team.class, path, "GET");
} | [
"public",
"CollectionRequest",
"<",
"Team",
">",
"findByOrganization",
"(",
"String",
"organization",
")",
"{",
"String",
"path",
"=",
"String",
".",
"format",
"(",
"\"/organizations/%s/teams\"",
",",
"organization",
")",
";",
"return",
"new",
"CollectionRequest",
... | Returns the compact records for all teams in the organization visible to
the authorized user.
@param organization Globally unique identifier for the workspace or organization.
@return Request object | [
"Returns",
"the",
"compact",
"records",
"for",
"all",
"teams",
"in",
"the",
"organization",
"visible",
"to",
"the",
"authorized",
"user",
"."
] | abeea92fd5a71260a5d804db4da94e52fd7a15a7 | https://github.com/Asana/java-asana/blob/abeea92fd5a71260a5d804db4da94e52fd7a15a7/src/main/java/com/asana/resources/gen/TeamsBase.java#L40-L44 | train |
Asana/java-asana | src/main/java/com/asana/resources/gen/TeamsBase.java | TeamsBase.findByUser | public CollectionRequest<Team> findByUser(String user) {
String path = String.format("/users/%s/teams", user);
return new CollectionRequest<Team>(this, Team.class, path, "GET");
} | java | public CollectionRequest<Team> findByUser(String user) {
String path = String.format("/users/%s/teams", user);
return new CollectionRequest<Team>(this, Team.class, path, "GET");
} | [
"public",
"CollectionRequest",
"<",
"Team",
">",
"findByUser",
"(",
"String",
"user",
")",
"{",
"String",
"path",
"=",
"String",
".",
"format",
"(",
"\"/users/%s/teams\"",
",",
"user",
")",
";",
"return",
"new",
"CollectionRequest",
"<",
"Team",
">",
"(",
... | Returns the compact records for all teams to which user is assigned.
@param user An identifier for the user. Can be one of an email address,
the globally unique identifier for the user, or the keyword `me`
to indicate the current user making the request.
@return Request object | [
"Returns",
"the",
"compact",
"records",
"for",
"all",
"teams",
"to",
"which",
"user",
"is",
"assigned",
"."
] | abeea92fd5a71260a5d804db4da94e52fd7a15a7 | https://github.com/Asana/java-asana/blob/abeea92fd5a71260a5d804db4da94e52fd7a15a7/src/main/java/com/asana/resources/gen/TeamsBase.java#L54-L58 | train |
Asana/java-asana | src/main/java/com/asana/resources/gen/TeamsBase.java | TeamsBase.users | public CollectionRequest<Team> users(String team) {
String path = String.format("/teams/%s/users", team);
return new CollectionRequest<Team>(this, Team.class, path, "GET");
} | java | public CollectionRequest<Team> users(String team) {
String path = String.format("/teams/%s/users", team);
return new CollectionRequest<Team>(this, Team.class, path, "GET");
} | [
"public",
"CollectionRequest",
"<",
"Team",
">",
"users",
"(",
"String",
"team",
")",
"{",
"String",
"path",
"=",
"String",
".",
"format",
"(",
"\"/teams/%s/users\"",
",",
"team",
")",
";",
"return",
"new",
"CollectionRequest",
"<",
"Team",
">",
"(",
"this... | Returns the compact records for all users that are members of the team.
@param team Globally unique identifier for the team.
@return Request object | [
"Returns",
"the",
"compact",
"records",
"for",
"all",
"users",
"that",
"are",
"members",
"of",
"the",
"team",
"."
] | abeea92fd5a71260a5d804db4da94e52fd7a15a7 | https://github.com/Asana/java-asana/blob/abeea92fd5a71260a5d804db4da94e52fd7a15a7/src/main/java/com/asana/resources/gen/TeamsBase.java#L66-L70 | train |
Asana/java-asana | src/main/java/com/asana/resources/gen/TeamsBase.java | TeamsBase.addUser | public ItemRequest<Team> addUser(String team) {
String path = String.format("/teams/%s/addUser", team);
return new ItemRequest<Team>(this, Team.class, path, "POST");
} | java | public ItemRequest<Team> addUser(String team) {
String path = String.format("/teams/%s/addUser", team);
return new ItemRequest<Team>(this, Team.class, path, "POST");
} | [
"public",
"ItemRequest",
"<",
"Team",
">",
"addUser",
"(",
"String",
"team",
")",
"{",
"String",
"path",
"=",
"String",
".",
"format",
"(",
"\"/teams/%s/addUser\"",
",",
"team",
")",
";",
"return",
"new",
"ItemRequest",
"<",
"Team",
">",
"(",
"this",
","... | The user making this call must be a member of the team in order to add others.
The user to add must exist in the same organization as the team in order to be added.
The user to add can be referenced by their globally unique user ID or their email address.
Returns the full user record for the added user.
@param team G... | [
"The",
"user",
"making",
"this",
"call",
"must",
"be",
"a",
"member",
"of",
"the",
"team",
"in",
"order",
"to",
"add",
"others",
".",
"The",
"user",
"to",
"add",
"must",
"exist",
"in",
"the",
"same",
"organization",
"as",
"the",
"team",
"in",
"order",
... | abeea92fd5a71260a5d804db4da94e52fd7a15a7 | https://github.com/Asana/java-asana/blob/abeea92fd5a71260a5d804db4da94e52fd7a15a7/src/main/java/com/asana/resources/gen/TeamsBase.java#L81-L85 | train |
Asana/java-asana | src/main/java/com/asana/resources/gen/TeamsBase.java | TeamsBase.removeUser | public ItemRequest<Team> removeUser(String team) {
String path = String.format("/teams/%s/removeUser", team);
return new ItemRequest<Team>(this, Team.class, path, "POST");
} | java | public ItemRequest<Team> removeUser(String team) {
String path = String.format("/teams/%s/removeUser", team);
return new ItemRequest<Team>(this, Team.class, path, "POST");
} | [
"public",
"ItemRequest",
"<",
"Team",
">",
"removeUser",
"(",
"String",
"team",
")",
"{",
"String",
"path",
"=",
"String",
".",
"format",
"(",
"\"/teams/%s/removeUser\"",
",",
"team",
")",
";",
"return",
"new",
"ItemRequest",
"<",
"Team",
">",
"(",
"this",... | The user to remove can be referenced by their globally unique user ID or their email address.
Removes the user from the specified team. Returns an empty data record.
@param team Globally unique identifier for the team.
@return Request object | [
"The",
"user",
"to",
"remove",
"can",
"be",
"referenced",
"by",
"their",
"globally",
"unique",
"user",
"ID",
"or",
"their",
"email",
"address",
".",
"Removes",
"the",
"user",
"from",
"the",
"specified",
"team",
".",
"Returns",
"an",
"empty",
"data",
"recor... | abeea92fd5a71260a5d804db4da94e52fd7a15a7 | https://github.com/Asana/java-asana/blob/abeea92fd5a71260a5d804db4da94e52fd7a15a7/src/main/java/com/asana/resources/gen/TeamsBase.java#L94-L98 | train |
cdapio/netty-http | src/main/java/io/cdap/http/AbstractHttpHandler.java | AbstractHttpHandler.sendInternalRequest | protected InternalHttpResponse sendInternalRequest(HttpRequest request) {
InternalHttpResponder responder = new InternalHttpResponder();
httpResourceHandler.handle(request, responder);
return responder.getResponse();
} | java | protected InternalHttpResponse sendInternalRequest(HttpRequest request) {
InternalHttpResponder responder = new InternalHttpResponder();
httpResourceHandler.handle(request, responder);
return responder.getResponse();
} | [
"protected",
"InternalHttpResponse",
"sendInternalRequest",
"(",
"HttpRequest",
"request",
")",
"{",
"InternalHttpResponder",
"responder",
"=",
"new",
"InternalHttpResponder",
"(",
")",
";",
"httpResourceHandler",
".",
"handle",
"(",
"request",
",",
"responder",
")",
... | Send a request to another handler internal to the server, getting back the response body and response code.
@param request request to send to another handler.
@return {@link InternalHttpResponse} containing the response code and body. | [
"Send",
"a",
"request",
"to",
"another",
"handler",
"internal",
"to",
"the",
"server",
"getting",
"back",
"the",
"response",
"body",
"and",
"response",
"code",
"."
] | 02fdbb45bdd51d3dd58c0efbb2f27195d265cd0f | https://github.com/cdapio/netty-http/blob/02fdbb45bdd51d3dd58c0efbb2f27195d265cd0f/src/main/java/io/cdap/http/AbstractHttpHandler.java#L47-L51 | train |
cdapio/netty-http | src/main/java/io/cdap/http/SSLHandlerFactory.java | SSLHandlerFactory.create | public SslHandler create(ByteBufAllocator bufferAllocator) {
SSLEngine engine = sslContext.newEngine(bufferAllocator);
engine.setNeedClientAuth(needClientAuth);
engine.setUseClientMode(false);
return new SslHandler(engine);
} | java | public SslHandler create(ByteBufAllocator bufferAllocator) {
SSLEngine engine = sslContext.newEngine(bufferAllocator);
engine.setNeedClientAuth(needClientAuth);
engine.setUseClientMode(false);
return new SslHandler(engine);
} | [
"public",
"SslHandler",
"create",
"(",
"ByteBufAllocator",
"bufferAllocator",
")",
"{",
"SSLEngine",
"engine",
"=",
"sslContext",
".",
"newEngine",
"(",
"bufferAllocator",
")",
";",
"engine",
".",
"setNeedClientAuth",
"(",
"needClientAuth",
")",
";",
"engine",
"."... | Creates an SslHandler
@param bufferAllocator the buffer allocator
@return instance of {@code SslHandler} | [
"Creates",
"an",
"SslHandler"
] | 02fdbb45bdd51d3dd58c0efbb2f27195d265cd0f | https://github.com/cdapio/netty-http/blob/02fdbb45bdd51d3dd58c0efbb2f27195d265cd0f/src/main/java/io/cdap/http/SSLHandlerFactory.java#L86-L91 | train |
cdapio/netty-http | src/main/java/io/cdap/http/internal/HttpResourceHandler.java | HttpResourceHandler.getHttpMethods | private Set<HttpMethod> getHttpMethods(Method method) {
Set<HttpMethod> httpMethods = new HashSet<>();
if (method.isAnnotationPresent(GET.class)) {
httpMethods.add(HttpMethod.GET);
}
if (method.isAnnotationPresent(PUT.class)) {
httpMethods.add(HttpMethod.PUT);
}
if (method.isAnnotat... | java | private Set<HttpMethod> getHttpMethods(Method method) {
Set<HttpMethod> httpMethods = new HashSet<>();
if (method.isAnnotationPresent(GET.class)) {
httpMethods.add(HttpMethod.GET);
}
if (method.isAnnotationPresent(PUT.class)) {
httpMethods.add(HttpMethod.PUT);
}
if (method.isAnnotat... | [
"private",
"Set",
"<",
"HttpMethod",
">",
"getHttpMethods",
"(",
"Method",
"method",
")",
"{",
"Set",
"<",
"HttpMethod",
">",
"httpMethods",
"=",
"new",
"HashSet",
"<>",
"(",
")",
";",
"if",
"(",
"method",
".",
"isAnnotationPresent",
"(",
"GET",
".",
"cl... | Fetches the HttpMethod from annotations and returns String representation of HttpMethod.
Return emptyString if not present.
@param method Method handling the http request.
@return String representation of HttpMethod from annotations or emptyString as a default. | [
"Fetches",
"the",
"HttpMethod",
"from",
"annotations",
"and",
"returns",
"String",
"representation",
"of",
"HttpMethod",
".",
"Return",
"emptyString",
"if",
"not",
"present",
"."
] | 02fdbb45bdd51d3dd58c0efbb2f27195d265cd0f | https://github.com/cdapio/netty-http/blob/02fdbb45bdd51d3dd58c0efbb2f27195d265cd0f/src/main/java/io/cdap/http/internal/HttpResourceHandler.java#L137-L154 | train |
cdapio/netty-http | src/main/java/io/cdap/http/internal/HttpResourceHandler.java | HttpResourceHandler.handle | public void handle(HttpRequest request, HttpResponder responder) {
if (urlRewriter != null) {
try {
request.setUri(URI.create(request.uri()).normalize().toString());
if (!urlRewriter.rewrite(request, responder)) {
return;
}
} catch (Throwable t) {
responder.send... | java | public void handle(HttpRequest request, HttpResponder responder) {
if (urlRewriter != null) {
try {
request.setUri(URI.create(request.uri()).normalize().toString());
if (!urlRewriter.rewrite(request, responder)) {
return;
}
} catch (Throwable t) {
responder.send... | [
"public",
"void",
"handle",
"(",
"HttpRequest",
"request",
",",
"HttpResponder",
"responder",
")",
"{",
"if",
"(",
"urlRewriter",
"!=",
"null",
")",
"{",
"try",
"{",
"request",
".",
"setUri",
"(",
"URI",
".",
"create",
"(",
"request",
".",
"uri",
"(",
... | Call the appropriate handler for handling the httprequest. 404 if path is not found. 405 if path is found but
httpMethod does not match what's configured.
@param request instance of {@code HttpRequest}
@param responder instance of {@code HttpResponder} to handle the request. | [
"Call",
"the",
"appropriate",
"handler",
"for",
"handling",
"the",
"httprequest",
".",
"404",
"if",
"path",
"is",
"not",
"found",
".",
"405",
"if",
"path",
"is",
"found",
"but",
"httpMethod",
"does",
"not",
"match",
"what",
"s",
"configured",
"."
] | 02fdbb45bdd51d3dd58c0efbb2f27195d265cd0f | https://github.com/cdapio/netty-http/blob/02fdbb45bdd51d3dd58c0efbb2f27195d265cd0f/src/main/java/io/cdap/http/internal/HttpResourceHandler.java#L163-L227 | train |
cdapio/netty-http | src/main/java/io/cdap/http/internal/HttpResourceHandler.java | HttpResourceHandler.getMatchedDestination | private PatternPathRouterWithGroups.RoutableDestination<HttpResourceModel>
getMatchedDestination(List<PatternPathRouterWithGroups.RoutableDestination<HttpResourceModel>> routableDestinations,
HttpMethod targetHttpMethod, String requestUri) {
LOG.trace("Routable destinations for request {}... | java | private PatternPathRouterWithGroups.RoutableDestination<HttpResourceModel>
getMatchedDestination(List<PatternPathRouterWithGroups.RoutableDestination<HttpResourceModel>> routableDestinations,
HttpMethod targetHttpMethod, String requestUri) {
LOG.trace("Routable destinations for request {}... | [
"private",
"PatternPathRouterWithGroups",
".",
"RoutableDestination",
"<",
"HttpResourceModel",
">",
"getMatchedDestination",
"(",
"List",
"<",
"PatternPathRouterWithGroups",
".",
"RoutableDestination",
"<",
"HttpResourceModel",
">",
">",
"routableDestinations",
",",
"HttpMet... | Get HttpResourceModel which matches the HttpMethod of the request.
@param routableDestinations List of ResourceModels.
@param targetHttpMethod HttpMethod.
@param requestUri request URI.
@return RoutableDestination that matches httpMethod that needs to be handled. null if there are no matches. | [
"Get",
"HttpResourceModel",
"which",
"matches",
"the",
"HttpMethod",
"of",
"the",
"request",
"."
] | 02fdbb45bdd51d3dd58c0efbb2f27195d265cd0f | https://github.com/cdapio/netty-http/blob/02fdbb45bdd51d3dd58c0efbb2f27195d265cd0f/src/main/java/io/cdap/http/internal/HttpResourceHandler.java#L307-L341 | train |
cdapio/netty-http | src/main/java/io/cdap/http/internal/HttpResourceHandler.java | HttpResourceHandler.getWeightedMatchScore | private long getWeightedMatchScore(Iterable<String> requestUriParts, Iterable<String> destUriParts) {
// The score calculated below is a base 5 number
// The score will have one digit for one part of the URI
// This will allow for 27 parts in the path since log (Long.MAX_VALUE) to base 5 = 27.13
// We l... | java | private long getWeightedMatchScore(Iterable<String> requestUriParts, Iterable<String> destUriParts) {
// The score calculated below is a base 5 number
// The score will have one digit for one part of the URI
// This will allow for 27 parts in the path since log (Long.MAX_VALUE) to base 5 = 27.13
// We l... | [
"private",
"long",
"getWeightedMatchScore",
"(",
"Iterable",
"<",
"String",
">",
"requestUriParts",
",",
"Iterable",
"<",
"String",
">",
"destUriParts",
")",
"{",
"// The score calculated below is a base 5 number",
"// The score will have one digit for one part of the URI",
"//... | Generate a weighted score based on position for matches of URI parts.
The matches are weighted in descending order from left to right.
Exact match is weighted higher than group match, and group match is weighted higher than wildcard match.
@param requestUriParts the parts of request URI
@param destUriParts the parts o... | [
"Generate",
"a",
"weighted",
"score",
"based",
"on",
"position",
"for",
"matches",
"of",
"URI",
"parts",
".",
"The",
"matches",
"are",
"weighted",
"in",
"descending",
"order",
"from",
"left",
"to",
"right",
".",
"Exact",
"match",
"is",
"weighted",
"higher",
... | 02fdbb45bdd51d3dd58c0efbb2f27195d265cd0f | https://github.com/cdapio/netty-http/blob/02fdbb45bdd51d3dd58c0efbb2f27195d265cd0f/src/main/java/io/cdap/http/internal/HttpResourceHandler.java#L352-L372 | train |
cdapio/netty-http | src/main/java/io/cdap/http/internal/HttpResourceHandler.java | HttpResourceHandler.splitAndOmitEmpty | private static Iterable<String> splitAndOmitEmpty(final String str, final char splitChar) {
return new Iterable<String>() {
@Override
public Iterator<String> iterator() {
return new Iterator<String>() {
int startIdx = 0;
String next = null;
@Override
pub... | java | private static Iterable<String> splitAndOmitEmpty(final String str, final char splitChar) {
return new Iterable<String>() {
@Override
public Iterator<String> iterator() {
return new Iterator<String>() {
int startIdx = 0;
String next = null;
@Override
pub... | [
"private",
"static",
"Iterable",
"<",
"String",
">",
"splitAndOmitEmpty",
"(",
"final",
"String",
"str",
",",
"final",
"char",
"splitChar",
")",
"{",
"return",
"new",
"Iterable",
"<",
"String",
">",
"(",
")",
"{",
"@",
"Override",
"public",
"Iterator",
"<"... | Helper method to split a string by a given character, with empty parts omitted. | [
"Helper",
"method",
"to",
"split",
"a",
"string",
"by",
"a",
"given",
"character",
"with",
"empty",
"parts",
"omitted",
"."
] | 02fdbb45bdd51d3dd58c0efbb2f27195d265cd0f | https://github.com/cdapio/netty-http/blob/02fdbb45bdd51d3dd58c0efbb2f27195d265cd0f/src/main/java/io/cdap/http/internal/HttpResourceHandler.java#L403-L454 | train |
cdapio/netty-http | src/main/java/io/cdap/http/internal/ParamConvertUtils.java | ParamConvertUtils.createPrimitiveTypeConverter | @Nullable
private static Converter<List<String>, Object> createPrimitiveTypeConverter(final Class<?> resultClass) {
Object defaultValue = defaultValue(resultClass);
if (defaultValue == null) {
// For primitive type, the default value shouldn't be null
return null;
}
return new BasicConve... | java | @Nullable
private static Converter<List<String>, Object> createPrimitiveTypeConverter(final Class<?> resultClass) {
Object defaultValue = defaultValue(resultClass);
if (defaultValue == null) {
// For primitive type, the default value shouldn't be null
return null;
}
return new BasicConve... | [
"@",
"Nullable",
"private",
"static",
"Converter",
"<",
"List",
"<",
"String",
">",
",",
"Object",
">",
"createPrimitiveTypeConverter",
"(",
"final",
"Class",
"<",
"?",
">",
"resultClass",
")",
"{",
"Object",
"defaultValue",
"=",
"defaultValue",
"(",
"resultCl... | Creates a converter function that converts value into primitive type.
@return A converter function or {@code null} if the given type is not primitive type or boxed type | [
"Creates",
"a",
"converter",
"function",
"that",
"converts",
"value",
"into",
"primitive",
"type",
"."
] | 02fdbb45bdd51d3dd58c0efbb2f27195d265cd0f | https://github.com/cdapio/netty-http/blob/02fdbb45bdd51d3dd58c0efbb2f27195d265cd0f/src/main/java/io/cdap/http/internal/ParamConvertUtils.java#L158-L173 | train |
cdapio/netty-http | src/main/java/io/cdap/http/internal/ParamConvertUtils.java | ParamConvertUtils.createStringConstructorConverter | private static Converter<List<String>, Object> createStringConstructorConverter(Class<?> resultClass) {
try {
final Constructor<?> constructor = resultClass.getConstructor(String.class);
return new BasicConverter(defaultValue(resultClass)) {
@Override
protected Object convert(String valu... | java | private static Converter<List<String>, Object> createStringConstructorConverter(Class<?> resultClass) {
try {
final Constructor<?> constructor = resultClass.getConstructor(String.class);
return new BasicConverter(defaultValue(resultClass)) {
@Override
protected Object convert(String valu... | [
"private",
"static",
"Converter",
"<",
"List",
"<",
"String",
">",
",",
"Object",
">",
"createStringConstructorConverter",
"(",
"Class",
"<",
"?",
">",
"resultClass",
")",
"{",
"try",
"{",
"final",
"Constructor",
"<",
"?",
">",
"constructor",
"=",
"resultCla... | Creates a converter function that converts value using a constructor that accepts a single String argument.
@return A converter function or {@code null} if the given type doesn't have a public constructor that accepts
a single String argument. | [
"Creates",
"a",
"converter",
"function",
"that",
"converts",
"value",
"using",
"a",
"constructor",
"that",
"accepts",
"a",
"single",
"String",
"argument",
"."
] | 02fdbb45bdd51d3dd58c0efbb2f27195d265cd0f | https://github.com/cdapio/netty-http/blob/02fdbb45bdd51d3dd58c0efbb2f27195d265cd0f/src/main/java/io/cdap/http/internal/ParamConvertUtils.java#L182-L194 | train |
cdapio/netty-http | src/main/java/io/cdap/http/internal/ParamConvertUtils.java | ParamConvertUtils.valueOf | @Nullable
private static Object valueOf(String value, Class<?> cls) {
if (cls == Boolean.TYPE) {
return Boolean.valueOf(value);
}
if (cls == Character.TYPE) {
return value.length() >= 1 ? value.charAt(0) : defaultValue(char.class);
}
if (cls == Byte.TYPE) {
return Byte.valueOf(va... | java | @Nullable
private static Object valueOf(String value, Class<?> cls) {
if (cls == Boolean.TYPE) {
return Boolean.valueOf(value);
}
if (cls == Character.TYPE) {
return value.length() >= 1 ? value.charAt(0) : defaultValue(char.class);
}
if (cls == Byte.TYPE) {
return Byte.valueOf(va... | [
"@",
"Nullable",
"private",
"static",
"Object",
"valueOf",
"(",
"String",
"value",
",",
"Class",
"<",
"?",
">",
"cls",
")",
"{",
"if",
"(",
"cls",
"==",
"Boolean",
".",
"TYPE",
")",
"{",
"return",
"Boolean",
".",
"valueOf",
"(",
"value",
")",
";",
... | Returns the value of the primitive type from the given string value.
@param value the value to parse
@param cls the primitive type class
@return the boxed type value or {@code null} if the given class is not a primitive type | [
"Returns",
"the",
"value",
"of",
"the",
"primitive",
"type",
"from",
"the",
"given",
"string",
"value",
"."
] | 02fdbb45bdd51d3dd58c0efbb2f27195d265cd0f | https://github.com/cdapio/netty-http/blob/02fdbb45bdd51d3dd58c0efbb2f27195d265cd0f/src/main/java/io/cdap/http/internal/ParamConvertUtils.java#L314-L341 | train |
cdapio/netty-http | src/main/java/io/cdap/http/internal/ParamConvertUtils.java | ParamConvertUtils.getRawClass | private static Class<?> getRawClass(Type type) {
if (type instanceof Class) {
return (Class<?>) type;
}
if (type instanceof ParameterizedType) {
return getRawClass(((ParameterizedType) type).getRawType());
}
// For TypeVariable and WildcardType, returns the first upper bound.
if (typ... | java | private static Class<?> getRawClass(Type type) {
if (type instanceof Class) {
return (Class<?>) type;
}
if (type instanceof ParameterizedType) {
return getRawClass(((ParameterizedType) type).getRawType());
}
// For TypeVariable and WildcardType, returns the first upper bound.
if (typ... | [
"private",
"static",
"Class",
"<",
"?",
">",
"getRawClass",
"(",
"Type",
"type",
")",
"{",
"if",
"(",
"type",
"instanceof",
"Class",
")",
"{",
"return",
"(",
"Class",
"<",
"?",
">",
")",
"type",
";",
"}",
"if",
"(",
"type",
"instanceof",
"Parameteriz... | Returns the raw class of the given type. | [
"Returns",
"the",
"raw",
"class",
"of",
"the",
"given",
"type",
"."
] | 02fdbb45bdd51d3dd58c0efbb2f27195d265cd0f | https://github.com/cdapio/netty-http/blob/02fdbb45bdd51d3dd58c0efbb2f27195d265cd0f/src/main/java/io/cdap/http/internal/ParamConvertUtils.java#L346-L366 | train |
cdapio/netty-http | src/main/java/io/cdap/http/internal/HttpMethodInfo.java | HttpMethodInfo.invoke | void invoke(HttpRequest request) throws Exception {
bodyConsumer = null;
Object invokeResult;
try {
args[0] = this.request = request;
invokeResult = method.invoke(handler, args);
} catch (InvocationTargetException e) {
exceptionHandler.handle(e.getTargetException(), request, responder)... | java | void invoke(HttpRequest request) throws Exception {
bodyConsumer = null;
Object invokeResult;
try {
args[0] = this.request = request;
invokeResult = method.invoke(handler, args);
} catch (InvocationTargetException e) {
exceptionHandler.handle(e.getTargetException(), request, responder)... | [
"void",
"invoke",
"(",
"HttpRequest",
"request",
")",
"throws",
"Exception",
"{",
"bodyConsumer",
"=",
"null",
";",
"Object",
"invokeResult",
";",
"try",
"{",
"args",
"[",
"0",
"]",
"=",
"this",
".",
"request",
"=",
"request",
";",
"invokeResult",
"=",
"... | Calls the httpHandler method. | [
"Calls",
"the",
"httpHandler",
"method",
"."
] | 02fdbb45bdd51d3dd58c0efbb2f27195d265cd0f | https://github.com/cdapio/netty-http/blob/02fdbb45bdd51d3dd58c0efbb2f27195d265cd0f/src/main/java/io/cdap/http/internal/HttpMethodInfo.java#L77-L95 | train |
cdapio/netty-http | src/main/java/io/cdap/http/internal/HttpMethodInfo.java | HttpMethodInfo.sendError | void sendError(HttpResponseStatus status, Throwable ex) {
String msg;
if (ex instanceof InvocationTargetException) {
msg = String.format("Exception Encountered while processing request : %s", ex.getCause().getMessage());
} else {
msg = String.format("Exception Encountered while processing reque... | java | void sendError(HttpResponseStatus status, Throwable ex) {
String msg;
if (ex instanceof InvocationTargetException) {
msg = String.format("Exception Encountered while processing request : %s", ex.getCause().getMessage());
} else {
msg = String.format("Exception Encountered while processing reque... | [
"void",
"sendError",
"(",
"HttpResponseStatus",
"status",
",",
"Throwable",
"ex",
")",
"{",
"String",
"msg",
";",
"if",
"(",
"ex",
"instanceof",
"InvocationTargetException",
")",
"{",
"msg",
"=",
"String",
".",
"format",
"(",
"\"Exception Encountered while process... | Sends the error to responder. | [
"Sends",
"the",
"error",
"to",
"responder",
"."
] | 02fdbb45bdd51d3dd58c0efbb2f27195d265cd0f | https://github.com/cdapio/netty-http/blob/02fdbb45bdd51d3dd58c0efbb2f27195d265cd0f/src/main/java/io/cdap/http/internal/HttpMethodInfo.java#L170-L184 | train |
cdapio/netty-http | src/main/java/io/cdap/http/internal/PatternPathRouterWithGroups.java | PatternPathRouterWithGroups.add | public void add(final String source, final T destination) {
// replace multiple slashes with a single slash.
String path = source.replaceAll("/+", "/");
path = (path.endsWith("/") && path.length() > 1)
? path.substring(0, path.length() - 1) : path;
String[] parts = path.split("/", maxPathParts... | java | public void add(final String source, final T destination) {
// replace multiple slashes with a single slash.
String path = source.replaceAll("/+", "/");
path = (path.endsWith("/") && path.length() > 1)
? path.substring(0, path.length() - 1) : path;
String[] parts = path.split("/", maxPathParts... | [
"public",
"void",
"add",
"(",
"final",
"String",
"source",
",",
"final",
"T",
"destination",
")",
"{",
"// replace multiple slashes with a single slash.",
"String",
"path",
"=",
"source",
".",
"replaceAll",
"(",
"\"/+\"",
",",
"\"/\"",
")",
";",
"path",
"=",
"... | Add a source and destination.
@param source Source path to be routed. Routed path can have named wild-card pattern with braces "{}".
@param destination Destination of the path. | [
"Add",
"a",
"source",
"and",
"destination",
"."
] | 02fdbb45bdd51d3dd58c0efbb2f27195d265cd0f | https://github.com/cdapio/netty-http/blob/02fdbb45bdd51d3dd58c0efbb2f27195d265cd0f/src/main/java/io/cdap/http/internal/PatternPathRouterWithGroups.java#L62-L97 | train |
cdapio/netty-http | src/main/java/io/cdap/http/internal/PatternPathRouterWithGroups.java | PatternPathRouterWithGroups.getDestinations | public List<RoutableDestination<T>> getDestinations(String path) {
String cleanPath = (path.endsWith("/") && path.length() > 1)
? path.substring(0, path.length() - 1) : path;
List<RoutableDestination<T>> result = new ArrayList<>();
for (ImmutablePair<Pattern, RouteDestinationWithGroups> patternRout... | java | public List<RoutableDestination<T>> getDestinations(String path) {
String cleanPath = (path.endsWith("/") && path.length() > 1)
? path.substring(0, path.length() - 1) : path;
List<RoutableDestination<T>> result = new ArrayList<>();
for (ImmutablePair<Pattern, RouteDestinationWithGroups> patternRout... | [
"public",
"List",
"<",
"RoutableDestination",
"<",
"T",
">",
">",
"getDestinations",
"(",
"String",
"path",
")",
"{",
"String",
"cleanPath",
"=",
"(",
"path",
".",
"endsWith",
"(",
"\"/\"",
")",
"&&",
"path",
".",
"length",
"(",
")",
">",
"1",
")",
"... | Get a list of destinations and the values matching templated parameter for the given path.
Returns an empty list when there are no destinations that are matched.
@param path path to be routed.
@return List of Destinations matching the given route. | [
"Get",
"a",
"list",
"of",
"destinations",
"and",
"the",
"values",
"matching",
"templated",
"parameter",
"for",
"the",
"given",
"path",
".",
"Returns",
"an",
"empty",
"list",
"when",
"there",
"are",
"no",
"destinations",
"that",
"are",
"matched",
"."
] | 02fdbb45bdd51d3dd58c0efbb2f27195d265cd0f | https://github.com/cdapio/netty-http/blob/02fdbb45bdd51d3dd58c0efbb2f27195d265cd0f/src/main/java/io/cdap/http/internal/PatternPathRouterWithGroups.java#L106-L127 | train |
cdapio/netty-http | src/main/java/io/cdap/http/NettyHttpService.java | NettyHttpService.start | public synchronized void start() throws Exception {
if (state == State.RUNNING) {
LOG.debug("Ignore start() call on HTTP service {} since it has already been started.", serviceName);
return;
}
if (state != State.NOT_STARTED) {
if (state == State.STOPPED) {
throw new IllegalStateExc... | java | public synchronized void start() throws Exception {
if (state == State.RUNNING) {
LOG.debug("Ignore start() call on HTTP service {} since it has already been started.", serviceName);
return;
}
if (state != State.NOT_STARTED) {
if (state == State.STOPPED) {
throw new IllegalStateExc... | [
"public",
"synchronized",
"void",
"start",
"(",
")",
"throws",
"Exception",
"{",
"if",
"(",
"state",
"==",
"State",
".",
"RUNNING",
")",
"{",
"LOG",
".",
"debug",
"(",
"\"Ignore start() call on HTTP service {} since it has already been started.\"",
",",
"serviceName",... | Starts the HTTP service.
@throws Exception if the service failed to started | [
"Starts",
"the",
"HTTP",
"service",
"."
] | 02fdbb45bdd51d3dd58c0efbb2f27195d265cd0f | https://github.com/cdapio/netty-http/blob/02fdbb45bdd51d3dd58c0efbb2f27195d265cd0f/src/main/java/io/cdap/http/NettyHttpService.java#L158-L201 | train |
cdapio/netty-http | src/main/java/io/cdap/http/NettyHttpService.java | NettyHttpService.stop | public synchronized void stop(long quietPeriod, long timeout, TimeUnit unit) throws Exception {
if (state == State.STOPPED) {
LOG.debug("Ignore stop() call on HTTP service {} since it has already been stopped.", serviceName);
return;
}
LOG.info("Stopping HTTP Service {}", serviceName);
try... | java | public synchronized void stop(long quietPeriod, long timeout, TimeUnit unit) throws Exception {
if (state == State.STOPPED) {
LOG.debug("Ignore stop() call on HTTP service {} since it has already been stopped.", serviceName);
return;
}
LOG.info("Stopping HTTP Service {}", serviceName);
try... | [
"public",
"synchronized",
"void",
"stop",
"(",
"long",
"quietPeriod",
",",
"long",
"timeout",
",",
"TimeUnit",
"unit",
")",
"throws",
"Exception",
"{",
"if",
"(",
"state",
"==",
"State",
".",
"STOPPED",
")",
"{",
"LOG",
".",
"debug",
"(",
"\"Ignore stop() ... | Stops the HTTP service gracefully and release all resources.
@param quietPeriod the quiet period as described in the documentation of {@link EventExecutorGroup}
@param timeout the maximum amount of time to wait until the executor is
{@linkplain EventExecutorGroup#shutdown()}
regardless if a task was submitted duri... | [
"Stops",
"the",
"HTTP",
"service",
"gracefully",
"and",
"release",
"all",
"resources",
"."
] | 02fdbb45bdd51d3dd58c0efbb2f27195d265cd0f | https://github.com/cdapio/netty-http/blob/02fdbb45bdd51d3dd58c0efbb2f27195d265cd0f/src/main/java/io/cdap/http/NettyHttpService.java#L237-L262 | train |
cdapio/netty-http | src/main/java/io/cdap/http/NettyHttpService.java | NettyHttpService.createBootstrap | private ServerBootstrap createBootstrap(final ChannelGroup channelGroup) throws Exception {
EventLoopGroup bossGroup = new NioEventLoopGroup(bossThreadPoolSize,
createDaemonThreadFactory(serviceName + "-boss-thread-%d"));
EventLoopGroup workerGroup = new NioE... | java | private ServerBootstrap createBootstrap(final ChannelGroup channelGroup) throws Exception {
EventLoopGroup bossGroup = new NioEventLoopGroup(bossThreadPoolSize,
createDaemonThreadFactory(serviceName + "-boss-thread-%d"));
EventLoopGroup workerGroup = new NioE... | [
"private",
"ServerBootstrap",
"createBootstrap",
"(",
"final",
"ChannelGroup",
"channelGroup",
")",
"throws",
"Exception",
"{",
"EventLoopGroup",
"bossGroup",
"=",
"new",
"NioEventLoopGroup",
"(",
"bossThreadPoolSize",
",",
"createDaemonThreadFactory",
"(",
"serviceName",
... | Creates the server bootstrap. | [
"Creates",
"the",
"server",
"bootstrap",
"."
] | 02fdbb45bdd51d3dd58c0efbb2f27195d265cd0f | https://github.com/cdapio/netty-http/blob/02fdbb45bdd51d3dd58c0efbb2f27195d265cd0f/src/main/java/io/cdap/http/NettyHttpService.java#L322-L366 | train |
cdapio/netty-http | src/main/java/io/cdap/http/internal/RequestRouter.java | RequestRouter.channelRead | @Override
public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception {
try {
if (exceptionRaised.get()) {
return;
}
if (!(msg instanceof HttpRequest)) {
// If there is no methodInfo, it means the request was already rejected.
// What we received here... | java | @Override
public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception {
try {
if (exceptionRaised.get()) {
return;
}
if (!(msg instanceof HttpRequest)) {
// If there is no methodInfo, it means the request was already rejected.
// What we received here... | [
"@",
"Override",
"public",
"void",
"channelRead",
"(",
"ChannelHandlerContext",
"ctx",
",",
"Object",
"msg",
")",
"throws",
"Exception",
"{",
"try",
"{",
"if",
"(",
"exceptionRaised",
".",
"get",
"(",
")",
")",
"{",
"return",
";",
"}",
"if",
"(",
"!",
... | If the HttpRequest is valid and handled it will be sent upstream, if it cannot be invoked
the response will be written back immediately. | [
"If",
"the",
"HttpRequest",
"is",
"valid",
"and",
"handled",
"it",
"will",
"be",
"sent",
"upstream",
"if",
"it",
"cannot",
"be",
"invoked",
"the",
"response",
"will",
"be",
"written",
"back",
"immediately",
"."
] | 02fdbb45bdd51d3dd58c0efbb2f27195d265cd0f | https://github.com/cdapio/netty-http/blob/02fdbb45bdd51d3dd58c0efbb2f27195d265cd0f/src/main/java/io/cdap/http/internal/RequestRouter.java#L67-L108 | train |
cdapio/netty-http | src/main/java/io/cdap/http/internal/HttpResourceModel.java | HttpResourceModel.handle | @SuppressWarnings("unchecked")
public HttpMethodInfo handle(HttpRequest request,
HttpResponder responder, Map<String, String> groupValues) throws Exception {
//TODO: Refactor group values.
try {
if (httpMethods.contains(request.method())) {
//Setup args for reflect... | java | @SuppressWarnings("unchecked")
public HttpMethodInfo handle(HttpRequest request,
HttpResponder responder, Map<String, String> groupValues) throws Exception {
//TODO: Refactor group values.
try {
if (httpMethods.contains(request.method())) {
//Setup args for reflect... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"HttpMethodInfo",
"handle",
"(",
"HttpRequest",
"request",
",",
"HttpResponder",
"responder",
",",
"Map",
"<",
"String",
",",
"String",
">",
"groupValues",
")",
"throws",
"Exception",
"{",
"//TODO: Refa... | Handle http Request.
@param request HttpRequest to be handled.
@param responder HttpResponder to write the response.
@param groupValues Values needed for the invocation. | [
"Handle",
"http",
"Request",
"."
] | 02fdbb45bdd51d3dd58c0efbb2f27195d265cd0f | https://github.com/cdapio/netty-http/blob/02fdbb45bdd51d3dd58c0efbb2f27195d265cd0f/src/main/java/io/cdap/http/internal/HttpResourceModel.java#L113-L147 | train |
cdapio/netty-http | src/main/java/io/cdap/http/internal/HttpResourceModel.java | HttpResourceModel.createParametersInfos | private List<Map<Class<? extends Annotation>, ParameterInfo<?>>> createParametersInfos(Method method) {
if (method.getParameterTypes().length <= 2) {
return Collections.emptyList();
}
List<Map<Class<? extends Annotation>, ParameterInfo<?>>> result = new ArrayList<>();
Type[] parameterTypes = meth... | java | private List<Map<Class<? extends Annotation>, ParameterInfo<?>>> createParametersInfos(Method method) {
if (method.getParameterTypes().length <= 2) {
return Collections.emptyList();
}
List<Map<Class<? extends Annotation>, ParameterInfo<?>>> result = new ArrayList<>();
Type[] parameterTypes = meth... | [
"private",
"List",
"<",
"Map",
"<",
"Class",
"<",
"?",
"extends",
"Annotation",
">",
",",
"ParameterInfo",
"<",
"?",
">",
">",
">",
"createParametersInfos",
"(",
"Method",
"method",
")",
"{",
"if",
"(",
"method",
".",
"getParameterTypes",
"(",
")",
".",
... | Gathers all parameters' annotations for the given method, starting from the third parameter. | [
"Gathers",
"all",
"parameters",
"annotations",
"for",
"the",
"given",
"method",
"starting",
"from",
"the",
"third",
"parameter",
"."
] | 02fdbb45bdd51d3dd58c0efbb2f27195d265cd0f | https://github.com/cdapio/netty-http/blob/02fdbb45bdd51d3dd58c0efbb2f27195d265cd0f/src/main/java/io/cdap/http/internal/HttpResourceModel.java#L209-L259 | train |
Azure/autorest-clientruntime-for-java | client-runtime/src/main/java/com/microsoft/rest/ServiceFuture.java | ServiceFuture.fromResponse | public static <T> ServiceFuture<T> fromResponse(final Observable<ServiceResponse<T>> observable) {
final ServiceFuture<T> serviceFuture = new ServiceFuture<>();
serviceFuture.subscription = observable
.last()
.subscribe(new Action1<ServiceResponse<T>>() {
@Overrid... | java | public static <T> ServiceFuture<T> fromResponse(final Observable<ServiceResponse<T>> observable) {
final ServiceFuture<T> serviceFuture = new ServiceFuture<>();
serviceFuture.subscription = observable
.last()
.subscribe(new Action1<ServiceResponse<T>>() {
@Overrid... | [
"public",
"static",
"<",
"T",
">",
"ServiceFuture",
"<",
"T",
">",
"fromResponse",
"(",
"final",
"Observable",
"<",
"ServiceResponse",
"<",
"T",
">",
">",
"observable",
")",
"{",
"final",
"ServiceFuture",
"<",
"T",
">",
"serviceFuture",
"=",
"new",
"Servic... | Creates a ServiceCall from an observable object.
@param observable the observable to create from
@param <T> the type of the response
@return the created ServiceCall | [
"Creates",
"a",
"ServiceCall",
"from",
"an",
"observable",
"object",
"."
] | 04621e07dbb0456dd5459dd641f06a9fd4f3abad | https://github.com/Azure/autorest-clientruntime-for-java/blob/04621e07dbb0456dd5459dd641f06a9fd4f3abad/client-runtime/src/main/java/com/microsoft/rest/ServiceFuture.java#L39-L55 | train |
Azure/autorest-clientruntime-for-java | client-runtime/src/main/java/com/microsoft/rest/ServiceFuture.java | ServiceFuture.fromResponse | public static <T> ServiceFuture<T> fromResponse(final Observable<ServiceResponse<T>> observable, final ServiceCallback<T> callback) {
final ServiceFuture<T> serviceFuture = new ServiceFuture<>();
serviceFuture.subscription = observable
.last()
.subscribe(new Action1<Servi... | java | public static <T> ServiceFuture<T> fromResponse(final Observable<ServiceResponse<T>> observable, final ServiceCallback<T> callback) {
final ServiceFuture<T> serviceFuture = new ServiceFuture<>();
serviceFuture.subscription = observable
.last()
.subscribe(new Action1<Servi... | [
"public",
"static",
"<",
"T",
">",
"ServiceFuture",
"<",
"T",
">",
"fromResponse",
"(",
"final",
"Observable",
"<",
"ServiceResponse",
"<",
"T",
">",
">",
"observable",
",",
"final",
"ServiceCallback",
"<",
"T",
">",
"callback",
")",
"{",
"final",
"Service... | Creates a ServiceCall from an observable object and a callback.
@param observable the observable to create from
@param callback the callback to call when events happen
@param <T> the type of the response
@return the created ServiceCall | [
"Creates",
"a",
"ServiceCall",
"from",
"an",
"observable",
"object",
"and",
"a",
"callback",
"."
] | 04621e07dbb0456dd5459dd641f06a9fd4f3abad | https://github.com/Azure/autorest-clientruntime-for-java/blob/04621e07dbb0456dd5459dd641f06a9fd4f3abad/client-runtime/src/main/java/com/microsoft/rest/ServiceFuture.java#L65-L87 | train |
Azure/autorest-clientruntime-for-java | client-runtime/src/main/java/com/microsoft/rest/ServiceFuture.java | ServiceFuture.fromBody | public static ServiceFuture<Void> fromBody(final Completable completable, final ServiceCallback<Void> callback) {
final ServiceFuture<Void> serviceFuture = new ServiceFuture<>();
completable.subscribe(new Action0() {
Void value = null;
@Override
public void call() {
... | java | public static ServiceFuture<Void> fromBody(final Completable completable, final ServiceCallback<Void> callback) {
final ServiceFuture<Void> serviceFuture = new ServiceFuture<>();
completable.subscribe(new Action0() {
Void value = null;
@Override
public void call() {
... | [
"public",
"static",
"ServiceFuture",
"<",
"Void",
">",
"fromBody",
"(",
"final",
"Completable",
"completable",
",",
"final",
"ServiceCallback",
"<",
"Void",
">",
"callback",
")",
"{",
"final",
"ServiceFuture",
"<",
"Void",
">",
"serviceFuture",
"=",
"new",
"Se... | Creates a ServiceFuture from an Completable object and a callback.
@param completable the completable to create from
@param callback the callback to call when event happen
@return the created ServiceFuture | [
"Creates",
"a",
"ServiceFuture",
"from",
"an",
"Completable",
"object",
"and",
"a",
"callback",
"."
] | 04621e07dbb0456dd5459dd641f06a9fd4f3abad | https://github.com/Azure/autorest-clientruntime-for-java/blob/04621e07dbb0456dd5459dd641f06a9fd4f3abad/client-runtime/src/main/java/com/microsoft/rest/ServiceFuture.java#L128-L149 | train |
Azure/autorest-clientruntime-for-java | azure-arm-client-runtime/src/main/java/com/microsoft/azure/arm/resources/collection/implementation/ExternalChildResourcesCachedImpl.java | ExternalChildResourcesCachedImpl.cacheCollection | protected void cacheCollection() {
this.clear();
for (FluentModelTImpl childResource : this.listChildResources()) {
this.childCollection.put(childResource.childResourceKey(), childResource);
}
} | java | protected void cacheCollection() {
this.clear();
for (FluentModelTImpl childResource : this.listChildResources()) {
this.childCollection.put(childResource.childResourceKey(), childResource);
}
} | [
"protected",
"void",
"cacheCollection",
"(",
")",
"{",
"this",
".",
"clear",
"(",
")",
";",
"for",
"(",
"FluentModelTImpl",
"childResource",
":",
"this",
".",
"listChildResources",
"(",
")",
")",
"{",
"this",
".",
"childCollection",
".",
"put",
"(",
"child... | Initializes the external child resource collection. | [
"Initializes",
"the",
"external",
"child",
"resource",
"collection",
"."
] | 04621e07dbb0456dd5459dd641f06a9fd4f3abad | https://github.com/Azure/autorest-clientruntime-for-java/blob/04621e07dbb0456dd5459dd641f06a9fd4f3abad/azure-arm-client-runtime/src/main/java/com/microsoft/azure/arm/resources/collection/implementation/ExternalChildResourcesCachedImpl.java#L178-L183 | train |
Azure/autorest-clientruntime-for-java | azure-arm-client-runtime/src/main/java/com/microsoft/azure/arm/dag/DAGraph.java | DAGraph.addDependencyGraph | public void addDependencyGraph(DAGraph<DataT, NodeT> dependencyGraph) {
this.rootNode.addDependency(dependencyGraph.rootNode.key());
Map<String, NodeT> sourceNodeTable = dependencyGraph.nodeTable;
Map<String, NodeT> targetNodeTable = this.nodeTable;
this.merge(sourceNodeTable, targetNode... | java | public void addDependencyGraph(DAGraph<DataT, NodeT> dependencyGraph) {
this.rootNode.addDependency(dependencyGraph.rootNode.key());
Map<String, NodeT> sourceNodeTable = dependencyGraph.nodeTable;
Map<String, NodeT> targetNodeTable = this.nodeTable;
this.merge(sourceNodeTable, targetNode... | [
"public",
"void",
"addDependencyGraph",
"(",
"DAGraph",
"<",
"DataT",
",",
"NodeT",
">",
"dependencyGraph",
")",
"{",
"this",
".",
"rootNode",
".",
"addDependency",
"(",
"dependencyGraph",
".",
"rootNode",
".",
"key",
"(",
")",
")",
";",
"Map",
"<",
"Strin... | Mark root of this DAG depends on given DAG's root.
@param dependencyGraph the dependency DAG | [
"Mark",
"root",
"of",
"this",
"DAG",
"depends",
"on",
"given",
"DAG",
"s",
"root",
"."
] | 04621e07dbb0456dd5459dd641f06a9fd4f3abad | https://github.com/Azure/autorest-clientruntime-for-java/blob/04621e07dbb0456dd5459dd641f06a9fd4f3abad/azure-arm-client-runtime/src/main/java/com/microsoft/azure/arm/dag/DAGraph.java#L101-L110 | train |
Azure/autorest-clientruntime-for-java | azure-arm-client-runtime/src/main/java/com/microsoft/azure/arm/dag/DAGraph.java | DAGraph.prepareForEnumeration | public void prepareForEnumeration() {
if (isPreparer()) {
for (NodeT node : nodeTable.values()) {
// Prepare each node for traversal
node.initialize();
if (!this.isRootNode(node)) {
// Mark other sub-DAGs as non-preparer
... | java | public void prepareForEnumeration() {
if (isPreparer()) {
for (NodeT node : nodeTable.values()) {
// Prepare each node for traversal
node.initialize();
if (!this.isRootNode(node)) {
// Mark other sub-DAGs as non-preparer
... | [
"public",
"void",
"prepareForEnumeration",
"(",
")",
"{",
"if",
"(",
"isPreparer",
"(",
")",
")",
"{",
"for",
"(",
"NodeT",
"node",
":",
"nodeTable",
".",
"values",
"(",
")",
")",
"{",
"// Prepare each node for traversal",
"node",
".",
"initialize",
"(",
"... | Prepares this DAG for node enumeration using getNext method, each call to getNext returns next node
in the DAG with no dependencies. | [
"Prepares",
"this",
"DAG",
"for",
"node",
"enumeration",
"using",
"getNext",
"method",
"each",
"call",
"to",
"getNext",
"returns",
"next",
"node",
"in",
"the",
"DAG",
"with",
"no",
"dependencies",
"."
] | 04621e07dbb0456dd5459dd641f06a9fd4f3abad | https://github.com/Azure/autorest-clientruntime-for-java/blob/04621e07dbb0456dd5459dd641f06a9fd4f3abad/azure-arm-client-runtime/src/main/java/com/microsoft/azure/arm/dag/DAGraph.java#L125-L138 | train |
Azure/autorest-clientruntime-for-java | azure-arm-client-runtime/src/main/java/com/microsoft/azure/arm/dag/DAGraph.java | DAGraph.getNext | public NodeT getNext() {
String nextItemKey = queue.poll();
if (nextItemKey == null) {
return null;
}
return nodeTable.get(nextItemKey);
} | java | public NodeT getNext() {
String nextItemKey = queue.poll();
if (nextItemKey == null) {
return null;
}
return nodeTable.get(nextItemKey);
} | [
"public",
"NodeT",
"getNext",
"(",
")",
"{",
"String",
"nextItemKey",
"=",
"queue",
".",
"poll",
"(",
")",
";",
"if",
"(",
"nextItemKey",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"return",
"nodeTable",
".",
"get",
"(",
"nextItemKey",
")",
... | Gets next node in the DAG which has no dependency or all of it's dependencies are resolved and
ready to be consumed.
@return next node or null if all the nodes have been explored or no node is available at this moment. | [
"Gets",
"next",
"node",
"in",
"the",
"DAG",
"which",
"has",
"no",
"dependency",
"or",
"all",
"of",
"it",
"s",
"dependencies",
"are",
"resolved",
"and",
"ready",
"to",
"be",
"consumed",
"."
] | 04621e07dbb0456dd5459dd641f06a9fd4f3abad | https://github.com/Azure/autorest-clientruntime-for-java/blob/04621e07dbb0456dd5459dd641f06a9fd4f3abad/azure-arm-client-runtime/src/main/java/com/microsoft/azure/arm/dag/DAGraph.java#L146-L152 | train |
Azure/autorest-clientruntime-for-java | azure-arm-client-runtime/src/main/java/com/microsoft/azure/arm/dag/DAGraph.java | DAGraph.reportCompletion | public void reportCompletion(NodeT completed) {
completed.setPreparer(true);
String dependency = completed.key();
for (String dependentKey : nodeTable.get(dependency).dependentKeys()) {
DAGNode<DataT, NodeT> dependent = nodeTable.get(dependentKey);
dependent.lock().lock()... | java | public void reportCompletion(NodeT completed) {
completed.setPreparer(true);
String dependency = completed.key();
for (String dependentKey : nodeTable.get(dependency).dependentKeys()) {
DAGNode<DataT, NodeT> dependent = nodeTable.get(dependentKey);
dependent.lock().lock()... | [
"public",
"void",
"reportCompletion",
"(",
"NodeT",
"completed",
")",
"{",
"completed",
".",
"setPreparer",
"(",
"true",
")",
";",
"String",
"dependency",
"=",
"completed",
".",
"key",
"(",
")",
";",
"for",
"(",
"String",
"dependentKey",
":",
"nodeTable",
... | Reports that a node is resolved hence other nodes depends on it can consume it.
@param completed the node ready to be consumed | [
"Reports",
"that",
"a",
"node",
"is",
"resolved",
"hence",
"other",
"nodes",
"depends",
"on",
"it",
"can",
"consume",
"it",
"."
] | 04621e07dbb0456dd5459dd641f06a9fd4f3abad | https://github.com/Azure/autorest-clientruntime-for-java/blob/04621e07dbb0456dd5459dd641f06a9fd4f3abad/azure-arm-client-runtime/src/main/java/com/microsoft/azure/arm/dag/DAGraph.java#L159-L174 | train |
Azure/autorest-clientruntime-for-java | azure-arm-client-runtime/src/main/java/com/microsoft/azure/arm/dag/DAGraph.java | DAGraph.reportError | public void reportError(NodeT faulted, Throwable throwable) {
faulted.setPreparer(true);
String dependency = faulted.key();
for (String dependentKey : nodeTable.get(dependency).dependentKeys()) {
DAGNode<DataT, NodeT> dependent = nodeTable.get(dependentKey);
dependent.loc... | java | public void reportError(NodeT faulted, Throwable throwable) {
faulted.setPreparer(true);
String dependency = faulted.key();
for (String dependentKey : nodeTable.get(dependency).dependentKeys()) {
DAGNode<DataT, NodeT> dependent = nodeTable.get(dependentKey);
dependent.loc... | [
"public",
"void",
"reportError",
"(",
"NodeT",
"faulted",
",",
"Throwable",
"throwable",
")",
"{",
"faulted",
".",
"setPreparer",
"(",
"true",
")",
";",
"String",
"dependency",
"=",
"faulted",
".",
"key",
"(",
")",
";",
"for",
"(",
"String",
"dependentKey"... | Reports that a node is faulted.
@param faulted the node faulted
@param throwable the reason for fault | [
"Reports",
"that",
"a",
"node",
"is",
"faulted",
"."
] | 04621e07dbb0456dd5459dd641f06a9fd4f3abad | https://github.com/Azure/autorest-clientruntime-for-java/blob/04621e07dbb0456dd5459dd641f06a9fd4f3abad/azure-arm-client-runtime/src/main/java/com/microsoft/azure/arm/dag/DAGraph.java#L182-L197 | train |
Azure/autorest-clientruntime-for-java | azure-arm-client-runtime/src/main/java/com/microsoft/azure/arm/dag/DAGraph.java | DAGraph.initializeQueue | private void initializeQueue() {
this.queue.clear();
for (Map.Entry<String, NodeT> entry: nodeTable.entrySet()) {
if (!entry.getValue().hasDependencies()) {
this.queue.add(entry.getKey());
}
}
if (queue.isEmpty()) {
throw new IllegalSta... | java | private void initializeQueue() {
this.queue.clear();
for (Map.Entry<String, NodeT> entry: nodeTable.entrySet()) {
if (!entry.getValue().hasDependencies()) {
this.queue.add(entry.getKey());
}
}
if (queue.isEmpty()) {
throw new IllegalSta... | [
"private",
"void",
"initializeQueue",
"(",
")",
"{",
"this",
".",
"queue",
".",
"clear",
"(",
")",
";",
"for",
"(",
"Map",
".",
"Entry",
"<",
"String",
",",
"NodeT",
">",
"entry",
":",
"nodeTable",
".",
"entrySet",
"(",
")",
")",
"{",
"if",
"(",
... | Initializes the queue that tracks the next set of nodes with no dependencies or
whose dependencies are resolved. | [
"Initializes",
"the",
"queue",
"that",
"tracks",
"the",
"next",
"set",
"of",
"nodes",
"with",
"no",
"dependencies",
"or",
"whose",
"dependencies",
"are",
"resolved",
"."
] | 04621e07dbb0456dd5459dd641f06a9fd4f3abad | https://github.com/Azure/autorest-clientruntime-for-java/blob/04621e07dbb0456dd5459dd641f06a9fd4f3abad/azure-arm-client-runtime/src/main/java/com/microsoft/azure/arm/dag/DAGraph.java#L234-L244 | train |
Azure/autorest-clientruntime-for-java | azure-arm-client-runtime/src/main/java/com/microsoft/azure/arm/dag/DAGraph.java | DAGraph.merge | private void merge(Map<String, NodeT> source, Map<String, NodeT> target) {
for (Map.Entry<String, NodeT> entry : source.entrySet()) {
String key = entry.getKey();
if (!target.containsKey(key)) {
target.put(key, entry.getValue());
}
}
} | java | private void merge(Map<String, NodeT> source, Map<String, NodeT> target) {
for (Map.Entry<String, NodeT> entry : source.entrySet()) {
String key = entry.getKey();
if (!target.containsKey(key)) {
target.put(key, entry.getValue());
}
}
} | [
"private",
"void",
"merge",
"(",
"Map",
"<",
"String",
",",
"NodeT",
">",
"source",
",",
"Map",
"<",
"String",
",",
"NodeT",
">",
"target",
")",
"{",
"for",
"(",
"Map",
".",
"Entry",
"<",
"String",
",",
"NodeT",
">",
"entry",
":",
"source",
".",
... | Copies entries in the source map to target map.
@param source source map
@param target target map | [
"Copies",
"entries",
"in",
"the",
"source",
"map",
"to",
"target",
"map",
"."
] | 04621e07dbb0456dd5459dd641f06a9fd4f3abad | https://github.com/Azure/autorest-clientruntime-for-java/blob/04621e07dbb0456dd5459dd641f06a9fd4f3abad/azure-arm-client-runtime/src/main/java/com/microsoft/azure/arm/dag/DAGraph.java#L252-L259 | train |
Azure/autorest-clientruntime-for-java | azure-arm-client-runtime/src/main/java/com/microsoft/azure/arm/dag/DAGraph.java | DAGraph.bubbleUpNodeTable | private void bubbleUpNodeTable(DAGraph<DataT, NodeT> from, LinkedList<String> path) {
if (path.contains(from.rootNode.key())) {
path.push(from.rootNode.key()); // For better error message
throw new IllegalStateException("Detected circular dependency: " + StringUtils.join(path, " -> "));
... | java | private void bubbleUpNodeTable(DAGraph<DataT, NodeT> from, LinkedList<String> path) {
if (path.contains(from.rootNode.key())) {
path.push(from.rootNode.key()); // For better error message
throw new IllegalStateException("Detected circular dependency: " + StringUtils.join(path, " -> "));
... | [
"private",
"void",
"bubbleUpNodeTable",
"(",
"DAGraph",
"<",
"DataT",
",",
"NodeT",
">",
"from",
",",
"LinkedList",
"<",
"String",
">",
"path",
")",
"{",
"if",
"(",
"path",
".",
"contains",
"(",
"from",
".",
"rootNode",
".",
"key",
"(",
")",
")",
")"... | Propagates node table of given DAG to all of it ancestors. | [
"Propagates",
"node",
"table",
"of",
"given",
"DAG",
"to",
"all",
"of",
"it",
"ancestors",
"."
] | 04621e07dbb0456dd5459dd641f06a9fd4f3abad | https://github.com/Azure/autorest-clientruntime-for-java/blob/04621e07dbb0456dd5459dd641f06a9fd4f3abad/azure-arm-client-runtime/src/main/java/com/microsoft/azure/arm/dag/DAGraph.java#L264-L275 | train |
Azure/autorest-clientruntime-for-java | azure-arm-client-runtime/src/main/java/com/microsoft/azure/arm/dag/IndexableTaskItem.java | IndexableTaskItem.create | public static IndexableTaskItem create(final FunctionalTaskItem taskItem) {
return new IndexableTaskItem() {
@Override
protected Observable<Indexable> invokeTaskAsync(TaskGroup.InvocationContext context) {
FunctionalTaskItem.Context fContext = new FunctionalTaskItem.Conte... | java | public static IndexableTaskItem create(final FunctionalTaskItem taskItem) {
return new IndexableTaskItem() {
@Override
protected Observable<Indexable> invokeTaskAsync(TaskGroup.InvocationContext context) {
FunctionalTaskItem.Context fContext = new FunctionalTaskItem.Conte... | [
"public",
"static",
"IndexableTaskItem",
"create",
"(",
"final",
"FunctionalTaskItem",
"taskItem",
")",
"{",
"return",
"new",
"IndexableTaskItem",
"(",
")",
"{",
"@",
"Override",
"protected",
"Observable",
"<",
"Indexable",
">",
"invokeTaskAsync",
"(",
"TaskGroup",
... | Creates an IndexableTaskItem from provided FunctionalTaskItem.
@param taskItem functional TaskItem
@return IndexableTaskItem | [
"Creates",
"an",
"IndexableTaskItem",
"from",
"provided",
"FunctionalTaskItem",
"."
] | 04621e07dbb0456dd5459dd641f06a9fd4f3abad | https://github.com/Azure/autorest-clientruntime-for-java/blob/04621e07dbb0456dd5459dd641f06a9fd4f3abad/azure-arm-client-runtime/src/main/java/com/microsoft/azure/arm/dag/IndexableTaskItem.java#L63-L72 | train |
Azure/autorest-clientruntime-for-java | azure-arm-client-runtime/src/main/java/com/microsoft/azure/arm/dag/IndexableTaskItem.java | IndexableTaskItem.addeDependency | @SuppressWarnings("unchecked")
protected String addeDependency(Appliable<? extends Indexable> appliable) {
TaskGroup.HasTaskGroup dependency = (TaskGroup.HasTaskGroup) appliable;
return this.addDependency(dependency);
} | java | @SuppressWarnings("unchecked")
protected String addeDependency(Appliable<? extends Indexable> appliable) {
TaskGroup.HasTaskGroup dependency = (TaskGroup.HasTaskGroup) appliable;
return this.addDependency(dependency);
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"protected",
"String",
"addeDependency",
"(",
"Appliable",
"<",
"?",
"extends",
"Indexable",
">",
"appliable",
")",
"{",
"TaskGroup",
".",
"HasTaskGroup",
"dependency",
"=",
"(",
"TaskGroup",
".",
"HasTaskGroup",... | Add an appliable dependency for this task item.
@param appliable the appliable dependency.
@return the key to be used as parameter to taskResult(string) method to retrieve updated dependency | [
"Add",
"an",
"appliable",
"dependency",
"for",
"this",
"task",
"item",
"."
] | 04621e07dbb0456dd5459dd641f06a9fd4f3abad | https://github.com/Azure/autorest-clientruntime-for-java/blob/04621e07dbb0456dd5459dd641f06a9fd4f3abad/azure-arm-client-runtime/src/main/java/com/microsoft/azure/arm/dag/IndexableTaskItem.java#L136-L140 | train |
Azure/autorest-clientruntime-for-java | azure-arm-client-runtime/src/main/java/com/microsoft/azure/arm/dag/IndexableTaskItem.java | IndexableTaskItem.addPostRunDependent | public String addPostRunDependent(FunctionalTaskItem dependent) {
Objects.requireNonNull(dependent);
return this.taskGroup().addPostRunDependent(dependent);
} | java | public String addPostRunDependent(FunctionalTaskItem dependent) {
Objects.requireNonNull(dependent);
return this.taskGroup().addPostRunDependent(dependent);
} | [
"public",
"String",
"addPostRunDependent",
"(",
"FunctionalTaskItem",
"dependent",
")",
"{",
"Objects",
".",
"requireNonNull",
"(",
"dependent",
")",
";",
"return",
"this",
".",
"taskGroup",
"(",
")",
".",
"addPostRunDependent",
"(",
"dependent",
")",
";",
"}"
] | Add a "post-run" dependent task item for this task item.
@param dependent the "post-run" dependent task item.
@return key to be used as parameter to taskResult(string) method to retrieve result of root
task in the given dependent task group | [
"Add",
"a",
"post",
"-",
"run",
"dependent",
"task",
"item",
"for",
"this",
"task",
"item",
"."
] | 04621e07dbb0456dd5459dd641f06a9fd4f3abad | https://github.com/Azure/autorest-clientruntime-for-java/blob/04621e07dbb0456dd5459dd641f06a9fd4f3abad/azure-arm-client-runtime/src/main/java/com/microsoft/azure/arm/dag/IndexableTaskItem.java#L162-L165 | train |
Azure/autorest-clientruntime-for-java | azure-arm-client-runtime/src/main/java/com/microsoft/azure/arm/dag/IndexableTaskItem.java | IndexableTaskItem.addPostRunDependent | @SuppressWarnings("unchecked")
protected String addPostRunDependent(Creatable<? extends Indexable> creatable) {
TaskGroup.HasTaskGroup dependency = (TaskGroup.HasTaskGroup) creatable;
return this.addPostRunDependent(dependency);
} | java | @SuppressWarnings("unchecked")
protected String addPostRunDependent(Creatable<? extends Indexable> creatable) {
TaskGroup.HasTaskGroup dependency = (TaskGroup.HasTaskGroup) creatable;
return this.addPostRunDependent(dependency);
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"protected",
"String",
"addPostRunDependent",
"(",
"Creatable",
"<",
"?",
"extends",
"Indexable",
">",
"creatable",
")",
"{",
"TaskGroup",
".",
"HasTaskGroup",
"dependency",
"=",
"(",
"TaskGroup",
".",
"HasTaskGr... | Add a creatable "post-run" dependent for this task item.
@param creatable the creatable "post-run" dependent.
@return the key to be used as parameter to taskResult(string) method to retrieve created "post-run" dependent | [
"Add",
"a",
"creatable",
"post",
"-",
"run",
"dependent",
"for",
"this",
"task",
"item",
"."
] | 04621e07dbb0456dd5459dd641f06a9fd4f3abad | https://github.com/Azure/autorest-clientruntime-for-java/blob/04621e07dbb0456dd5459dd641f06a9fd4f3abad/azure-arm-client-runtime/src/main/java/com/microsoft/azure/arm/dag/IndexableTaskItem.java#L186-L190 | train |
Azure/autorest-clientruntime-for-java | azure-arm-client-runtime/src/main/java/com/microsoft/azure/arm/dag/IndexableTaskItem.java | IndexableTaskItem.addPostRunDependent | @SuppressWarnings("unchecked")
protected String addPostRunDependent(Appliable<? extends Indexable> appliable) {
TaskGroup.HasTaskGroup dependency = (TaskGroup.HasTaskGroup) appliable;
return this.addPostRunDependent(dependency);
} | java | @SuppressWarnings("unchecked")
protected String addPostRunDependent(Appliable<? extends Indexable> appliable) {
TaskGroup.HasTaskGroup dependency = (TaskGroup.HasTaskGroup) appliable;
return this.addPostRunDependent(dependency);
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"protected",
"String",
"addPostRunDependent",
"(",
"Appliable",
"<",
"?",
"extends",
"Indexable",
">",
"appliable",
")",
"{",
"TaskGroup",
".",
"HasTaskGroup",
"dependency",
"=",
"(",
"TaskGroup",
".",
"HasTaskGr... | Add an appliable "post-run" dependent for this task item.
@param appliable the appliable "post-run" dependent.
@return the key to be used as parameter to taskResult(string) method to retrieve updated "post-run" dependent | [
"Add",
"an",
"appliable",
"post",
"-",
"run",
"dependent",
"for",
"this",
"task",
"item",
"."
] | 04621e07dbb0456dd5459dd641f06a9fd4f3abad | https://github.com/Azure/autorest-clientruntime-for-java/blob/04621e07dbb0456dd5459dd641f06a9fd4f3abad/azure-arm-client-runtime/src/main/java/com/microsoft/azure/arm/dag/IndexableTaskItem.java#L198-L202 | train |
Azure/autorest-clientruntime-for-java | azure-arm-client-runtime/src/main/java/com/microsoft/azure/arm/dag/IndexableTaskItem.java | IndexableTaskItem.taskResult | @SuppressWarnings("unchecked")
protected <T extends Indexable> T taskResult(String key) {
Indexable result = this.taskGroup.taskResult(key);
if (result == null) {
return null;
} else {
T castedResult = (T) result;
return castedResult;
}
} | java | @SuppressWarnings("unchecked")
protected <T extends Indexable> T taskResult(String key) {
Indexable result = this.taskGroup.taskResult(key);
if (result == null) {
return null;
} else {
T castedResult = (T) result;
return castedResult;
}
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"protected",
"<",
"T",
"extends",
"Indexable",
">",
"T",
"taskResult",
"(",
"String",
"key",
")",
"{",
"Indexable",
"result",
"=",
"this",
".",
"taskGroup",
".",
"taskResult",
"(",
"key",
")",
";",
"if",
... | Get result of one of the task that belongs to this task's task group.
@param key the task key
@param <T> the actual type of the task result
@return the task result, null will be returned if task has not produced a result yet | [
"Get",
"result",
"of",
"one",
"of",
"the",
"task",
"that",
"belongs",
"to",
"this",
"task",
"s",
"task",
"group",
"."
] | 04621e07dbb0456dd5459dd641f06a9fd4f3abad | https://github.com/Azure/autorest-clientruntime-for-java/blob/04621e07dbb0456dd5459dd641f06a9fd4f3abad/azure-arm-client-runtime/src/main/java/com/microsoft/azure/arm/dag/IndexableTaskItem.java#L224-L233 | train |
Azure/autorest-clientruntime-for-java | azure-arm-client-runtime/src/main/java/com/microsoft/azure/arm/resources/Region.java | Region.create | public static Region create(String name, String label) {
Region region = VALUES_BY_NAME.get(name.toLowerCase());
if (region != null) {
return region;
} else {
return new Region(name, label);
}
} | java | public static Region create(String name, String label) {
Region region = VALUES_BY_NAME.get(name.toLowerCase());
if (region != null) {
return region;
} else {
return new Region(name, label);
}
} | [
"public",
"static",
"Region",
"create",
"(",
"String",
"name",
",",
"String",
"label",
")",
"{",
"Region",
"region",
"=",
"VALUES_BY_NAME",
".",
"get",
"(",
"name",
".",
"toLowerCase",
"(",
")",
")",
";",
"if",
"(",
"region",
"!=",
"null",
")",
"{",
... | Creates a region from a name and a label.
@param name the uniquely identifiable name of the region
@param label the label of the region
@return the newly created region | [
"Creates",
"a",
"region",
"from",
"a",
"name",
"and",
"a",
"label",
"."
] | 04621e07dbb0456dd5459dd641f06a9fd4f3abad | https://github.com/Azure/autorest-clientruntime-for-java/blob/04621e07dbb0456dd5459dd641f06a9fd4f3abad/azure-arm-client-runtime/src/main/java/com/microsoft/azure/arm/resources/Region.java#L129-L136 | train |
Azure/autorest-clientruntime-for-java | azure-arm-client-runtime/src/main/java/com/microsoft/azure/arm/resources/Region.java | Region.fromName | public static Region fromName(String name) {
if (name == null) {
return null;
}
Region region = VALUES_BY_NAME.get(name.toLowerCase().replace(" ", ""));
if (region != null) {
return region;
} else {
return Region.create(name.toLowerCase().repl... | java | public static Region fromName(String name) {
if (name == null) {
return null;
}
Region region = VALUES_BY_NAME.get(name.toLowerCase().replace(" ", ""));
if (region != null) {
return region;
} else {
return Region.create(name.toLowerCase().repl... | [
"public",
"static",
"Region",
"fromName",
"(",
"String",
"name",
")",
"{",
"if",
"(",
"name",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"Region",
"region",
"=",
"VALUES_BY_NAME",
".",
"get",
"(",
"name",
".",
"toLowerCase",
"(",
")",
".",
"... | Parses a name into a Region object and creates a new Region instance if not found among the existing ones.
@param name a region name
@return the parsed or created region | [
"Parses",
"a",
"name",
"into",
"a",
"Region",
"object",
"and",
"creates",
"a",
"new",
"Region",
"instance",
"if",
"not",
"found",
"among",
"the",
"existing",
"ones",
"."
] | 04621e07dbb0456dd5459dd641f06a9fd4f3abad | https://github.com/Azure/autorest-clientruntime-for-java/blob/04621e07dbb0456dd5459dd641f06a9fd4f3abad/azure-arm-client-runtime/src/main/java/com/microsoft/azure/arm/resources/Region.java#L179-L190 | train |
Azure/autorest-clientruntime-for-java | azure-arm-client-runtime/src/main/java/com/microsoft/azure/arm/resources/collection/implementation/ExternalChildResourceCollectionImpl.java | ExternalChildResourceCollectionImpl.prepareForFutureCommitOrPostRun | protected FluentModelTImpl prepareForFutureCommitOrPostRun(FluentModelTImpl childResource) {
if (this.isPostRunMode) {
if (!childResource.taskGroup().dependsOn(this.parentTaskGroup)) {
this.parentTaskGroup.addPostRunDependentTaskGroup(childResource.taskGroup());
}
... | java | protected FluentModelTImpl prepareForFutureCommitOrPostRun(FluentModelTImpl childResource) {
if (this.isPostRunMode) {
if (!childResource.taskGroup().dependsOn(this.parentTaskGroup)) {
this.parentTaskGroup.addPostRunDependentTaskGroup(childResource.taskGroup());
}
... | [
"protected",
"FluentModelTImpl",
"prepareForFutureCommitOrPostRun",
"(",
"FluentModelTImpl",
"childResource",
")",
"{",
"if",
"(",
"this",
".",
"isPostRunMode",
")",
"{",
"if",
"(",
"!",
"childResource",
".",
"taskGroup",
"(",
")",
".",
"dependsOn",
"(",
"this",
... | Mark the given child resource as the post run dependent of the parent of this collection.
@param childResource the child resource | [
"Mark",
"the",
"given",
"child",
"resource",
"as",
"the",
"post",
"run",
"dependent",
"of",
"the",
"parent",
"of",
"this",
"collection",
"."
] | 04621e07dbb0456dd5459dd641f06a9fd4f3abad | https://github.com/Azure/autorest-clientruntime-for-java/blob/04621e07dbb0456dd5459dd641f06a9fd4f3abad/azure-arm-client-runtime/src/main/java/com/microsoft/azure/arm/resources/collection/implementation/ExternalChildResourceCollectionImpl.java#L113-L122 | train |
Azure/autorest-clientruntime-for-java | azure-arm-client-runtime/src/main/java/com/microsoft/azure/arm/resources/collection/implementation/ExternalChildResourceCollectionImpl.java | ExternalChildResourceCollectionImpl.find | protected FluentModelTImpl find(String key) {
for (Map.Entry<String, FluentModelTImpl> entry : this.childCollection.entrySet()) {
if (entry.getKey().equalsIgnoreCase(key)) {
return entry.getValue();
}
}
return null;
} | java | protected FluentModelTImpl find(String key) {
for (Map.Entry<String, FluentModelTImpl> entry : this.childCollection.entrySet()) {
if (entry.getKey().equalsIgnoreCase(key)) {
return entry.getValue();
}
}
return null;
} | [
"protected",
"FluentModelTImpl",
"find",
"(",
"String",
"key",
")",
"{",
"for",
"(",
"Map",
".",
"Entry",
"<",
"String",
",",
"FluentModelTImpl",
">",
"entry",
":",
"this",
".",
"childCollection",
".",
"entrySet",
"(",
")",
")",
"{",
"if",
"(",
"entry",
... | Finds a child resource with the given key.
@param key the child resource key
@return null if no child resource exists with the given name else the child resource | [
"Finds",
"a",
"child",
"resource",
"with",
"the",
"given",
"key",
"."
] | 04621e07dbb0456dd5459dd641f06a9fd4f3abad | https://github.com/Azure/autorest-clientruntime-for-java/blob/04621e07dbb0456dd5459dd641f06a9fd4f3abad/azure-arm-client-runtime/src/main/java/com/microsoft/azure/arm/resources/collection/implementation/ExternalChildResourceCollectionImpl.java#L294-L301 | train |
Azure/autorest-clientruntime-for-java | azure-client-runtime/src/main/java/com/microsoft/azure/AzureServiceFuture.java | AzureServiceFuture.fromPageResponse | public static <E> ServiceFuture<List<E>> fromPageResponse(Observable<ServiceResponse<Page<E>>> first, final Func1<String, Observable<ServiceResponse<Page<E>>>> next, final ListOperationCallback<E> callback) {
final AzureServiceFuture<List<E>> serviceCall = new AzureServiceFuture<>();
final PagingSubscri... | java | public static <E> ServiceFuture<List<E>> fromPageResponse(Observable<ServiceResponse<Page<E>>> first, final Func1<String, Observable<ServiceResponse<Page<E>>>> next, final ListOperationCallback<E> callback) {
final AzureServiceFuture<List<E>> serviceCall = new AzureServiceFuture<>();
final PagingSubscri... | [
"public",
"static",
"<",
"E",
">",
"ServiceFuture",
"<",
"List",
"<",
"E",
">",
">",
"fromPageResponse",
"(",
"Observable",
"<",
"ServiceResponse",
"<",
"Page",
"<",
"E",
">",
">",
">",
"first",
",",
"final",
"Func1",
"<",
"String",
",",
"Observable",
... | Creates a ServiceCall from a paging operation.
@param first the observable to the first page
@param next the observable to poll subsequent pages
@param callback the client-side callback
@param <E> the element type
@return the future based ServiceCall | [
"Creates",
"a",
"ServiceCall",
"from",
"a",
"paging",
"operation",
"."
] | 04621e07dbb0456dd5459dd641f06a9fd4f3abad | https://github.com/Azure/autorest-clientruntime-for-java/blob/04621e07dbb0456dd5459dd641f06a9fd4f3abad/azure-client-runtime/src/main/java/com/microsoft/azure/AzureServiceFuture.java#L38-L45 | train |
Azure/autorest-clientruntime-for-java | azure-client-runtime/src/main/java/com/microsoft/azure/AzureServiceFuture.java | AzureServiceFuture.fromHeaderPageResponse | public static <E, V> ServiceFuture<List<E>> fromHeaderPageResponse(Observable<ServiceResponseWithHeaders<Page<E>, V>> first, final Func1<String, Observable<ServiceResponseWithHeaders<Page<E>, V>>> next, final ListOperationCallback<E> callback) {
final AzureServiceFuture<List<E>> serviceCall = new AzureServiceFu... | java | public static <E, V> ServiceFuture<List<E>> fromHeaderPageResponse(Observable<ServiceResponseWithHeaders<Page<E>, V>> first, final Func1<String, Observable<ServiceResponseWithHeaders<Page<E>, V>>> next, final ListOperationCallback<E> callback) {
final AzureServiceFuture<List<E>> serviceCall = new AzureServiceFu... | [
"public",
"static",
"<",
"E",
",",
"V",
">",
"ServiceFuture",
"<",
"List",
"<",
"E",
">",
">",
"fromHeaderPageResponse",
"(",
"Observable",
"<",
"ServiceResponseWithHeaders",
"<",
"Page",
"<",
"E",
">",
",",
"V",
">",
">",
"first",
",",
"final",
"Func1",... | Creates a ServiceCall from a paging operation that returns a header response.
@param first the observable to the first page
@param next the observable to poll subsequent pages
@param callback the client-side callback
@param <E> the element type
@param <V> the header object type
@return the future based ServiceCall | [
"Creates",
"a",
"ServiceCall",
"from",
"a",
"paging",
"operation",
"that",
"returns",
"a",
"header",
"response",
"."
] | 04621e07dbb0456dd5459dd641f06a9fd4f3abad | https://github.com/Azure/autorest-clientruntime-for-java/blob/04621e07dbb0456dd5459dd641f06a9fd4f3abad/azure-client-runtime/src/main/java/com/microsoft/azure/AzureServiceFuture.java#L57-L75 | train |
Azure/autorest-clientruntime-for-java | client-runtime/src/main/java/com/microsoft/rest/serializer/FlatteningDeserializer.java | FlatteningDeserializer.findNestedNode | private static JsonNode findNestedNode(JsonNode jsonNode, String composedKey) {
String[] jsonNodeKeys = splitKeyByFlatteningDots(composedKey);
for (String jsonNodeKey : jsonNodeKeys) {
jsonNode = jsonNode.get(unescapeEscapedDots(jsonNodeKey));
if (jsonNode == null) {
... | java | private static JsonNode findNestedNode(JsonNode jsonNode, String composedKey) {
String[] jsonNodeKeys = splitKeyByFlatteningDots(composedKey);
for (String jsonNodeKey : jsonNodeKeys) {
jsonNode = jsonNode.get(unescapeEscapedDots(jsonNodeKey));
if (jsonNode == null) {
... | [
"private",
"static",
"JsonNode",
"findNestedNode",
"(",
"JsonNode",
"jsonNode",
",",
"String",
"composedKey",
")",
"{",
"String",
"[",
"]",
"jsonNodeKeys",
"=",
"splitKeyByFlatteningDots",
"(",
"composedKey",
")",
";",
"for",
"(",
"String",
"jsonNodeKey",
":",
"... | Given a json node, find a nested node using given composed key.
@param jsonNode the parent json node
@param composedKey a key combines multiple keys using flattening dots.
Flattening dots are dot character '.' those are not preceded by slash '\'
Each flattening dot represents a level with following key as field key in... | [
"Given",
"a",
"json",
"node",
"find",
"a",
"nested",
"node",
"using",
"given",
"composed",
"key",
"."
] | 04621e07dbb0456dd5459dd641f06a9fd4f3abad | https://github.com/Azure/autorest-clientruntime-for-java/blob/04621e07dbb0456dd5459dd641f06a9fd4f3abad/client-runtime/src/main/java/com/microsoft/rest/serializer/FlatteningDeserializer.java#L168-L177 | train |
Azure/autorest-clientruntime-for-java | client-runtime/src/main/java/com/microsoft/rest/serializer/FlatteningDeserializer.java | FlatteningDeserializer.newJsonParserForNode | private static JsonParser newJsonParserForNode(JsonNode jsonNode) throws IOException {
JsonParser parser = new JsonFactory().createParser(jsonNode.toString());
parser.nextToken();
return parser;
} | java | private static JsonParser newJsonParserForNode(JsonNode jsonNode) throws IOException {
JsonParser parser = new JsonFactory().createParser(jsonNode.toString());
parser.nextToken();
return parser;
} | [
"private",
"static",
"JsonParser",
"newJsonParserForNode",
"(",
"JsonNode",
"jsonNode",
")",
"throws",
"IOException",
"{",
"JsonParser",
"parser",
"=",
"new",
"JsonFactory",
"(",
")",
".",
"createParser",
"(",
"jsonNode",
".",
"toString",
"(",
")",
")",
";",
"... | Create a JsonParser for a given json node.
@param jsonNode the json node
@return the json parser
@throws IOException | [
"Create",
"a",
"JsonParser",
"for",
"a",
"given",
"json",
"node",
"."
] | 04621e07dbb0456dd5459dd641f06a9fd4f3abad | https://github.com/Azure/autorest-clientruntime-for-java/blob/04621e07dbb0456dd5459dd641f06a9fd4f3abad/client-runtime/src/main/java/com/microsoft/rest/serializer/FlatteningDeserializer.java#L229-L233 | train |
Azure/autorest-clientruntime-for-java | azure-arm-client-runtime/src/main/java/com/microsoft/azure/arm/resources/models/implementation/ExternalChildResourceImpl.java | ExternalChildResourceImpl.addDependency | protected String addDependency(FunctionalTaskItem dependency) {
Objects.requireNonNull(dependency);
return this.taskGroup().addDependency(dependency);
} | java | protected String addDependency(FunctionalTaskItem dependency) {
Objects.requireNonNull(dependency);
return this.taskGroup().addDependency(dependency);
} | [
"protected",
"String",
"addDependency",
"(",
"FunctionalTaskItem",
"dependency",
")",
"{",
"Objects",
".",
"requireNonNull",
"(",
"dependency",
")",
";",
"return",
"this",
".",
"taskGroup",
"(",
")",
".",
"addDependency",
"(",
"dependency",
")",
";",
"}"
] | Add a dependency task item for this model.
@param dependency the dependency task item.
@return key to be used as parameter to taskResult(string) method to retrieve result the task item | [
"Add",
"a",
"dependency",
"task",
"item",
"for",
"this",
"model",
"."
] | 04621e07dbb0456dd5459dd641f06a9fd4f3abad | https://github.com/Azure/autorest-clientruntime-for-java/blob/04621e07dbb0456dd5459dd641f06a9fd4f3abad/azure-arm-client-runtime/src/main/java/com/microsoft/azure/arm/resources/models/implementation/ExternalChildResourceImpl.java#L201-L204 | train |
Azure/autorest-clientruntime-for-java | azure-arm-client-runtime/src/main/java/com/microsoft/azure/arm/resources/models/implementation/ExternalChildResourceImpl.java | ExternalChildResourceImpl.addDependency | protected String addDependency(TaskGroup.HasTaskGroup dependency) {
Objects.requireNonNull(dependency);
this.taskGroup().addDependencyTaskGroup(dependency.taskGroup());
return dependency.taskGroup().key();
} | java | protected String addDependency(TaskGroup.HasTaskGroup dependency) {
Objects.requireNonNull(dependency);
this.taskGroup().addDependencyTaskGroup(dependency.taskGroup());
return dependency.taskGroup().key();
} | [
"protected",
"String",
"addDependency",
"(",
"TaskGroup",
".",
"HasTaskGroup",
"dependency",
")",
"{",
"Objects",
".",
"requireNonNull",
"(",
"dependency",
")",
";",
"this",
".",
"taskGroup",
"(",
")",
".",
"addDependencyTaskGroup",
"(",
"dependency",
".",
"task... | Add a dependency task group for this model.
@param dependency the dependency.
@return key to be used as parameter to taskResult(string) method to retrieve result of root
task in the given dependency task group | [
"Add",
"a",
"dependency",
"task",
"group",
"for",
"this",
"model",
"."
] | 04621e07dbb0456dd5459dd641f06a9fd4f3abad | https://github.com/Azure/autorest-clientruntime-for-java/blob/04621e07dbb0456dd5459dd641f06a9fd4f3abad/azure-arm-client-runtime/src/main/java/com/microsoft/azure/arm/resources/models/implementation/ExternalChildResourceImpl.java#L213-L217 | train |
Azure/autorest-clientruntime-for-java | azure-arm-client-runtime/src/main/java/com/microsoft/azure/arm/resources/models/implementation/ExternalChildResourceImpl.java | ExternalChildResourceImpl.addPostRunDependent | @SuppressWarnings("unchecked")
protected void addPostRunDependent(Executable<? extends Indexable> executable) {
TaskGroup.HasTaskGroup dependency = (TaskGroup.HasTaskGroup) executable;
this.addPostRunDependent(dependency);
} | java | @SuppressWarnings("unchecked")
protected void addPostRunDependent(Executable<? extends Indexable> executable) {
TaskGroup.HasTaskGroup dependency = (TaskGroup.HasTaskGroup) executable;
this.addPostRunDependent(dependency);
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"protected",
"void",
"addPostRunDependent",
"(",
"Executable",
"<",
"?",
"extends",
"Indexable",
">",
"executable",
")",
"{",
"TaskGroup",
".",
"HasTaskGroup",
"dependency",
"=",
"(",
"TaskGroup",
".",
"HasTaskGr... | Add an executable "post-run" dependent for this model.
@param executable the executable "post-run" dependent
@return the key to be used as parameter to taskResult(string) method to retrieve result of executing
the executable "post-run" dependent | [
"Add",
"an",
"executable",
"post",
"-",
"run",
"dependent",
"for",
"this",
"model",
"."
] | 04621e07dbb0456dd5459dd641f06a9fd4f3abad | https://github.com/Azure/autorest-clientruntime-for-java/blob/04621e07dbb0456dd5459dd641f06a9fd4f3abad/azure-arm-client-runtime/src/main/java/com/microsoft/azure/arm/resources/models/implementation/ExternalChildResourceImpl.java#L312-L316 | train |
Azure/autorest-clientruntime-for-java | azure-arm-client-runtime/src/main/java/com/microsoft/azure/arm/dag/Graph.java | Graph.addNode | public void addNode(NodeT node) {
node.setOwner(this);
nodeTable.put(node.key(), node);
} | java | public void addNode(NodeT node) {
node.setOwner(this);
nodeTable.put(node.key(), node);
} | [
"public",
"void",
"addNode",
"(",
"NodeT",
"node",
")",
"{",
"node",
".",
"setOwner",
"(",
"this",
")",
";",
"nodeTable",
".",
"put",
"(",
"node",
".",
"key",
"(",
")",
",",
"node",
")",
";",
"}"
] | Adds a node to this graph.
@param node the node | [
"Adds",
"a",
"node",
"to",
"this",
"graph",
"."
] | 04621e07dbb0456dd5459dd641f06a9fd4f3abad | https://github.com/Azure/autorest-clientruntime-for-java/blob/04621e07dbb0456dd5459dd641f06a9fd4f3abad/azure-arm-client-runtime/src/main/java/com/microsoft/azure/arm/dag/Graph.java#L79-L82 | train |
Azure/autorest-clientruntime-for-java | azure-arm-client-runtime/src/main/java/com/microsoft/azure/arm/dag/Graph.java | Graph.findPath | protected String findPath(String start, String end) {
if (start.equals(end)) {
return start;
} else {
return findPath(start, parent.get(end)) + " -> " + end;
}
} | java | protected String findPath(String start, String end) {
if (start.equals(end)) {
return start;
} else {
return findPath(start, parent.get(end)) + " -> " + end;
}
} | [
"protected",
"String",
"findPath",
"(",
"String",
"start",
",",
"String",
"end",
")",
"{",
"if",
"(",
"start",
".",
"equals",
"(",
"end",
")",
")",
"{",
"return",
"start",
";",
"}",
"else",
"{",
"return",
"findPath",
"(",
"start",
",",
"parent",
".",... | Find the path.
@param start key of first node in the path
@param end key of last node in the path
@return string containing the nodes keys in the path separated by arrow symbol | [
"Find",
"the",
"path",
"."
] | 04621e07dbb0456dd5459dd641f06a9fd4f3abad | https://github.com/Azure/autorest-clientruntime-for-java/blob/04621e07dbb0456dd5459dd641f06a9fd4f3abad/azure-arm-client-runtime/src/main/java/com/microsoft/azure/arm/dag/Graph.java#L156-L162 | train |
Azure/autorest-clientruntime-for-java | azure-arm-client-runtime/src/main/java/com/microsoft/azure/arm/utils/ListToMapConverter.java | ListToMapConverter.convertToUnmodifiableMap | public Map<String, ImplT> convertToUnmodifiableMap(List<InnerT> innerList) {
Map<String, ImplT> result = new HashMap<>();
for (InnerT inner : innerList) {
result.put(name(inner), impl(inner));
}
return Collections.unmodifiableMap(result);
} | java | public Map<String, ImplT> convertToUnmodifiableMap(List<InnerT> innerList) {
Map<String, ImplT> result = new HashMap<>();
for (InnerT inner : innerList) {
result.put(name(inner), impl(inner));
}
return Collections.unmodifiableMap(result);
} | [
"public",
"Map",
"<",
"String",
",",
"ImplT",
">",
"convertToUnmodifiableMap",
"(",
"List",
"<",
"InnerT",
">",
"innerList",
")",
"{",
"Map",
"<",
"String",
",",
"ImplT",
">",
"result",
"=",
"new",
"HashMap",
"<>",
"(",
")",
";",
"for",
"(",
"InnerT",
... | Converts the passed list of inners to unmodifiable map of impls.
@param innerList list of the inners.
@return map of the impls | [
"Converts",
"the",
"passed",
"list",
"of",
"inners",
"to",
"unmodifiable",
"map",
"of",
"impls",
"."
] | 04621e07dbb0456dd5459dd641f06a9fd4f3abad | https://github.com/Azure/autorest-clientruntime-for-java/blob/04621e07dbb0456dd5459dd641f06a9fd4f3abad/azure-arm-client-runtime/src/main/java/com/microsoft/azure/arm/utils/ListToMapConverter.java#L29-L36 | train |
Azure/autorest-clientruntime-for-java | azure-arm-client-runtime/src/main/java/com/microsoft/azure/arm/utils/Utils.java | Utils.createOdataFilterForTags | public static String createOdataFilterForTags(String tagName, String tagValue) {
if (tagName == null) {
return null;
} else if (tagValue == null) {
return String.format("tagname eq '%s'", tagName);
} else {
return String.format("tagname eq '%s' and tagvalue eq... | java | public static String createOdataFilterForTags(String tagName, String tagValue) {
if (tagName == null) {
return null;
} else if (tagValue == null) {
return String.format("tagname eq '%s'", tagName);
} else {
return String.format("tagname eq '%s' and tagvalue eq... | [
"public",
"static",
"String",
"createOdataFilterForTags",
"(",
"String",
"tagName",
",",
"String",
"tagValue",
")",
"{",
"if",
"(",
"tagName",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"else",
"if",
"(",
"tagValue",
"==",
"null",
")",
"{",
"ret... | Creates an Odata filter string that can be used for filtering list results by tags.
@param tagName the name of the tag. If not provided, all resources will be returned.
@param tagValue the value of the tag. If not provided, only tag name will be filtered.
@return the Odata filter to pass into list methods | [
"Creates",
"an",
"Odata",
"filter",
"string",
"that",
"can",
"be",
"used",
"for",
"filtering",
"list",
"results",
"by",
"tags",
"."
] | 04621e07dbb0456dd5459dd641f06a9fd4f3abad | https://github.com/Azure/autorest-clientruntime-for-java/blob/04621e07dbb0456dd5459dd641f06a9fd4f3abad/azure-arm-client-runtime/src/main/java/com/microsoft/azure/arm/utils/Utils.java#L90-L98 | train |
Azure/autorest-clientruntime-for-java | azure-arm-client-runtime/src/main/java/com/microsoft/azure/arm/utils/Utils.java | Utils.downloadFileAsync | public static Observable<byte[]> downloadFileAsync(String url, Retrofit retrofit) {
FileService service = retrofit.create(FileService.class);
Observable<ResponseBody> response = service.download(url);
return response.map(new Func1<ResponseBody, byte[]>() {
@Override
publi... | java | public static Observable<byte[]> downloadFileAsync(String url, Retrofit retrofit) {
FileService service = retrofit.create(FileService.class);
Observable<ResponseBody> response = service.download(url);
return response.map(new Func1<ResponseBody, byte[]>() {
@Override
publi... | [
"public",
"static",
"Observable",
"<",
"byte",
"[",
"]",
">",
"downloadFileAsync",
"(",
"String",
"url",
",",
"Retrofit",
"retrofit",
")",
"{",
"FileService",
"service",
"=",
"retrofit",
".",
"create",
"(",
"FileService",
".",
"class",
")",
";",
"Observable"... | Download a file asynchronously.
@param url the URL pointing to the file
@param retrofit the retrofit client
@return an Observable pointing to the content of the file | [
"Download",
"a",
"file",
"asynchronously",
"."
] | 04621e07dbb0456dd5459dd641f06a9fd4f3abad | https://github.com/Azure/autorest-clientruntime-for-java/blob/04621e07dbb0456dd5459dd641f06a9fd4f3abad/azure-arm-client-runtime/src/main/java/com/microsoft/azure/arm/utils/Utils.java#L124-L137 | train |
Azure/autorest-clientruntime-for-java | azure-arm-client-runtime/src/main/java/com/microsoft/azure/arm/utils/Utils.java | Utils.toPagedList | public static <OutT, InT> PagedList<OutT> toPagedList(List<InT> list, final Func1<InT, OutT> mapper) {
PageImpl<InT> page = new PageImpl<>();
page.setItems(list);
page.setNextPageLink(null);
PagedList<InT> pagedList = new PagedList<InT>(page) {
@Override
public Pa... | java | public static <OutT, InT> PagedList<OutT> toPagedList(List<InT> list, final Func1<InT, OutT> mapper) {
PageImpl<InT> page = new PageImpl<>();
page.setItems(list);
page.setNextPageLink(null);
PagedList<InT> pagedList = new PagedList<InT>(page) {
@Override
public Pa... | [
"public",
"static",
"<",
"OutT",
",",
"InT",
">",
"PagedList",
"<",
"OutT",
">",
"toPagedList",
"(",
"List",
"<",
"InT",
">",
"list",
",",
"final",
"Func1",
"<",
"InT",
",",
"OutT",
">",
"mapper",
")",
"{",
"PageImpl",
"<",
"InT",
">",
"page",
"=",... | Converts the given list of a type to paged list of a different type.
@param list the list to convert to paged list
@param mapper the mapper to map type in input list to output list
@param <OutT> the type of items in output paged list
@param <InT> the type of items in input paged list
@return the paged list | [
"Converts",
"the",
"given",
"list",
"of",
"a",
"type",
"to",
"paged",
"list",
"of",
"a",
"different",
"type",
"."
] | 04621e07dbb0456dd5459dd641f06a9fd4f3abad | https://github.com/Azure/autorest-clientruntime-for-java/blob/04621e07dbb0456dd5459dd641f06a9fd4f3abad/azure-arm-client-runtime/src/main/java/com/microsoft/azure/arm/utils/Utils.java#L148-L165 | train |
Azure/autorest-clientruntime-for-java | azure-arm-client-runtime/src/main/java/com/microsoft/azure/arm/utils/Utils.java | Utils.addToListIfNotExists | public static void addToListIfNotExists(List<String> list, String value) {
boolean found = false;
for (String item : list) {
if (item.equalsIgnoreCase(value)) {
found = true;
break;
}
}
if (!found) {
list.add(value);
... | java | public static void addToListIfNotExists(List<String> list, String value) {
boolean found = false;
for (String item : list) {
if (item.equalsIgnoreCase(value)) {
found = true;
break;
}
}
if (!found) {
list.add(value);
... | [
"public",
"static",
"void",
"addToListIfNotExists",
"(",
"List",
"<",
"String",
">",
"list",
",",
"String",
"value",
")",
"{",
"boolean",
"found",
"=",
"false",
";",
"for",
"(",
"String",
"item",
":",
"list",
")",
"{",
"if",
"(",
"item",
".",
"equalsIg... | Adds a value to the list if does not already exists.
@param list the list
@param value value to add if not exists in the list | [
"Adds",
"a",
"value",
"to",
"the",
"list",
"if",
"does",
"not",
"already",
"exists",
"."
] | 04621e07dbb0456dd5459dd641f06a9fd4f3abad | https://github.com/Azure/autorest-clientruntime-for-java/blob/04621e07dbb0456dd5459dd641f06a9fd4f3abad/azure-arm-client-runtime/src/main/java/com/microsoft/azure/arm/utils/Utils.java#L173-L184 | train |
Azure/autorest-clientruntime-for-java | azure-arm-client-runtime/src/main/java/com/microsoft/azure/arm/utils/Utils.java | Utils.removeFromList | public static void removeFromList(List<String> list, String value) {
int foundIndex = -1;
int i = 0;
for (String id : list) {
if (id.equalsIgnoreCase(value)) {
foundIndex = i;
break;
}
i++;
}
if (foundIndex != -1... | java | public static void removeFromList(List<String> list, String value) {
int foundIndex = -1;
int i = 0;
for (String id : list) {
if (id.equalsIgnoreCase(value)) {
foundIndex = i;
break;
}
i++;
}
if (foundIndex != -1... | [
"public",
"static",
"void",
"removeFromList",
"(",
"List",
"<",
"String",
">",
"list",
",",
"String",
"value",
")",
"{",
"int",
"foundIndex",
"=",
"-",
"1",
";",
"int",
"i",
"=",
"0",
";",
"for",
"(",
"String",
"id",
":",
"list",
")",
"{",
"if",
... | Removes a value from the list.
@param list the list
@param value value to remove | [
"Removes",
"a",
"value",
"from",
"the",
"list",
"."
] | 04621e07dbb0456dd5459dd641f06a9fd4f3abad | https://github.com/Azure/autorest-clientruntime-for-java/blob/04621e07dbb0456dd5459dd641f06a9fd4f3abad/azure-arm-client-runtime/src/main/java/com/microsoft/azure/arm/utils/Utils.java#L192-L205 | train |
Azure/autorest-clientruntime-for-java | azure-arm-client-runtime/src/main/java/com/microsoft/azure/arm/utils/PagedListConverter.java | PagedListConverter.convert | public PagedList<V> convert(final PagedList<U> uList) {
if (uList == null || uList.isEmpty()) {
return new PagedList<V>() {
@Override
public Page<V> nextPage(String s) throws RestException, IOException {
return null;
}
}... | java | public PagedList<V> convert(final PagedList<U> uList) {
if (uList == null || uList.isEmpty()) {
return new PagedList<V>() {
@Override
public Page<V> nextPage(String s) throws RestException, IOException {
return null;
}
}... | [
"public",
"PagedList",
"<",
"V",
">",
"convert",
"(",
"final",
"PagedList",
"<",
"U",
">",
"uList",
")",
"{",
"if",
"(",
"uList",
"==",
"null",
"||",
"uList",
".",
"isEmpty",
"(",
")",
")",
"{",
"return",
"new",
"PagedList",
"<",
"V",
">",
"(",
"... | Converts the paged list.
@param uList the resource list to convert from
@return the converted list | [
"Converts",
"the",
"paged",
"list",
"."
] | 04621e07dbb0456dd5459dd641f06a9fd4f3abad | https://github.com/Azure/autorest-clientruntime-for-java/blob/04621e07dbb0456dd5459dd641f06a9fd4f3abad/azure-arm-client-runtime/src/main/java/com/microsoft/azure/arm/utils/PagedListConverter.java#L53-L78 | train |
Azure/autorest-clientruntime-for-java | client-runtime/src/main/java/com/microsoft/rest/interceptors/CustomHeadersInterceptor.java | CustomHeadersInterceptor.replaceHeader | public CustomHeadersInterceptor replaceHeader(String name, String value) {
this.headers.put(name, new ArrayList<String>());
this.headers.get(name).add(value);
return this;
} | java | public CustomHeadersInterceptor replaceHeader(String name, String value) {
this.headers.put(name, new ArrayList<String>());
this.headers.get(name).add(value);
return this;
} | [
"public",
"CustomHeadersInterceptor",
"replaceHeader",
"(",
"String",
"name",
",",
"String",
"value",
")",
"{",
"this",
".",
"headers",
".",
"put",
"(",
"name",
",",
"new",
"ArrayList",
"<",
"String",
">",
"(",
")",
")",
";",
"this",
".",
"headers",
".",... | Add a single header key-value pair. If one with the name already exists,
it gets replaced.
@param name the name of the header.
@param value the value of the header.
@return the interceptor instance itself. | [
"Add",
"a",
"single",
"header",
"key",
"-",
"value",
"pair",
".",
"If",
"one",
"with",
"the",
"name",
"already",
"exists",
"it",
"gets",
"replaced",
"."
] | 04621e07dbb0456dd5459dd641f06a9fd4f3abad | https://github.com/Azure/autorest-clientruntime-for-java/blob/04621e07dbb0456dd5459dd641f06a9fd4f3abad/client-runtime/src/main/java/com/microsoft/rest/interceptors/CustomHeadersInterceptor.java#L64-L68 | train |
Azure/autorest-clientruntime-for-java | client-runtime/src/main/java/com/microsoft/rest/interceptors/CustomHeadersInterceptor.java | CustomHeadersInterceptor.addHeader | public CustomHeadersInterceptor addHeader(String name, String value) {
if (!this.headers.containsKey(name)) {
this.headers.put(name, new ArrayList<String>());
}
this.headers.get(name).add(value);
return this;
} | java | public CustomHeadersInterceptor addHeader(String name, String value) {
if (!this.headers.containsKey(name)) {
this.headers.put(name, new ArrayList<String>());
}
this.headers.get(name).add(value);
return this;
} | [
"public",
"CustomHeadersInterceptor",
"addHeader",
"(",
"String",
"name",
",",
"String",
"value",
")",
"{",
"if",
"(",
"!",
"this",
".",
"headers",
".",
"containsKey",
"(",
"name",
")",
")",
"{",
"this",
".",
"headers",
".",
"put",
"(",
"name",
",",
"n... | Add a single header key-value pair. If one with the name already exists,
both stay in the header map.
@param name the name of the header.
@param value the value of the header.
@return the interceptor instance itself. | [
"Add",
"a",
"single",
"header",
"key",
"-",
"value",
"pair",
".",
"If",
"one",
"with",
"the",
"name",
"already",
"exists",
"both",
"stay",
"in",
"the",
"header",
"map",
"."
] | 04621e07dbb0456dd5459dd641f06a9fd4f3abad | https://github.com/Azure/autorest-clientruntime-for-java/blob/04621e07dbb0456dd5459dd641f06a9fd4f3abad/client-runtime/src/main/java/com/microsoft/rest/interceptors/CustomHeadersInterceptor.java#L78-L84 | train |
Azure/autorest-clientruntime-for-java | client-runtime/src/main/java/com/microsoft/rest/interceptors/CustomHeadersInterceptor.java | CustomHeadersInterceptor.addHeaderMap | public CustomHeadersInterceptor addHeaderMap(Map<String, String> headers) {
for (Map.Entry<String, String> header : headers.entrySet()) {
this.headers.put(header.getKey(), Collections.singletonList(header.getValue()));
}
return this;
} | java | public CustomHeadersInterceptor addHeaderMap(Map<String, String> headers) {
for (Map.Entry<String, String> header : headers.entrySet()) {
this.headers.put(header.getKey(), Collections.singletonList(header.getValue()));
}
return this;
} | [
"public",
"CustomHeadersInterceptor",
"addHeaderMap",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"headers",
")",
"{",
"for",
"(",
"Map",
".",
"Entry",
"<",
"String",
",",
"String",
">",
"header",
":",
"headers",
".",
"entrySet",
"(",
")",
")",
"{",
... | Add all headers in a header map.
@param headers a map of headers.
@return the interceptor instance itself. | [
"Add",
"all",
"headers",
"in",
"a",
"header",
"map",
"."
] | 04621e07dbb0456dd5459dd641f06a9fd4f3abad | https://github.com/Azure/autorest-clientruntime-for-java/blob/04621e07dbb0456dd5459dd641f06a9fd4f3abad/client-runtime/src/main/java/com/microsoft/rest/interceptors/CustomHeadersInterceptor.java#L103-L108 | train |
Azure/autorest-clientruntime-for-java | client-runtime/src/main/java/com/microsoft/rest/interceptors/CustomHeadersInterceptor.java | CustomHeadersInterceptor.addHeaderMultimap | public CustomHeadersInterceptor addHeaderMultimap(Map<String, List<String>> headers) {
this.headers.putAll(headers);
return this;
} | java | public CustomHeadersInterceptor addHeaderMultimap(Map<String, List<String>> headers) {
this.headers.putAll(headers);
return this;
} | [
"public",
"CustomHeadersInterceptor",
"addHeaderMultimap",
"(",
"Map",
"<",
"String",
",",
"List",
"<",
"String",
">",
">",
"headers",
")",
"{",
"this",
".",
"headers",
".",
"putAll",
"(",
"headers",
")",
";",
"return",
"this",
";",
"}"
] | Add all headers in a header multimap.
@param headers a multimap of headers.
@return the interceptor instance itself. | [
"Add",
"all",
"headers",
"in",
"a",
"header",
"multimap",
"."
] | 04621e07dbb0456dd5459dd641f06a9fd4f3abad | https://github.com/Azure/autorest-clientruntime-for-java/blob/04621e07dbb0456dd5459dd641f06a9fd4f3abad/client-runtime/src/main/java/com/microsoft/rest/interceptors/CustomHeadersInterceptor.java#L116-L119 | train |
Azure/autorest-clientruntime-for-java | azure-arm-client-runtime/src/main/java/com/microsoft/azure/arm/utils/RXMapper.java | RXMapper.map | public static <T> Observable<T> map(Observable<?> fromObservable, final T toValue) {
if (fromObservable != null) {
return fromObservable.subscribeOn(Schedulers.io())
.map(new RXMapper<T>(toValue));
} else {
return Observable.empty();
}
} | java | public static <T> Observable<T> map(Observable<?> fromObservable, final T toValue) {
if (fromObservable != null) {
return fromObservable.subscribeOn(Schedulers.io())
.map(new RXMapper<T>(toValue));
} else {
return Observable.empty();
}
} | [
"public",
"static",
"<",
"T",
">",
"Observable",
"<",
"T",
">",
"map",
"(",
"Observable",
"<",
"?",
">",
"fromObservable",
",",
"final",
"T",
"toValue",
")",
"{",
"if",
"(",
"fromObservable",
"!=",
"null",
")",
"{",
"return",
"fromObservable",
".",
"su... | Shortcut for mapping the output of an arbitrary observable to one returning an instance of a specific type, using the IO scheduler.
@param fromObservable the source observable
@param toValue the value to emit to the observer
@param <T> the type of the value to emit
@return an observable emitting the specified value | [
"Shortcut",
"for",
"mapping",
"the",
"output",
"of",
"an",
"arbitrary",
"observable",
"to",
"one",
"returning",
"an",
"instance",
"of",
"a",
"specific",
"type",
"using",
"the",
"IO",
"scheduler",
"."
] | 04621e07dbb0456dd5459dd641f06a9fd4f3abad | https://github.com/Azure/autorest-clientruntime-for-java/blob/04621e07dbb0456dd5459dd641f06a9fd4f3abad/azure-arm-client-runtime/src/main/java/com/microsoft/azure/arm/utils/RXMapper.java#L28-L35 | train |
Azure/autorest-clientruntime-for-java | azure-arm-client-runtime/src/main/java/com/microsoft/azure/arm/utils/RXMapper.java | RXMapper.mapToVoid | public static Observable<Void> mapToVoid(Observable<?> fromObservable) {
if (fromObservable != null) {
return fromObservable.subscribeOn(Schedulers.io())
.map(new RXMapper<Void>());
} else {
return Observable.empty();
}
} | java | public static Observable<Void> mapToVoid(Observable<?> fromObservable) {
if (fromObservable != null) {
return fromObservable.subscribeOn(Schedulers.io())
.map(new RXMapper<Void>());
} else {
return Observable.empty();
}
} | [
"public",
"static",
"Observable",
"<",
"Void",
">",
"mapToVoid",
"(",
"Observable",
"<",
"?",
">",
"fromObservable",
")",
"{",
"if",
"(",
"fromObservable",
"!=",
"null",
")",
"{",
"return",
"fromObservable",
".",
"subscribeOn",
"(",
"Schedulers",
".",
"io",
... | Shortcut for mapping an arbitrary observable to void, using the IO scheduler.
@param fromObservable the source observable
@return a void-emitting observable | [
"Shortcut",
"for",
"mapping",
"an",
"arbitrary",
"observable",
"to",
"void",
"using",
"the",
"IO",
"scheduler",
"."
] | 04621e07dbb0456dd5459dd641f06a9fd4f3abad | https://github.com/Azure/autorest-clientruntime-for-java/blob/04621e07dbb0456dd5459dd641f06a9fd4f3abad/azure-arm-client-runtime/src/main/java/com/microsoft/azure/arm/utils/RXMapper.java#L42-L49 | train |
Azure/autorest-clientruntime-for-java | azure-arm-client-runtime/src/main/java/com/microsoft/azure/arm/resources/models/implementation/ResourceImpl.java | ResourceImpl.withTag | @SuppressWarnings("unchecked")
public final FluentModelImplT withTag(String key, String value) {
if (this.inner().getTags() == null) {
this.inner().withTags(new HashMap<String, String>());
}
this.inner().getTags().put(key, value);
return (FluentModelImplT) this;
} | java | @SuppressWarnings("unchecked")
public final FluentModelImplT withTag(String key, String value) {
if (this.inner().getTags() == null) {
this.inner().withTags(new HashMap<String, String>());
}
this.inner().getTags().put(key, value);
return (FluentModelImplT) this;
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"final",
"FluentModelImplT",
"withTag",
"(",
"String",
"key",
",",
"String",
"value",
")",
"{",
"if",
"(",
"this",
".",
"inner",
"(",
")",
".",
"getTags",
"(",
")",
"==",
"null",
")",
"{",
"... | Adds a tag to the resource.
@param key the key for the tag
@param value the value for the tag
@return the next stage of the definition/update | [
"Adds",
"a",
"tag",
"to",
"the",
"resource",
"."
] | 04621e07dbb0456dd5459dd641f06a9fd4f3abad | https://github.com/Azure/autorest-clientruntime-for-java/blob/04621e07dbb0456dd5459dd641f06a9fd4f3abad/azure-arm-client-runtime/src/main/java/com/microsoft/azure/arm/resources/models/implementation/ResourceImpl.java#L109-L116 | train |
Azure/autorest-clientruntime-for-java | azure-arm-client-runtime/src/main/java/com/microsoft/azure/arm/resources/models/implementation/ResourceImpl.java | ResourceImpl.withoutTag | @SuppressWarnings("unchecked")
public final FluentModelImplT withoutTag(String key) {
if (this.inner().getTags() != null) {
this.inner().getTags().remove(key);
}
return (FluentModelImplT) this;
} | java | @SuppressWarnings("unchecked")
public final FluentModelImplT withoutTag(String key) {
if (this.inner().getTags() != null) {
this.inner().getTags().remove(key);
}
return (FluentModelImplT) this;
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"final",
"FluentModelImplT",
"withoutTag",
"(",
"String",
"key",
")",
"{",
"if",
"(",
"this",
".",
"inner",
"(",
")",
".",
"getTags",
"(",
")",
"!=",
"null",
")",
"{",
"this",
".",
"inner",
... | Removes a tag from the resource.
@param key the key of the tag to remove
@return the next stage of the definition/update | [
"Removes",
"a",
"tag",
"from",
"the",
"resource",
"."
] | 04621e07dbb0456dd5459dd641f06a9fd4f3abad | https://github.com/Azure/autorest-clientruntime-for-java/blob/04621e07dbb0456dd5459dd641f06a9fd4f3abad/azure-arm-client-runtime/src/main/java/com/microsoft/azure/arm/resources/models/implementation/ResourceImpl.java#L123-L129 | train |
Azure/autorest-clientruntime-for-java | azure-client-runtime/src/main/java/com/microsoft/azure/ListOperationCallback.java | ListOperationCallback.load | public void load(List<E> result) {
++pageCount;
if (this.result == null || this.result.isEmpty()) {
this.result = result;
} else {
this.result.addAll(result);
}
} | java | public void load(List<E> result) {
++pageCount;
if (this.result == null || this.result.isEmpty()) {
this.result = result;
} else {
this.result.addAll(result);
}
} | [
"public",
"void",
"load",
"(",
"List",
"<",
"E",
">",
"result",
")",
"{",
"++",
"pageCount",
";",
"if",
"(",
"this",
".",
"result",
"==",
"null",
"||",
"this",
".",
"result",
".",
"isEmpty",
"(",
")",
")",
"{",
"this",
".",
"result",
"=",
"result... | This method is called by the client to load the most recent list of resources.
This method should only be called by the service client.
@param result the most recent list of resources. | [
"This",
"method",
"is",
"called",
"by",
"the",
"client",
"to",
"load",
"the",
"most",
"recent",
"list",
"of",
"resources",
".",
"This",
"method",
"should",
"only",
"be",
"called",
"by",
"the",
"service",
"client",
"."
] | 04621e07dbb0456dd5459dd641f06a9fd4f3abad | https://github.com/Azure/autorest-clientruntime-for-java/blob/04621e07dbb0456dd5459dd641f06a9fd4f3abad/azure-client-runtime/src/main/java/com/microsoft/azure/ListOperationCallback.java#L62-L69 | train |
Azure/autorest-clientruntime-for-java | azure-arm-client-runtime/src/main/java/com/microsoft/azure/arm/utils/DelayProvider.java | DelayProvider.delayedEmitAsync | public <T> Observable<T> delayedEmitAsync(T event, int milliseconds) {
return Observable.just(event).delay(milliseconds, TimeUnit.MILLISECONDS, Schedulers.immediate());
} | java | public <T> Observable<T> delayedEmitAsync(T event, int milliseconds) {
return Observable.just(event).delay(milliseconds, TimeUnit.MILLISECONDS, Schedulers.immediate());
} | [
"public",
"<",
"T",
">",
"Observable",
"<",
"T",
">",
"delayedEmitAsync",
"(",
"T",
"event",
",",
"int",
"milliseconds",
")",
"{",
"return",
"Observable",
".",
"just",
"(",
"event",
")",
".",
"delay",
"(",
"milliseconds",
",",
"TimeUnit",
".",
"MILLISECO... | Creates an observable that emits the given item after the specified time in milliseconds.
@param event the event to emit
@param milliseconds the delay in milliseconds
@param <T> the type of event
@return delayed observable | [
"Creates",
"an",
"observable",
"that",
"emits",
"the",
"given",
"item",
"after",
"the",
"specified",
"time",
"in",
"milliseconds",
"."
] | 04621e07dbb0456dd5459dd641f06a9fd4f3abad | https://github.com/Azure/autorest-clientruntime-for-java/blob/04621e07dbb0456dd5459dd641f06a9fd4f3abad/azure-arm-client-runtime/src/main/java/com/microsoft/azure/arm/utils/DelayProvider.java#L37-L39 | train |
Azure/autorest-clientruntime-for-java | azure-arm-client-runtime/src/main/java/com/microsoft/azure/arm/utils/SdkContext.java | SdkContext.randomResourceNames | public static String[] randomResourceNames(String prefix, int maxLen, int count) {
String[] names = new String[count];
ResourceNamer resourceNamer = SdkContext.getResourceNamerFactory().createResourceNamer("");
for (int i = 0; i < count; i++) {
names[i] = resourceNamer.randomName(pre... | java | public static String[] randomResourceNames(String prefix, int maxLen, int count) {
String[] names = new String[count];
ResourceNamer resourceNamer = SdkContext.getResourceNamerFactory().createResourceNamer("");
for (int i = 0; i < count; i++) {
names[i] = resourceNamer.randomName(pre... | [
"public",
"static",
"String",
"[",
"]",
"randomResourceNames",
"(",
"String",
"prefix",
",",
"int",
"maxLen",
",",
"int",
"count",
")",
"{",
"String",
"[",
"]",
"names",
"=",
"new",
"String",
"[",
"count",
"]",
";",
"ResourceNamer",
"resourceNamer",
"=",
... | Generates the specified number of random resource names with the same prefix.
@param prefix the prefix to be used if possible
@param maxLen the maximum length for the random generated name
@param count the number of names to generate
@return random names | [
"Generates",
"the",
"specified",
"number",
"of",
"random",
"resource",
"names",
"with",
"the",
"same",
"prefix",
"."
] | 04621e07dbb0456dd5459dd641f06a9fd4f3abad | https://github.com/Azure/autorest-clientruntime-for-java/blob/04621e07dbb0456dd5459dd641f06a9fd4f3abad/azure-arm-client-runtime/src/main/java/com/microsoft/azure/arm/utils/SdkContext.java#L57-L64 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.