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
dashbuilder/dashbuilder
dashbuilder-client/dashbuilder-widgets/src/main/java/org/dashbuilder/client/widgets/dataset/editor/DataSetDefPreviewTable.java
DataSetDefPreviewTable.draw
void draw(final DisplayerListener displayerListener) { tableDisplayer.addListener(displayerListener); view.setDisplayer(tableDisplayer); tableDisplayer.draw(); }
java
void draw(final DisplayerListener displayerListener) { tableDisplayer.addListener(displayerListener); view.setDisplayer(tableDisplayer); tableDisplayer.draw(); }
[ "void", "draw", "(", "final", "DisplayerListener", "displayerListener", ")", "{", "tableDisplayer", ".", "addListener", "(", "displayerListener", ")", ";", "view", ".", "setDisplayer", "(", "tableDisplayer", ")", ";", "tableDisplayer", ".", "draw", "(", ")", ";"...
Show the table displayer.
[ "Show", "the", "table", "displayer", "." ]
50ef88210726b4f2f33f1a82eaf0f542e38dedd9
https://github.com/dashbuilder/dashbuilder/blob/50ef88210726b4f2f33f1a82eaf0f542e38dedd9/dashbuilder-client/dashbuilder-widgets/src/main/java/org/dashbuilder/client/widgets/dataset/editor/DataSetDefPreviewTable.java#L158-L162
train
dashbuilder/dashbuilder
dashbuilder-client/dashbuilder-navigation-client/src/main/java/org/dashbuilder/client/navigation/plugin/PerspectivePluginManager.java
PerspectivePluginManager.onPlugInAdded
public void onPlugInAdded(@Observes final PluginAdded event) { Plugin plugin = event.getPlugin(); if (isRuntimePerspective(plugin)) { pluginMap.put(plugin.getName(), plugin); perspectivesChangedEvent.fire(new PerspectivePluginsChangedEvent()); } }
java
public void onPlugInAdded(@Observes final PluginAdded event) { Plugin plugin = event.getPlugin(); if (isRuntimePerspective(plugin)) { pluginMap.put(plugin.getName(), plugin); perspectivesChangedEvent.fire(new PerspectivePluginsChangedEvent()); } }
[ "public", "void", "onPlugInAdded", "(", "@", "Observes", "final", "PluginAdded", "event", ")", "{", "Plugin", "plugin", "=", "event", ".", "getPlugin", "(", ")", ";", "if", "(", "isRuntimePerspective", "(", "plugin", ")", ")", "{", "pluginMap", ".", "put",...
Sync up both the internals plugin & widget registry
[ "Sync", "up", "both", "the", "internals", "plugin", "&", "widget", "registry" ]
50ef88210726b4f2f33f1a82eaf0f542e38dedd9
https://github.com/dashbuilder/dashbuilder/blob/50ef88210726b4f2f33f1a82eaf0f542e38dedd9/dashbuilder-client/dashbuilder-navigation-client/src/main/java/org/dashbuilder/client/navigation/plugin/PerspectivePluginManager.java#L180-L186
train
dashbuilder/dashbuilder
dashbuilder-client/dashbuilder-widgets/src/main/java/org/dashbuilder/client/widgets/dataset/editor/workflow/DataSetEditorWorkflowFactory.java
DataSetEditorWorkflowFactory.edit
public DataSetEditWorkflow edit(final DataSetProviderType type) { final boolean isSQL = type != null && DataSetProviderType.SQL.equals(type); final boolean isBean = type != null && DataSetProviderType.BEAN.equals(type); final boolean isCSV = type != null && DataSetProviderType.CSV.equals(type); ...
java
public DataSetEditWorkflow edit(final DataSetProviderType type) { final boolean isSQL = type != null && DataSetProviderType.SQL.equals(type); final boolean isBean = type != null && DataSetProviderType.BEAN.equals(type); final boolean isCSV = type != null && DataSetProviderType.CSV.equals(type); ...
[ "public", "DataSetEditWorkflow", "edit", "(", "final", "DataSetProviderType", "type", ")", "{", "final", "boolean", "isSQL", "=", "type", "!=", "null", "&&", "DataSetProviderType", ".", "SQL", ".", "equals", "(", "type", ")", ";", "final", "boolean", "isBean",...
Obtain the bean for editing a data set definition for a given type. @param type The data set definition provider type to edit. @return The workflow instance.
[ "Obtain", "the", "bean", "for", "editing", "a", "data", "set", "definition", "for", "a", "given", "type", "." ]
50ef88210726b4f2f33f1a82eaf0f542e38dedd9
https://github.com/dashbuilder/dashbuilder/blob/50ef88210726b4f2f33f1a82eaf0f542e38dedd9/dashbuilder-client/dashbuilder-widgets/src/main/java/org/dashbuilder/client/widgets/dataset/editor/workflow/DataSetEditorWorkflowFactory.java#L35-L51
train
dashbuilder/dashbuilder
dashbuilder-client/dashbuilder-common-client/src/main/java/org/dashbuilder/common/client/StringUtils.java
StringUtils.join
public static String join(Collection strings, String delimiter) { StringBuilder builder = new StringBuilder(); Iterator<String> iter = strings.iterator(); while (iter.hasNext()) { builder.append(iter.next()); if (!iter.hasNext()) { break; } ...
java
public static String join(Collection strings, String delimiter) { StringBuilder builder = new StringBuilder(); Iterator<String> iter = strings.iterator(); while (iter.hasNext()) { builder.append(iter.next()); if (!iter.hasNext()) { break; } ...
[ "public", "static", "String", "join", "(", "Collection", "strings", ",", "String", "delimiter", ")", "{", "StringBuilder", "builder", "=", "new", "StringBuilder", "(", ")", ";", "Iterator", "<", "String", ">", "iter", "=", "strings", ".", "iterator", "(", ...
Joins a collection of string with a given delimiter. @param strings The collection of strings to join. @param delimiter The delimiter to use to join them. @return The string built by joining the string with the delimiter.
[ "Joins", "a", "collection", "of", "string", "with", "a", "given", "delimiter", "." ]
50ef88210726b4f2f33f1a82eaf0f542e38dedd9
https://github.com/dashbuilder/dashbuilder/blob/50ef88210726b4f2f33f1a82eaf0f542e38dedd9/dashbuilder-client/dashbuilder-common-client/src/main/java/org/dashbuilder/common/client/StringUtils.java#L120-L131
train
dashbuilder/dashbuilder
dashbuilder-client/dashbuilder-displayer-client/src/main/java/org/dashbuilder/displayer/client/AbstractDisplayer.java
AbstractDisplayer.draw
@Override public void draw() { if (displayerSettings == null) { getView().errorMissingSettings(); } else if (dataSetHandler == null) { getView().errorMissingHandler(); } else if (!isDrawn()) { try { drawn = true; ...
java
@Override public void draw() { if (displayerSettings == null) { getView().errorMissingSettings(); } else if (dataSetHandler == null) { getView().errorMissingHandler(); } else if (!isDrawn()) { try { drawn = true; ...
[ "@", "Override", "public", "void", "draw", "(", ")", "{", "if", "(", "displayerSettings", "==", "null", ")", "{", "getView", "(", ")", ".", "errorMissingSettings", "(", ")", ";", "}", "else", "if", "(", "dataSetHandler", "==", "null", ")", "{", "getVie...
Draw the displayer by executing first the lookup call to retrieve the target data set
[ "Draw", "the", "displayer", "by", "executing", "first", "the", "lookup", "call", "to", "retrieve", "the", "target", "data", "set" ]
50ef88210726b4f2f33f1a82eaf0f542e38dedd9
https://github.com/dashbuilder/dashbuilder/blob/50ef88210726b4f2f33f1a82eaf0f542e38dedd9/dashbuilder-client/dashbuilder-displayer-client/src/main/java/org/dashbuilder/displayer/client/AbstractDisplayer.java#L234-L285
train
dashbuilder/dashbuilder
dashbuilder-client/dashbuilder-displayer-client/src/main/java/org/dashbuilder/displayer/client/AbstractDisplayer.java
AbstractDisplayer.redraw
@Override public void redraw() { if (!isDrawn()) { draw(); } else { try { beforeLoad(); beforeDataSetLookup(); dataSetHandler.lookupDataSet(new DataSetReadyCallback() { public void callback(DataSet result) { ...
java
@Override public void redraw() { if (!isDrawn()) { draw(); } else { try { beforeLoad(); beforeDataSetLookup(); dataSetHandler.lookupDataSet(new DataSetReadyCallback() { public void callback(DataSet result) { ...
[ "@", "Override", "public", "void", "redraw", "(", ")", "{", "if", "(", "!", "isDrawn", "(", ")", ")", "{", "draw", "(", ")", ";", "}", "else", "{", "try", "{", "beforeLoad", "(", ")", ";", "beforeDataSetLookup", "(", ")", ";", "dataSetHandler", "."...
Just reload the data set and make the current displayer to redraw.
[ "Just", "reload", "the", "data", "set", "and", "make", "the", "current", "displayer", "to", "redraw", "." ]
50ef88210726b4f2f33f1a82eaf0f542e38dedd9
https://github.com/dashbuilder/dashbuilder/blob/50ef88210726b4f2f33f1a82eaf0f542e38dedd9/dashbuilder-client/dashbuilder-displayer-client/src/main/java/org/dashbuilder/displayer/client/AbstractDisplayer.java#L290-L328
train
dashbuilder/dashbuilder
dashbuilder-client/dashbuilder-displayer-client/src/main/java/org/dashbuilder/displayer/client/AbstractDisplayer.java
AbstractDisplayer.filterIntervals
public List<Interval> filterIntervals(String columnId) { List<Interval> selected = columnSelectionMap.get(columnId); if (selected == null) { return new ArrayList<>(); } return selected; }
java
public List<Interval> filterIntervals(String columnId) { List<Interval> selected = columnSelectionMap.get(columnId); if (selected == null) { return new ArrayList<>(); } return selected; }
[ "public", "List", "<", "Interval", ">", "filterIntervals", "(", "String", "columnId", ")", "{", "List", "<", "Interval", ">", "selected", "=", "columnSelectionMap", ".", "get", "(", "columnId", ")", ";", "if", "(", "selected", "==", "null", ")", "{", "re...
Get the current filter intervals for the given data set column. @param columnId The column identifier. @return A list of intervals.
[ "Get", "the", "current", "filter", "intervals", "for", "the", "given", "data", "set", "column", "." ]
50ef88210726b4f2f33f1a82eaf0f542e38dedd9
https://github.com/dashbuilder/dashbuilder/blob/50ef88210726b4f2f33f1a82eaf0f542e38dedd9/dashbuilder-client/dashbuilder-displayer-client/src/main/java/org/dashbuilder/displayer/client/AbstractDisplayer.java#L538-L544
train
dashbuilder/dashbuilder
dashbuilder-client/dashbuilder-displayer-client/src/main/java/org/dashbuilder/displayer/client/AbstractDisplayer.java
AbstractDisplayer.filterInterval
public Interval filterInterval(String columnId, int idx) { List<Interval> selected = columnSelectionMap.get(columnId); if (selected != null && !selected.isEmpty()) { for (Interval interval : selected) { if (interval.getIndex() == idx) { return interval; ...
java
public Interval filterInterval(String columnId, int idx) { List<Interval> selected = columnSelectionMap.get(columnId); if (selected != null && !selected.isEmpty()) { for (Interval interval : selected) { if (interval.getIndex() == idx) { return interval; ...
[ "public", "Interval", "filterInterval", "(", "String", "columnId", ",", "int", "idx", ")", "{", "List", "<", "Interval", ">", "selected", "=", "columnSelectionMap", ".", "get", "(", "columnId", ")", ";", "if", "(", "selected", "!=", "null", "&&", "!", "s...
Get the current filter interval matching the specified index @param columnId The column identifier. @param idx The index of the interval @return The target interval matching the specified parameters or null if it does not exist.
[ "Get", "the", "current", "filter", "interval", "matching", "the", "specified", "index" ]
50ef88210726b4f2f33f1a82eaf0f542e38dedd9
https://github.com/dashbuilder/dashbuilder/blob/50ef88210726b4f2f33f1a82eaf0f542e38dedd9/dashbuilder-client/dashbuilder-displayer-client/src/main/java/org/dashbuilder/displayer/client/AbstractDisplayer.java#L553-L563
train
dashbuilder/dashbuilder
dashbuilder-client/dashbuilder-displayer-client/src/main/java/org/dashbuilder/displayer/client/AbstractDisplayer.java
AbstractDisplayer.filterIndexes
public List<Integer> filterIndexes(String columnId) { List<Integer> result = new ArrayList<>(); List<Interval> selected = columnSelectionMap.get(columnId); if (selected == null) { return result; } for (Interval interval : selected) { result.add(interval.ge...
java
public List<Integer> filterIndexes(String columnId) { List<Integer> result = new ArrayList<>(); List<Interval> selected = columnSelectionMap.get(columnId); if (selected == null) { return result; } for (Interval interval : selected) { result.add(interval.ge...
[ "public", "List", "<", "Integer", ">", "filterIndexes", "(", "String", "columnId", ")", "{", "List", "<", "Integer", ">", "result", "=", "new", "ArrayList", "<>", "(", ")", ";", "List", "<", "Interval", ">", "selected", "=", "columnSelectionMap", ".", "g...
Get the current filter selected interval indexes for the given data set column. @param columnId The column identifier. @return A list of interval indexes
[ "Get", "the", "current", "filter", "selected", "interval", "indexes", "for", "the", "given", "data", "set", "column", "." ]
50ef88210726b4f2f33f1a82eaf0f542e38dedd9
https://github.com/dashbuilder/dashbuilder/blob/50ef88210726b4f2f33f1a82eaf0f542e38dedd9/dashbuilder-client/dashbuilder-displayer-client/src/main/java/org/dashbuilder/displayer/client/AbstractDisplayer.java#L571-L581
train
dashbuilder/dashbuilder
dashbuilder-client/dashbuilder-displayer-client/src/main/java/org/dashbuilder/displayer/client/AbstractDisplayer.java
AbstractDisplayer.filterUpdate
public void filterUpdate(String columnId, int row, Integer maxSelections) { if (displayerSettings.isFilterEnabled()) { List<Interval> selectedIntervals = columnSelectionMap.get(columnId); Interval intervalFiltered = filterInterval(columnId, row); // Existing interval reset ...
java
public void filterUpdate(String columnId, int row, Integer maxSelections) { if (displayerSettings.isFilterEnabled()) { List<Interval> selectedIntervals = columnSelectionMap.get(columnId); Interval intervalFiltered = filterInterval(columnId, row); // Existing interval reset ...
[ "public", "void", "filterUpdate", "(", "String", "columnId", ",", "int", "row", ",", "Integer", "maxSelections", ")", "{", "if", "(", "displayerSettings", ".", "isFilterEnabled", "(", ")", ")", "{", "List", "<", "Interval", ">", "selectedIntervals", "=", "co...
Updates the current filter values for the given data set column. @param columnId The column to filter for. @param row The row selected. @param maxSelections The number of different selectable values available.
[ "Updates", "the", "current", "filter", "values", "for", "the", "given", "data", "set", "column", "." ]
50ef88210726b4f2f33f1a82eaf0f542e38dedd9
https://github.com/dashbuilder/dashbuilder/blob/50ef88210726b4f2f33f1a82eaf0f542e38dedd9/dashbuilder-client/dashbuilder-displayer-client/src/main/java/org/dashbuilder/displayer/client/AbstractDisplayer.java#L600-L643
train
dashbuilder/dashbuilder
dashbuilder-client/dashbuilder-displayer-client/src/main/java/org/dashbuilder/displayer/client/AbstractDisplayer.java
AbstractDisplayer.filterApply
public void filterApply(String columnId, List<Interval> intervalList) { if (displayerSettings.isFilterEnabled()) { // For string column filters, init the group interval selection operation. DataSetGroup groupOp = dataSetHandler.getGroupOperation(columnId); groupOp.setSelecte...
java
public void filterApply(String columnId, List<Interval> intervalList) { if (displayerSettings.isFilterEnabled()) { // For string column filters, init the group interval selection operation. DataSetGroup groupOp = dataSetHandler.getGroupOperation(columnId); groupOp.setSelecte...
[ "public", "void", "filterApply", "(", "String", "columnId", ",", "List", "<", "Interval", ">", "intervalList", ")", "{", "if", "(", "displayerSettings", ".", "isFilterEnabled", "(", ")", ")", "{", "// For string column filters, init the group interval selection operatio...
Filter the values of the given column. @param columnId The name of the column to filter. @param intervalList A list of interval selections to filter for.
[ "Filter", "the", "values", "of", "the", "given", "column", "." ]
50ef88210726b4f2f33f1a82eaf0f542e38dedd9
https://github.com/dashbuilder/dashbuilder/blob/50ef88210726b4f2f33f1a82eaf0f542e38dedd9/dashbuilder-client/dashbuilder-displayer-client/src/main/java/org/dashbuilder/displayer/client/AbstractDisplayer.java#L651-L670
train
dashbuilder/dashbuilder
dashbuilder-client/dashbuilder-displayer-client/src/main/java/org/dashbuilder/displayer/client/AbstractDisplayer.java
AbstractDisplayer.filterApply
public void filterApply(DataSetFilter filter) { if (displayerSettings.isFilterEnabled()) { this.currentFilter = filter; // Notify to those interested parties the selection event. if (displayerSettings.isFilterNotificationEnabled()) { for (DisplayerListener l...
java
public void filterApply(DataSetFilter filter) { if (displayerSettings.isFilterEnabled()) { this.currentFilter = filter; // Notify to those interested parties the selection event. if (displayerSettings.isFilterNotificationEnabled()) { for (DisplayerListener l...
[ "public", "void", "filterApply", "(", "DataSetFilter", "filter", ")", "{", "if", "(", "displayerSettings", ".", "isFilterEnabled", "(", ")", ")", "{", "this", ".", "currentFilter", "=", "filter", ";", "// Notify to those interested parties the selection event.", "if",...
Apply the given filter @param filter A filter
[ "Apply", "the", "given", "filter" ]
50ef88210726b4f2f33f1a82eaf0f542e38dedd9
https://github.com/dashbuilder/dashbuilder/blob/50ef88210726b4f2f33f1a82eaf0f542e38dedd9/dashbuilder-client/dashbuilder-displayer-client/src/main/java/org/dashbuilder/displayer/client/AbstractDisplayer.java#L677-L694
train
dashbuilder/dashbuilder
dashbuilder-client/dashbuilder-displayer-client/src/main/java/org/dashbuilder/displayer/client/AbstractDisplayer.java
AbstractDisplayer.filterUpdate
public void filterUpdate(DataSetFilter filter) { if (displayerSettings.isFilterEnabled()) { DataSetFilter oldFilter = currentFilter; this.currentFilter = filter; // Notify to those interested parties the selection event. if (displayerSettings.isFilterNotificatio...
java
public void filterUpdate(DataSetFilter filter) { if (displayerSettings.isFilterEnabled()) { DataSetFilter oldFilter = currentFilter; this.currentFilter = filter; // Notify to those interested parties the selection event. if (displayerSettings.isFilterNotificatio...
[ "public", "void", "filterUpdate", "(", "DataSetFilter", "filter", ")", "{", "if", "(", "displayerSettings", ".", "isFilterEnabled", "(", ")", ")", "{", "DataSetFilter", "oldFilter", "=", "currentFilter", ";", "this", ".", "currentFilter", "=", "filter", ";", "...
Updates the current filter values for the given data set column. Any previous filter is reset. @param filter A filter
[ "Updates", "the", "current", "filter", "values", "for", "the", "given", "data", "set", "column", ".", "Any", "previous", "filter", "is", "reset", "." ]
50ef88210726b4f2f33f1a82eaf0f542e38dedd9
https://github.com/dashbuilder/dashbuilder/blob/50ef88210726b4f2f33f1a82eaf0f542e38dedd9/dashbuilder-client/dashbuilder-displayer-client/src/main/java/org/dashbuilder/displayer/client/AbstractDisplayer.java#L701-L720
train
dashbuilder/dashbuilder
dashbuilder-client/dashbuilder-displayer-client/src/main/java/org/dashbuilder/displayer/client/AbstractDisplayer.java
AbstractDisplayer.filterReset
public void filterReset(String columnId) { if (displayerSettings.isFilterEnabled()) { columnSelectionMap.remove(columnId); DataSetGroup groupOp = dataSetHandler.getGroupOperation(columnId); // Notify to those interested parties the reset event. if (displayerSett...
java
public void filterReset(String columnId) { if (displayerSettings.isFilterEnabled()) { columnSelectionMap.remove(columnId); DataSetGroup groupOp = dataSetHandler.getGroupOperation(columnId); // Notify to those interested parties the reset event. if (displayerSett...
[ "public", "void", "filterReset", "(", "String", "columnId", ")", "{", "if", "(", "displayerSettings", ".", "isFilterEnabled", "(", ")", ")", "{", "columnSelectionMap", ".", "remove", "(", "columnId", ")", ";", "DataSetGroup", "groupOp", "=", "dataSetHandler", ...
Clear any filter on the given column. @param columnId The name of the column to reset.
[ "Clear", "any", "filter", "on", "the", "given", "column", "." ]
50ef88210726b4f2f33f1a82eaf0f542e38dedd9
https://github.com/dashbuilder/dashbuilder/blob/50ef88210726b4f2f33f1a82eaf0f542e38dedd9/dashbuilder-client/dashbuilder-displayer-client/src/main/java/org/dashbuilder/displayer/client/AbstractDisplayer.java#L727-L745
train
dashbuilder/dashbuilder
dashbuilder-client/dashbuilder-displayer-client/src/main/java/org/dashbuilder/displayer/client/AbstractDisplayer.java
AbstractDisplayer.filterReset
public void filterReset() { if (displayerSettings.isFilterEnabled()) { List<DataSetGroup> groupOpList = new ArrayList<DataSetGroup>(); for (String columnId : columnSelectionMap.keySet()) { DataSetGroup groupOp = dataSetHandler.getGroupOperation(columnId); ...
java
public void filterReset() { if (displayerSettings.isFilterEnabled()) { List<DataSetGroup> groupOpList = new ArrayList<DataSetGroup>(); for (String columnId : columnSelectionMap.keySet()) { DataSetGroup groupOp = dataSetHandler.getGroupOperation(columnId); ...
[ "public", "void", "filterReset", "(", ")", "{", "if", "(", "displayerSettings", ".", "isFilterEnabled", "(", ")", ")", "{", "List", "<", "DataSetGroup", ">", "groupOpList", "=", "new", "ArrayList", "<", "DataSetGroup", ">", "(", ")", ";", "for", "(", "St...
Clear any filter.
[ "Clear", "any", "filter", "." ]
50ef88210726b4f2f33f1a82eaf0f542e38dedd9
https://github.com/dashbuilder/dashbuilder/blob/50ef88210726b4f2f33f1a82eaf0f542e38dedd9/dashbuilder-client/dashbuilder-displayer-client/src/main/java/org/dashbuilder/displayer/client/AbstractDisplayer.java#L750-L792
train
dashbuilder/dashbuilder
dashbuilder-webapp/src/main/java/org/dashbuilder/client/ShowcaseEntryPoint.java
ShowcaseEntryPoint.hideLoadingPopup
private void hideLoadingPopup() { final Element e = RootPanel.get("loading").getElement(); new Animation() { @Override protected void onUpdate( double progress ) { e.getStyle().setOpacity( 1.0 - progress ); } @Override protec...
java
private void hideLoadingPopup() { final Element e = RootPanel.get("loading").getElement(); new Animation() { @Override protected void onUpdate( double progress ) { e.getStyle().setOpacity( 1.0 - progress ); } @Override protec...
[ "private", "void", "hideLoadingPopup", "(", ")", "{", "final", "Element", "e", "=", "RootPanel", ".", "get", "(", "\"loading\"", ")", ".", "getElement", "(", ")", ";", "new", "Animation", "(", ")", "{", "@", "Override", "protected", "void", "onUpdate", "...
Fade out the "Loading application" pop-up
[ "Fade", "out", "the", "Loading", "application", "pop", "-", "up" ]
50ef88210726b4f2f33f1a82eaf0f542e38dedd9
https://github.com/dashbuilder/dashbuilder/blob/50ef88210726b4f2f33f1a82eaf0f542e38dedd9/dashbuilder-webapp/src/main/java/org/dashbuilder/client/ShowcaseEntryPoint.java#L149-L164
train
dashbuilder/dashbuilder
dashbuilder-client/dashbuilder-renderers/dashbuilder-renderer-chartjs/src/main/java/org/dashbuilder/renderer/chartjs/lib/Chart.java
Chart.getSnapshot
public Image getSnapshot(){ String code= getBase64Image(nativeCanvas); if(code == null) return null; Image image = new Image(code); return image; }
java
public Image getSnapshot(){ String code= getBase64Image(nativeCanvas); if(code == null) return null; Image image = new Image(code); return image; }
[ "public", "Image", "getSnapshot", "(", ")", "{", "String", "code", "=", "getBase64Image", "(", "nativeCanvas", ")", ";", "if", "(", "code", "==", "null", ")", "return", "null", ";", "Image", "image", "=", "new", "Image", "(", "code", ")", ";", "return"...
Creates snapshot of current state of chart as image @return Image object or null if Chart not rendered (or in progress)
[ "Creates", "snapshot", "of", "current", "state", "of", "chart", "as", "image" ]
50ef88210726b4f2f33f1a82eaf0f542e38dedd9
https://github.com/dashbuilder/dashbuilder/blob/50ef88210726b4f2f33f1a82eaf0f542e38dedd9/dashbuilder-client/dashbuilder-renderers/dashbuilder-renderer-chartjs/src/main/java/org/dashbuilder/renderer/chartjs/lib/Chart.java#L155-L161
train
dashbuilder/dashbuilder
dashbuilder-webapp/src/main/java/org/dashbuilder/backend/ClusterMetricsGenerator.java
ClusterMetricsGenerator.printDataSet
protected static void printDataSet(DataSet dataSet) { final String SPACER = "| \t |"; if (dataSet == null) System.out.println("DataSet is null"); if (dataSet.getRowCount() == 0) System.out.println("DataSet is empty"); List<DataColumn> dataSetColumns = dataSet.getColumns(); int ...
java
protected static void printDataSet(DataSet dataSet) { final String SPACER = "| \t |"; if (dataSet == null) System.out.println("DataSet is null"); if (dataSet.getRowCount() == 0) System.out.println("DataSet is empty"); List<DataColumn> dataSetColumns = dataSet.getColumns(); int ...
[ "protected", "static", "void", "printDataSet", "(", "DataSet", "dataSet", ")", "{", "final", "String", "SPACER", "=", "\"| \\t |\"", ";", "if", "(", "dataSet", "==", "null", ")", "System", ".", "out", ".", "println", "(", "\"DataSet is null\"", ")", ";", "...
Helper method to print to standard output the dataset values.
[ "Helper", "method", "to", "print", "to", "standard", "output", "the", "dataset", "values", "." ]
50ef88210726b4f2f33f1a82eaf0f542e38dedd9
https://github.com/dashbuilder/dashbuilder/blob/50ef88210726b4f2f33f1a82eaf0f542e38dedd9/dashbuilder-webapp/src/main/java/org/dashbuilder/backend/ClusterMetricsGenerator.java#L307-L329
train
dashbuilder/dashbuilder
dashbuilder-client/dashbuilder-renderers/dashbuilder-renderer-google/src/main/java/org/dashbuilder/renderer/google/client/GoogleRenderer.java
GoogleRenderer.draw
public void draw(final List<Displayer> displayerList) { // Get the modules to load. Set<ChartPackage> packageList = EnumSet.noneOf(ChartPackage.class); for (Displayer displayer : displayerList) { try { GoogleDisplayer googleDisplayer = (GoogleDisplayer) displayer; ...
java
public void draw(final List<Displayer> displayerList) { // Get the modules to load. Set<ChartPackage> packageList = EnumSet.noneOf(ChartPackage.class); for (Displayer displayer : displayerList) { try { GoogleDisplayer googleDisplayer = (GoogleDisplayer) displayer; ...
[ "public", "void", "draw", "(", "final", "List", "<", "Displayer", ">", "displayerList", ")", "{", "// Get the modules to load.", "Set", "<", "ChartPackage", ">", "packageList", "=", "EnumSet", ".", "noneOf", "(", "ChartPackage", ".", "class", ")", ";", "for", ...
In Google the renderer mechanism is asynchronous.
[ "In", "Google", "the", "renderer", "mechanism", "is", "asynchronous", "." ]
50ef88210726b4f2f33f1a82eaf0f542e38dedd9
https://github.com/dashbuilder/dashbuilder/blob/50ef88210726b4f2f33f1a82eaf0f542e38dedd9/dashbuilder-client/dashbuilder-renderers/dashbuilder-renderer-google/src/main/java/org/dashbuilder/renderer/google/client/GoogleRenderer.java#L155-L188
train
phax/ph-ubl
ph-ubltr/src/main/java/com/helger/ubltr/UBLTRDocumentTypes.java
UBLTRDocumentTypes.getImplementationClassOfLocalName
@Nullable public static Class <?> getImplementationClassOfLocalName (@Nullable final String sLocalName) { final EUBLTRDocumentType eDocType = getDocumentTypeOfLocalName (sLocalName); return eDocType == null ? null : eDocType.getImplementationClass (); }
java
@Nullable public static Class <?> getImplementationClassOfLocalName (@Nullable final String sLocalName) { final EUBLTRDocumentType eDocType = getDocumentTypeOfLocalName (sLocalName); return eDocType == null ? null : eDocType.getImplementationClass (); }
[ "@", "Nullable", "public", "static", "Class", "<", "?", ">", "getImplementationClassOfLocalName", "(", "@", "Nullable", "final", "String", "sLocalName", ")", "{", "final", "EUBLTRDocumentType", "eDocType", "=", "getDocumentTypeOfLocalName", "(", "sLocalName", ")", "...
Get the domain object class of the passed document element local name. @param sLocalName The document element local name of any UBLTR document type. May be <code>null</code>. @return <code>null</code> if no such implementation class exists.
[ "Get", "the", "domain", "object", "class", "of", "the", "passed", "document", "element", "local", "name", "." ]
30121914b1169d6149c601f551febf3a6ca6b4af
https://github.com/phax/ph-ubl/blob/30121914b1169d6149c601f551febf3a6ca6b4af/ph-ubltr/src/main/java/com/helger/ubltr/UBLTRDocumentTypes.java#L99-L104
train
phax/ph-ubl
ph-ubltr/src/main/java/com/helger/ubltr/UBLTRDocumentTypes.java
UBLTRDocumentTypes.getDocumentTypeOfImplementationClass
@Nullable public static EUBLTRDocumentType getDocumentTypeOfImplementationClass (@Nullable final Class <?> aImplClass) { if (aImplClass == null) return null; return ArrayHelper.findFirst (EUBLTRDocumentType.values (), eDocType -> eDocType.getImplementationClass ().equ...
java
@Nullable public static EUBLTRDocumentType getDocumentTypeOfImplementationClass (@Nullable final Class <?> aImplClass) { if (aImplClass == null) return null; return ArrayHelper.findFirst (EUBLTRDocumentType.values (), eDocType -> eDocType.getImplementationClass ().equ...
[ "@", "Nullable", "public", "static", "EUBLTRDocumentType", "getDocumentTypeOfImplementationClass", "(", "@", "Nullable", "final", "Class", "<", "?", ">", "aImplClass", ")", "{", "if", "(", "aImplClass", "==", "null", ")", "return", "null", ";", "return", "ArrayH...
Get the UBLTR document type matching the passed implementation class. @param aImplClass The implementation class to use. May be <code>null</code>. @return <code>null</code> if the implementation class is <code>null</code> or if no UBLTR document type has the specified implementation class.
[ "Get", "the", "UBLTR", "document", "type", "matching", "the", "passed", "implementation", "class", "." ]
30121914b1169d6149c601f551febf3a6ca6b4af
https://github.com/phax/ph-ubl/blob/30121914b1169d6149c601f551febf3a6ca6b4af/ph-ubltr/src/main/java/com/helger/ubltr/UBLTRDocumentTypes.java#L115-L122
train
phax/ph-ubl
ph-ubltr/src/main/java/com/helger/ubltr/UBLTRDocumentTypes.java
UBLTRDocumentTypes.getSchemaOfLocalName
@Nullable public static Schema getSchemaOfLocalName (@Nullable final String sLocalName) { final EUBLTRDocumentType eDocType = getDocumentTypeOfLocalName (sLocalName); return eDocType == null ? null : eDocType.getSchema (); }
java
@Nullable public static Schema getSchemaOfLocalName (@Nullable final String sLocalName) { final EUBLTRDocumentType eDocType = getDocumentTypeOfLocalName (sLocalName); return eDocType == null ? null : eDocType.getSchema (); }
[ "@", "Nullable", "public", "static", "Schema", "getSchemaOfLocalName", "(", "@", "Nullable", "final", "String", "sLocalName", ")", "{", "final", "EUBLTRDocumentType", "eDocType", "=", "getDocumentTypeOfLocalName", "(", "sLocalName", ")", ";", "return", "eDocType", "...
Get the XSD Schema object for the UBLTR document type of the passed document element local name. @param sLocalName The document element local name of any UBLTR document type. May be <code>null</code>. @return <code>null</code> if no such UBLTR document type exists.
[ "Get", "the", "XSD", "Schema", "object", "for", "the", "UBLTR", "document", "type", "of", "the", "passed", "document", "element", "local", "name", "." ]
30121914b1169d6149c601f551febf3a6ca6b4af
https://github.com/phax/ph-ubl/blob/30121914b1169d6149c601f551febf3a6ca6b4af/ph-ubltr/src/main/java/com/helger/ubltr/UBLTRDocumentTypes.java#L133-L138
train
phax/ph-ubl
ph-ubltr/src/main/java/com/helger/ubltr/UBLTRDocumentTypes.java
UBLTRDocumentTypes.getSchemaOfImplementationClass
@Nullable public static Schema getSchemaOfImplementationClass (@Nullable final Class <?> aImplClass) { final EUBLTRDocumentType eDocType = getDocumentTypeOfImplementationClass (aImplClass); return eDocType == null ? null : eDocType.getSchema (); }
java
@Nullable public static Schema getSchemaOfImplementationClass (@Nullable final Class <?> aImplClass) { final EUBLTRDocumentType eDocType = getDocumentTypeOfImplementationClass (aImplClass); return eDocType == null ? null : eDocType.getSchema (); }
[ "@", "Nullable", "public", "static", "Schema", "getSchemaOfImplementationClass", "(", "@", "Nullable", "final", "Class", "<", "?", ">", "aImplClass", ")", "{", "final", "EUBLTRDocumentType", "eDocType", "=", "getDocumentTypeOfImplementationClass", "(", "aImplClass", "...
Get the XSD Schema object for the UBLTR document type of the passed implementation class. @param aImplClass The implementation class of any UBLTR document type. May be <code>null</code>. @return <code>null</code> if no such UBLTR document type exists.
[ "Get", "the", "XSD", "Schema", "object", "for", "the", "UBLTR", "document", "type", "of", "the", "passed", "implementation", "class", "." ]
30121914b1169d6149c601f551febf3a6ca6b4af
https://github.com/phax/ph-ubl/blob/30121914b1169d6149c601f551febf3a6ca6b4af/ph-ubltr/src/main/java/com/helger/ubltr/UBLTRDocumentTypes.java#L149-L154
train
phax/ph-ubl
ph-ubl21/src/main/java/com/helger/ubl21/UBL21DocumentTypes.java
UBL21DocumentTypes.getImplementationClassOfNamespace
@Nullable public static Class <?> getImplementationClassOfNamespace (@Nullable final String sNamespace) { final EUBL21DocumentType eDocType = getDocumentTypeOfNamespace (sNamespace); return eDocType == null ? null : eDocType.getImplementationClass (); }
java
@Nullable public static Class <?> getImplementationClassOfNamespace (@Nullable final String sNamespace) { final EUBL21DocumentType eDocType = getDocumentTypeOfNamespace (sNamespace); return eDocType == null ? null : eDocType.getImplementationClass (); }
[ "@", "Nullable", "public", "static", "Class", "<", "?", ">", "getImplementationClassOfNamespace", "(", "@", "Nullable", "final", "String", "sNamespace", ")", "{", "final", "EUBL21DocumentType", "eDocType", "=", "getDocumentTypeOfNamespace", "(", "sNamespace", ")", "...
Get the domain object class of the passed namespace. @param sNamespace The namespace URI of any UBL 2.1 document type. May be <code>null</code>. @return <code>null</code> if no such UBL 2.1 document type exists.
[ "Get", "the", "domain", "object", "class", "of", "the", "passed", "namespace", "." ]
30121914b1169d6149c601f551febf3a6ca6b4af
https://github.com/phax/ph-ubl/blob/30121914b1169d6149c601f551febf3a6ca6b4af/ph-ubl21/src/main/java/com/helger/ubl21/UBL21DocumentTypes.java#L104-L109
train
phax/ph-ubl
ph-ubl21/src/main/java/com/helger/ubl21/UBL21DocumentTypes.java
UBL21DocumentTypes.getSchemaOfNamespace
@Nullable public static Schema getSchemaOfNamespace (@Nullable final String sNamespace) { final EUBL21DocumentType eDocType = getDocumentTypeOfNamespace (sNamespace); return eDocType == null ? null : eDocType.getSchema (); }
java
@Nullable public static Schema getSchemaOfNamespace (@Nullable final String sNamespace) { final EUBL21DocumentType eDocType = getDocumentTypeOfNamespace (sNamespace); return eDocType == null ? null : eDocType.getSchema (); }
[ "@", "Nullable", "public", "static", "Schema", "getSchemaOfNamespace", "(", "@", "Nullable", "final", "String", "sNamespace", ")", "{", "final", "EUBL21DocumentType", "eDocType", "=", "getDocumentTypeOfNamespace", "(", "sNamespace", ")", ";", "return", "eDocType", "...
Get the XSD Schema object for the UBL 2.1 document type of the passed namespace. @param sNamespace The namespace URI of any UBL 2.1 document type. May be <code>null</code>. @return <code>null</code> if no such UBL 2.1 document type exists.
[ "Get", "the", "XSD", "Schema", "object", "for", "the", "UBL", "2", ".", "1", "document", "type", "of", "the", "passed", "namespace", "." ]
30121914b1169d6149c601f551febf3a6ca6b4af
https://github.com/phax/ph-ubl/blob/30121914b1169d6149c601f551febf3a6ca6b4af/ph-ubl21/src/main/java/com/helger/ubl21/UBL21DocumentTypes.java#L138-L143
train
RallyTools/RallyRestToolkitForJava
src/main/java/com/rallydev/rest/response/GetResponse.java
GetResponse.getRoot
@Override protected String getRoot() { JsonObject result = ((JsonObject) new JsonParser().parse(raw)); String root = null; for(Map.Entry<String, JsonElement> member : result.entrySet()) { root = member.getKey(); } return root; }
java
@Override protected String getRoot() { JsonObject result = ((JsonObject) new JsonParser().parse(raw)); String root = null; for(Map.Entry<String, JsonElement> member : result.entrySet()) { root = member.getKey(); } return root; }
[ "@", "Override", "protected", "String", "getRoot", "(", ")", "{", "JsonObject", "result", "=", "(", "(", "JsonObject", ")", "new", "JsonParser", "(", ")", ".", "parse", "(", "raw", ")", ")", ";", "String", "root", "=", "null", ";", "for", "(", "Map",...
Get the name of the root JSON result @return the root element name
[ "Get", "the", "name", "of", "the", "root", "JSON", "result" ]
542afa16ea44c9c64cebb0299500dcbbb50b6d7d
https://github.com/RallyTools/RallyRestToolkitForJava/blob/542afa16ea44c9c64cebb0299500dcbbb50b6d7d/src/main/java/com/rallydev/rest/response/GetResponse.java#L28-L36
train
RallyTools/RallyRestToolkitForJava
src/main/java/com/rallydev/rest/client/BasicAuthClient.java
BasicAuthClient.attachSecurityInfo
protected void attachSecurityInfo(HttpRequestBase request) throws IOException, URISyntaxException { if (!SECURITY_ENDPOINT_DOES_NOT_EXIST.equals(securityToken)) { try { if (securityToken == null) { HttpGet httpGet = new HttpGet(getWsapiUrl() + SECURITY_TOKEN_URL);...
java
protected void attachSecurityInfo(HttpRequestBase request) throws IOException, URISyntaxException { if (!SECURITY_ENDPOINT_DOES_NOT_EXIST.equals(securityToken)) { try { if (securityToken == null) { HttpGet httpGet = new HttpGet(getWsapiUrl() + SECURITY_TOKEN_URL);...
[ "protected", "void", "attachSecurityInfo", "(", "HttpRequestBase", "request", ")", "throws", "IOException", ",", "URISyntaxException", "{", "if", "(", "!", "SECURITY_ENDPOINT_DOES_NOT_EXIST", ".", "equals", "(", "securityToken", ")", ")", "{", "try", "{", "if", "(...
Attach the security token parameter to the request. Response Structure: {"OperationResult": {"SecurityToken": "UUID"}} @param request the request to be modified @throws IOException if a non-200 response code is returned or if some other problem occurs while executing the request @throws URISyntaxException if there is...
[ "Attach", "the", "security", "token", "parameter", "to", "the", "request", "." ]
542afa16ea44c9c64cebb0299500dcbbb50b6d7d
https://github.com/RallyTools/RallyRestToolkitForJava/blob/542afa16ea44c9c64cebb0299500dcbbb50b6d7d/src/main/java/com/rallydev/rest/client/BasicAuthClient.java#L70-L88
train
RallyTools/RallyRestToolkitForJava
src/main/java/com/rallydev/rest/RallyRestApi.java
RallyRestApi.create
public CreateResponse create(CreateRequest request) throws IOException { return new CreateResponse(client.doPost(request.toUrl(), request.getBody())); }
java
public CreateResponse create(CreateRequest request) throws IOException { return new CreateResponse(client.doPost(request.toUrl(), request.getBody())); }
[ "public", "CreateResponse", "create", "(", "CreateRequest", "request", ")", "throws", "IOException", "{", "return", "new", "CreateResponse", "(", "client", ".", "doPost", "(", "request", ".", "toUrl", "(", ")", ",", "request", ".", "getBody", "(", ")", ")", ...
Create the specified object. @param request the {@link CreateRequest} specifying the object to be created. @return the resulting {@link CreateResponse} @throws IOException if an error occurs during the creation.
[ "Create", "the", "specified", "object", "." ]
542afa16ea44c9c64cebb0299500dcbbb50b6d7d
https://github.com/RallyTools/RallyRestToolkitForJava/blob/542afa16ea44c9c64cebb0299500dcbbb50b6d7d/src/main/java/com/rallydev/rest/RallyRestApi.java#L124-L126
train
RallyTools/RallyRestToolkitForJava
src/main/java/com/rallydev/rest/RallyRestApi.java
RallyRestApi.update
public UpdateResponse update(UpdateRequest request) throws IOException { return new UpdateResponse(client.doPost(request.toUrl(), request.getBody())); }
java
public UpdateResponse update(UpdateRequest request) throws IOException { return new UpdateResponse(client.doPost(request.toUrl(), request.getBody())); }
[ "public", "UpdateResponse", "update", "(", "UpdateRequest", "request", ")", "throws", "IOException", "{", "return", "new", "UpdateResponse", "(", "client", ".", "doPost", "(", "request", ".", "toUrl", "(", ")", ",", "request", ".", "getBody", "(", ")", ")", ...
Update the specified object. @param request the {@link UpdateRequest} specifying the object to be updated. @return the resulting {@link UpdateResponse} @throws IOException if an error occurs during the update.
[ "Update", "the", "specified", "object", "." ]
542afa16ea44c9c64cebb0299500dcbbb50b6d7d
https://github.com/RallyTools/RallyRestToolkitForJava/blob/542afa16ea44c9c64cebb0299500dcbbb50b6d7d/src/main/java/com/rallydev/rest/RallyRestApi.java#L135-L137
train
RallyTools/RallyRestToolkitForJava
src/main/java/com/rallydev/rest/RallyRestApi.java
RallyRestApi.updateCollection
public CollectionUpdateResponse updateCollection(CollectionUpdateRequest request) throws IOException { return new CollectionUpdateResponse(client.doPost(request.toUrl(), request.getBody())); }
java
public CollectionUpdateResponse updateCollection(CollectionUpdateRequest request) throws IOException { return new CollectionUpdateResponse(client.doPost(request.toUrl(), request.getBody())); }
[ "public", "CollectionUpdateResponse", "updateCollection", "(", "CollectionUpdateRequest", "request", ")", "throws", "IOException", "{", "return", "new", "CollectionUpdateResponse", "(", "client", ".", "doPost", "(", "request", ".", "toUrl", "(", ")", ",", "request", ...
Update the specified collection. Note that this method is only usable with WSAPI versions 2.0 and above. @param request the {@link CollectionUpdateRequest} specifying the collection to be updated. @return the resulting {@link CollectionUpdateResponse} @throws IOException if an error occurs during the update.
[ "Update", "the", "specified", "collection", ".", "Note", "that", "this", "method", "is", "only", "usable", "with", "WSAPI", "versions", "2", ".", "0", "and", "above", "." ]
542afa16ea44c9c64cebb0299500dcbbb50b6d7d
https://github.com/RallyTools/RallyRestToolkitForJava/blob/542afa16ea44c9c64cebb0299500dcbbb50b6d7d/src/main/java/com/rallydev/rest/RallyRestApi.java#L147-L149
train
RallyTools/RallyRestToolkitForJava
src/main/java/com/rallydev/rest/RallyRestApi.java
RallyRestApi.delete
public DeleteResponse delete(DeleteRequest request) throws IOException { return new DeleteResponse(client.doDelete(request.toUrl())); }
java
public DeleteResponse delete(DeleteRequest request) throws IOException { return new DeleteResponse(client.doDelete(request.toUrl())); }
[ "public", "DeleteResponse", "delete", "(", "DeleteRequest", "request", ")", "throws", "IOException", "{", "return", "new", "DeleteResponse", "(", "client", ".", "doDelete", "(", "request", ".", "toUrl", "(", ")", ")", ")", ";", "}" ]
Delete the specified object. @param request the {@link DeleteRequest} specifying the object to be deleted. @return the resulting {@link DeleteResponse} @throws IOException if an error occurs during the deletion.
[ "Delete", "the", "specified", "object", "." ]
542afa16ea44c9c64cebb0299500dcbbb50b6d7d
https://github.com/RallyTools/RallyRestToolkitForJava/blob/542afa16ea44c9c64cebb0299500dcbbb50b6d7d/src/main/java/com/rallydev/rest/RallyRestApi.java#L158-L160
train
RallyTools/RallyRestToolkitForJava
src/main/java/com/rallydev/rest/RallyRestApi.java
RallyRestApi.query
public QueryResponse query(QueryRequest request) throws IOException { QueryResponse queryResponse = new QueryResponse(client.doGet(request.toUrl())); if (queryResponse.wasSuccessful()) { int receivedRecords = request.getPageSize(); while (receivedRecords < request.getLimit() && ...
java
public QueryResponse query(QueryRequest request) throws IOException { QueryResponse queryResponse = new QueryResponse(client.doGet(request.toUrl())); if (queryResponse.wasSuccessful()) { int receivedRecords = request.getPageSize(); while (receivedRecords < request.getLimit() && ...
[ "public", "QueryResponse", "query", "(", "QueryRequest", "request", ")", "throws", "IOException", "{", "QueryResponse", "queryResponse", "=", "new", "QueryResponse", "(", "client", ".", "doGet", "(", "request", ".", "toUrl", "(", ")", ")", ")", ";", "if", "(...
Query for objects matching the specified request. By default one page of data will be returned. Paging will automatically be performed if a limit is set on the request. @param request the {@link QueryRequest} specifying the object to be created. @return the resulting {@link QueryResponse} @throws IOException if an err...
[ "Query", "for", "objects", "matching", "the", "specified", "request", ".", "By", "default", "one", "page", "of", "data", "will", "be", "returned", ".", "Paging", "will", "automatically", "be", "performed", "if", "a", "limit", "is", "set", "on", "the", "req...
542afa16ea44c9c64cebb0299500dcbbb50b6d7d
https://github.com/RallyTools/RallyRestToolkitForJava/blob/542afa16ea44c9c64cebb0299500dcbbb50b6d7d/src/main/java/com/rallydev/rest/RallyRestApi.java#L171-L189
train
RallyTools/RallyRestToolkitForJava
src/main/java/com/rallydev/rest/RallyRestApi.java
RallyRestApi.get
public GetResponse get(GetRequest request) throws IOException { return new GetResponse(client.doGet(request.toUrl())); }
java
public GetResponse get(GetRequest request) throws IOException { return new GetResponse(client.doGet(request.toUrl())); }
[ "public", "GetResponse", "get", "(", "GetRequest", "request", ")", "throws", "IOException", "{", "return", "new", "GetResponse", "(", "client", ".", "doGet", "(", "request", ".", "toUrl", "(", ")", ")", ")", ";", "}" ]
Get the specified object. @param request the {@link GetRequest} specifying the object to be retrieved. @return the resulting {@link GetResponse} @throws IOException if an error occurs during the retrieval.
[ "Get", "the", "specified", "object", "." ]
542afa16ea44c9c64cebb0299500dcbbb50b6d7d
https://github.com/RallyTools/RallyRestToolkitForJava/blob/542afa16ea44c9c64cebb0299500dcbbb50b6d7d/src/main/java/com/rallydev/rest/RallyRestApi.java#L198-L200
train
RallyTools/RallyRestToolkitForJava
src/main/java/com/rallydev/rest/util/QueryFilter.java
QueryFilter.and
public static QueryFilter and(QueryFilter... queryFilters) { QueryFilter result = null; for (QueryFilter q : queryFilters) { result = result == null ? q : result.and(q); } return result; }
java
public static QueryFilter and(QueryFilter... queryFilters) { QueryFilter result = null; for (QueryFilter q : queryFilters) { result = result == null ? q : result.and(q); } return result; }
[ "public", "static", "QueryFilter", "and", "(", "QueryFilter", "...", "queryFilters", ")", "{", "QueryFilter", "result", "=", "null", ";", "for", "(", "QueryFilter", "q", ":", "queryFilters", ")", "{", "result", "=", "result", "==", "null", "?", "q", ":", ...
Get a query filter that is the ANDed combination of the specified filters. @param queryFilters one or more query filters to be ANDed together @return the ANDed query filter
[ "Get", "a", "query", "filter", "that", "is", "the", "ANDed", "combination", "of", "the", "specified", "filters", "." ]
542afa16ea44c9c64cebb0299500dcbbb50b6d7d
https://github.com/RallyTools/RallyRestToolkitForJava/blob/542afa16ea44c9c64cebb0299500dcbbb50b6d7d/src/main/java/com/rallydev/rest/util/QueryFilter.java#L94-L100
train
RallyTools/RallyRestToolkitForJava
src/main/java/com/rallydev/rest/util/QueryFilter.java
QueryFilter.or
public static QueryFilter or(QueryFilter... queryFilters) { QueryFilter result = null; for (QueryFilter q : queryFilters) { result = result == null ? q : result.or(q); } return result; }
java
public static QueryFilter or(QueryFilter... queryFilters) { QueryFilter result = null; for (QueryFilter q : queryFilters) { result = result == null ? q : result.or(q); } return result; }
[ "public", "static", "QueryFilter", "or", "(", "QueryFilter", "...", "queryFilters", ")", "{", "QueryFilter", "result", "=", "null", ";", "for", "(", "QueryFilter", "q", ":", "queryFilters", ")", "{", "result", "=", "result", "==", "null", "?", "q", ":", ...
Get a query filter that is the ORed combination of the specified filters. @param queryFilters one or more query filters to be ORed together @return the ORed query filter
[ "Get", "a", "query", "filter", "that", "is", "the", "ORed", "combination", "of", "the", "specified", "filters", "." ]
542afa16ea44c9c64cebb0299500dcbbb50b6d7d
https://github.com/RallyTools/RallyRestToolkitForJava/blob/542afa16ea44c9c64cebb0299500dcbbb50b6d7d/src/main/java/com/rallydev/rest/util/QueryFilter.java#L108-L114
train
RallyTools/RallyRestToolkitForJava
src/main/java/com/rallydev/rest/request/CreateRequest.java
CreateRequest.getBody
public String getBody() { JsonObject wrapper = new JsonObject(); wrapper.add(type, obj); return gsonBuilder.create().toJson(wrapper); }
java
public String getBody() { JsonObject wrapper = new JsonObject(); wrapper.add(type, obj); return gsonBuilder.create().toJson(wrapper); }
[ "public", "String", "getBody", "(", ")", "{", "JsonObject", "wrapper", "=", "new", "JsonObject", "(", ")", ";", "wrapper", ".", "add", "(", "type", ",", "obj", ")", ";", "return", "gsonBuilder", ".", "create", "(", ")", ".", "toJson", "(", "wrapper", ...
Get the JSON encoded string representation of the object to be created. @return the JSON encoded object
[ "Get", "the", "JSON", "encoded", "string", "representation", "of", "the", "object", "to", "be", "created", "." ]
542afa16ea44c9c64cebb0299500dcbbb50b6d7d
https://github.com/RallyTools/RallyRestToolkitForJava/blob/542afa16ea44c9c64cebb0299500dcbbb50b6d7d/src/main/java/com/rallydev/rest/request/CreateRequest.java#L37-L41
train
RallyTools/RallyRestToolkitForJava
src/main/java/com/rallydev/rest/util/Ref.java
Ref.getRelativeRef
public static String getRelativeRef(String ref) { Matcher matcher = match(ref); return matcher != null ? String.format("/%s/%s", matcher.group(1), matcher.group(2)) : null; }
java
public static String getRelativeRef(String ref) { Matcher matcher = match(ref); return matcher != null ? String.format("/%s/%s", matcher.group(1), matcher.group(2)) : null; }
[ "public", "static", "String", "getRelativeRef", "(", "String", "ref", ")", "{", "Matcher", "matcher", "=", "match", "(", "ref", ")", ";", "return", "matcher", "!=", "null", "?", "String", ".", "format", "(", "\"/%s/%s\"", ",", "matcher", ".", "group", "(...
Create a relative ref url from the specified ref @param ref the ref url to be made relative @return the relative ref url or null if the specified ref was not valid
[ "Create", "a", "relative", "ref", "url", "from", "the", "specified", "ref" ]
542afa16ea44c9c64cebb0299500dcbbb50b6d7d
https://github.com/RallyTools/RallyRestToolkitForJava/blob/542afa16ea44c9c64cebb0299500dcbbb50b6d7d/src/main/java/com/rallydev/rest/util/Ref.java#L75-L78
train
RallyTools/RallyRestToolkitForJava
src/main/java/com/rallydev/rest/util/Ref.java
Ref.getTypeFromRef
public static String getTypeFromRef(String ref) { Matcher matcher = match(ref); return matcher != null ? matcher.group(1) : null; }
java
public static String getTypeFromRef(String ref) { Matcher matcher = match(ref); return matcher != null ? matcher.group(1) : null; }
[ "public", "static", "String", "getTypeFromRef", "(", "String", "ref", ")", "{", "Matcher", "matcher", "=", "match", "(", "ref", ")", ";", "return", "matcher", "!=", "null", "?", "matcher", ".", "group", "(", "1", ")", ":", "null", ";", "}" ]
Get the type from the specified ref url @param ref the ref url to extract the type from @return the extracted type or null if the specified ref was not valid
[ "Get", "the", "type", "from", "the", "specified", "ref", "url" ]
542afa16ea44c9c64cebb0299500dcbbb50b6d7d
https://github.com/RallyTools/RallyRestToolkitForJava/blob/542afa16ea44c9c64cebb0299500dcbbb50b6d7d/src/main/java/com/rallydev/rest/util/Ref.java#L87-L90
train
RallyTools/RallyRestToolkitForJava
src/main/java/com/rallydev/rest/util/Ref.java
Ref.getOidFromRef
public static String getOidFromRef(String ref) { Matcher matcher = match(ref); return matcher != null ? matcher.group(2) : null; }
java
public static String getOidFromRef(String ref) { Matcher matcher = match(ref); return matcher != null ? matcher.group(2) : null; }
[ "public", "static", "String", "getOidFromRef", "(", "String", "ref", ")", "{", "Matcher", "matcher", "=", "match", "(", "ref", ")", ";", "return", "matcher", "!=", "null", "?", "matcher", ".", "group", "(", "2", ")", ":", "null", ";", "}" ]
Get the ObjectID from the specified ref url @param ref the ref url to extract the ObjectID from @return the extracted ObjectID or null if the specified ref was not valid
[ "Get", "the", "ObjectID", "from", "the", "specified", "ref", "url" ]
542afa16ea44c9c64cebb0299500dcbbb50b6d7d
https://github.com/RallyTools/RallyRestToolkitForJava/blob/542afa16ea44c9c64cebb0299500dcbbb50b6d7d/src/main/java/com/rallydev/rest/util/Ref.java#L99-L102
train
RallyTools/RallyRestToolkitForJava
src/main/java/com/rallydev/rest/request/Request.java
Request.addParam
public void addParam(String name, String value) { getParams().add(new BasicNameValuePair(name, value)); }
java
public void addParam(String name, String value) { getParams().add(new BasicNameValuePair(name, value)); }
[ "public", "void", "addParam", "(", "String", "name", ",", "String", "value", ")", "{", "getParams", "(", ")", ".", "add", "(", "new", "BasicNameValuePair", "(", "name", ",", "value", ")", ")", ";", "}" ]
Add the specified parameter to this request. @param name the parameter name @param value the parameter value
[ "Add", "the", "specified", "parameter", "to", "this", "request", "." ]
542afa16ea44c9c64cebb0299500dcbbb50b6d7d
https://github.com/RallyTools/RallyRestToolkitForJava/blob/542afa16ea44c9c64cebb0299500dcbbb50b6d7d/src/main/java/com/rallydev/rest/request/Request.java#L54-L56
train
RallyTools/RallyRestToolkitForJava
src/main/java/com/rallydev/rest/client/HttpClient.java
HttpClient.setProxy
public void setProxy(URI proxy) { this.getParams().setParameter(ConnRoutePNames.DEFAULT_PROXY, new HttpHost(proxy.getHost(), proxy.getPort(), proxy.getScheme())); }
java
public void setProxy(URI proxy) { this.getParams().setParameter(ConnRoutePNames.DEFAULT_PROXY, new HttpHost(proxy.getHost(), proxy.getPort(), proxy.getScheme())); }
[ "public", "void", "setProxy", "(", "URI", "proxy", ")", "{", "this", ".", "getParams", "(", ")", ".", "setParameter", "(", "ConnRoutePNames", ".", "DEFAULT_PROXY", ",", "new", "HttpHost", "(", "proxy", ".", "getHost", "(", ")", ",", "proxy", ".", "getPor...
Set the unauthenticated proxy server to use. By default no proxy is configured. @param proxy The proxy server, e.g. {@code new URI("http://my.proxy.com:8000")}
[ "Set", "the", "unauthenticated", "proxy", "server", "to", "use", ".", "By", "default", "no", "proxy", "is", "configured", "." ]
542afa16ea44c9c64cebb0299500dcbbb50b6d7d
https://github.com/RallyTools/RallyRestToolkitForJava/blob/542afa16ea44c9c64cebb0299500dcbbb50b6d7d/src/main/java/com/rallydev/rest/client/HttpClient.java#L59-L61
train
RallyTools/RallyRestToolkitForJava
src/main/java/com/rallydev/rest/client/HttpClient.java
HttpClient.doPost
public String doPost(String url, String body) throws IOException { HttpPost httpPost = new HttpPost(getWsapiUrl() + url); httpPost.setEntity(new StringEntity(body, "utf-8")); return doRequest(httpPost); }
java
public String doPost(String url, String body) throws IOException { HttpPost httpPost = new HttpPost(getWsapiUrl() + url); httpPost.setEntity(new StringEntity(body, "utf-8")); return doRequest(httpPost); }
[ "public", "String", "doPost", "(", "String", "url", ",", "String", "body", ")", "throws", "IOException", "{", "HttpPost", "httpPost", "=", "new", "HttpPost", "(", "getWsapiUrl", "(", ")", "+", "url", ")", ";", "httpPost", ".", "setEntity", "(", "new", "S...
Perform a post against the WSAPI @param url the request url @param body the body of the post @return the JSON encoded string response @throws IOException if a non-200 response code is returned or if some other problem occurs while executing the request
[ "Perform", "a", "post", "against", "the", "WSAPI" ]
542afa16ea44c9c64cebb0299500dcbbb50b6d7d
https://github.com/RallyTools/RallyRestToolkitForJava/blob/542afa16ea44c9c64cebb0299500dcbbb50b6d7d/src/main/java/com/rallydev/rest/client/HttpClient.java#L176-L180
train
RallyTools/RallyRestToolkitForJava
src/main/java/com/rallydev/rest/client/HttpClient.java
HttpClient.doPut
public String doPut(String url, String body) throws IOException { HttpPut httpPut = new HttpPut(getWsapiUrl() + url); httpPut.setEntity(new StringEntity(body, "utf-8")); return doRequest(httpPut); }
java
public String doPut(String url, String body) throws IOException { HttpPut httpPut = new HttpPut(getWsapiUrl() + url); httpPut.setEntity(new StringEntity(body, "utf-8")); return doRequest(httpPut); }
[ "public", "String", "doPut", "(", "String", "url", ",", "String", "body", ")", "throws", "IOException", "{", "HttpPut", "httpPut", "=", "new", "HttpPut", "(", "getWsapiUrl", "(", ")", "+", "url", ")", ";", "httpPut", ".", "setEntity", "(", "new", "String...
Perform a put against the WSAPI @param url the request url @param body the body of the put @return the JSON encoded string response @throws IOException if a non-200 response code is returned or if some other problem occurs while executing the request
[ "Perform", "a", "put", "against", "the", "WSAPI" ]
542afa16ea44c9c64cebb0299500dcbbb50b6d7d
https://github.com/RallyTools/RallyRestToolkitForJava/blob/542afa16ea44c9c64cebb0299500dcbbb50b6d7d/src/main/java/com/rallydev/rest/client/HttpClient.java#L192-L196
train
RallyTools/RallyRestToolkitForJava
src/main/java/com/rallydev/rest/client/HttpClient.java
HttpClient.doDelete
public String doDelete(String url) throws IOException { HttpDelete httpDelete = new HttpDelete(getWsapiUrl() + url); return doRequest(httpDelete); }
java
public String doDelete(String url) throws IOException { HttpDelete httpDelete = new HttpDelete(getWsapiUrl() + url); return doRequest(httpDelete); }
[ "public", "String", "doDelete", "(", "String", "url", ")", "throws", "IOException", "{", "HttpDelete", "httpDelete", "=", "new", "HttpDelete", "(", "getWsapiUrl", "(", ")", "+", "url", ")", ";", "return", "doRequest", "(", "httpDelete", ")", ";", "}" ]
Perform a delete against the WSAPI @param url the request url @return the JSON encoded string response @throws IOException if a non-200 response code is returned or if some other problem occurs while executing the request
[ "Perform", "a", "delete", "against", "the", "WSAPI" ]
542afa16ea44c9c64cebb0299500dcbbb50b6d7d
https://github.com/RallyTools/RallyRestToolkitForJava/blob/542afa16ea44c9c64cebb0299500dcbbb50b6d7d/src/main/java/com/rallydev/rest/client/HttpClient.java#L206-L209
train
RallyTools/RallyRestToolkitForJava
src/main/java/com/rallydev/rest/client/HttpClient.java
HttpClient.doGet
public String doGet(String url) throws IOException { HttpGet httpGet = new HttpGet(getWsapiUrl() + url); return doRequest(httpGet); }
java
public String doGet(String url) throws IOException { HttpGet httpGet = new HttpGet(getWsapiUrl() + url); return doRequest(httpGet); }
[ "public", "String", "doGet", "(", "String", "url", ")", "throws", "IOException", "{", "HttpGet", "httpGet", "=", "new", "HttpGet", "(", "getWsapiUrl", "(", ")", "+", "url", ")", ";", "return", "doRequest", "(", "httpGet", ")", ";", "}" ]
Perform a get against the WSAPI @param url the request url @return the JSON encoded string response @throws IOException if a non-200 response code is returned or if some other problem occurs while executing the request
[ "Perform", "a", "get", "against", "the", "WSAPI" ]
542afa16ea44c9c64cebb0299500dcbbb50b6d7d
https://github.com/RallyTools/RallyRestToolkitForJava/blob/542afa16ea44c9c64cebb0299500dcbbb50b6d7d/src/main/java/com/rallydev/rest/client/HttpClient.java#L219-L222
train
dkharrat/NexusDialog
nexusdialog/src/main/java/com/github/dkharrat/nexusdialog/controllers/FormSectionController.java
FormSectionController.addElement
public FormElementController addElement(FormElementController element, int position) { if (element instanceof FormSectionController) { throw new IllegalArgumentException("Sub-sections are not supported"); } if (elements.containsKey(element.getName())) { throw new Illegal...
java
public FormElementController addElement(FormElementController element, int position) { if (element instanceof FormSectionController) { throw new IllegalArgumentException("Sub-sections are not supported"); } if (elements.containsKey(element.getName())) { throw new Illegal...
[ "public", "FormElementController", "addElement", "(", "FormElementController", "element", ",", "int", "position", ")", "{", "if", "(", "element", "instanceof", "FormSectionController", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"Sub-sections are not supp...
Adds a form element to this section. Note that sub-sections are not supported. @param element the form element to add @param position the position at which to insert the element @return the same instance of the form element that was added to support method chaining
[ "Adds", "a", "form", "element", "to", "this", "section", ".", "Note", "that", "sub", "-", "sections", "are", "not", "supported", "." ]
f43a6a07940cced12286c622140f3a8ae3d178a1
https://github.com/dkharrat/NexusDialog/blob/f43a6a07940cced12286c622140f3a8ae3d178a1/nexusdialog/src/main/java/com/github/dkharrat/nexusdialog/controllers/FormSectionController.java#L75-L87
train
dkharrat/NexusDialog
nexusdialog/src/main/java/com/github/dkharrat/nexusdialog/controllers/FormSectionController.java
FormSectionController.removeElement
public FormElementController removeElement(String name) { FormElementController element = elements.remove(name); orderedElements.remove(element); return element; }
java
public FormElementController removeElement(String name) { FormElementController element = elements.remove(name); orderedElements.remove(element); return element; }
[ "public", "FormElementController", "removeElement", "(", "String", "name", ")", "{", "FormElementController", "element", "=", "elements", ".", "remove", "(", "name", ")", ";", "orderedElements", ".", "remove", "(", "element", ")", ";", "return", "element", ";", ...
Removes the form element with the specified name from this section. @param name the name of the form element to remove @return the removed form element instance, or null of no such element was found.
[ "Removes", "the", "form", "element", "with", "the", "specified", "name", "from", "this", "section", "." ]
f43a6a07940cced12286c622140f3a8ae3d178a1
https://github.com/dkharrat/NexusDialog/blob/f43a6a07940cced12286c622140f3a8ae3d178a1/nexusdialog/src/main/java/com/github/dkharrat/nexusdialog/controllers/FormSectionController.java#L117-L121
train
dkharrat/NexusDialog
nexusdialog/src/main/java/com/github/dkharrat/nexusdialog/controllers/LabeledFieldController.java
LabeledFieldController.setIsRequired
public void setIsRequired(boolean required) { if (! required) { validators.remove(REQUIRED_FIELD_VALIDATOR); } else if (! isRequired()) { validators.add(REQUIRED_FIELD_VALIDATOR); } }
java
public void setIsRequired(boolean required) { if (! required) { validators.remove(REQUIRED_FIELD_VALIDATOR); } else if (! isRequired()) { validators.add(REQUIRED_FIELD_VALIDATOR); } }
[ "public", "void", "setIsRequired", "(", "boolean", "required", ")", "{", "if", "(", "!", "required", ")", "{", "validators", ".", "remove", "(", "REQUIRED_FIELD_VALIDATOR", ")", ";", "}", "else", "if", "(", "!", "isRequired", "(", ")", ")", "{", "validat...
Sets whether this field is required to have user input. @param required if true, this field checks for a non-empty or non-null value upon validation. Otherwise, this field can be empty.
[ "Sets", "whether", "this", "field", "is", "required", "to", "have", "user", "input", "." ]
f43a6a07940cced12286c622140f3a8ae3d178a1
https://github.com/dkharrat/NexusDialog/blob/f43a6a07940cced12286c622140f3a8ae3d178a1/nexusdialog/src/main/java/com/github/dkharrat/nexusdialog/controllers/LabeledFieldController.java#L75-L81
train
dkharrat/NexusDialog
nexusdialog/src/main/java/com/github/dkharrat/nexusdialog/controllers/CheckBoxController.java
CheckBoxController.retrieveModelValues
private Set<Object> retrieveModelValues() { Set<Object> modelValues = (Set<Object>) getModel().getValue(getName()); if (modelValues == null) { modelValues = new HashSet<>(); } return modelValues; }
java
private Set<Object> retrieveModelValues() { Set<Object> modelValues = (Set<Object>) getModel().getValue(getName()); if (modelValues == null) { modelValues = new HashSet<>(); } return modelValues; }
[ "private", "Set", "<", "Object", ">", "retrieveModelValues", "(", ")", "{", "Set", "<", "Object", ">", "modelValues", "=", "(", "Set", "<", "Object", ">", ")", "getModel", "(", ")", ".", "getValue", "(", "getName", "(", ")", ")", ";", "if", "(", "m...
Returns the values hold in the model. @return The values from the model.
[ "Returns", "the", "values", "hold", "in", "the", "model", "." ]
f43a6a07940cced12286c622140f3a8ae3d178a1
https://github.com/dkharrat/NexusDialog/blob/f43a6a07940cced12286c622140f3a8ae3d178a1/nexusdialog/src/main/java/com/github/dkharrat/nexusdialog/controllers/CheckBoxController.java#L175-L181
train
dkharrat/NexusDialog
nexusdialog/src/main/java/com/github/dkharrat/nexusdialog/FormController.java
FormController.getNumberOfElements
public int getNumberOfElements() { int count = 0; for (FormSectionController section : getSections()) { count += section.getElements().size(); } return count; }
java
public int getNumberOfElements() { int count = 0; for (FormSectionController section : getSections()) { count += section.getElements().size(); } return count; }
[ "public", "int", "getNumberOfElements", "(", ")", "{", "int", "count", "=", "0", ";", "for", "(", "FormSectionController", "section", ":", "getSections", "(", ")", ")", "{", "count", "+=", "section", ".", "getElements", "(", ")", ".", "size", "(", ")", ...
Returns the total number of elements in this form, not including sections. @return the total number of elements in this form, not including sections
[ "Returns", "the", "total", "number", "of", "elements", "in", "this", "form", "not", "including", "sections", "." ]
f43a6a07940cced12286c622140f3a8ae3d178a1
https://github.com/dkharrat/NexusDialog/blob/f43a6a07940cced12286c622140f3a8ae3d178a1/nexusdialog/src/main/java/com/github/dkharrat/nexusdialog/FormController.java#L153-L160
train
dkharrat/NexusDialog
nexusdialog/src/main/java/com/github/dkharrat/nexusdialog/FormController.java
FormController.validateInput
public List<ValidationError> validateInput() { List<ValidationError> errors = new ArrayList<ValidationError>(); for (FormSectionController section : getSections()) { for (FormElementController element : section.getElements()) { if (element instanceof LabeledFieldController) ...
java
public List<ValidationError> validateInput() { List<ValidationError> errors = new ArrayList<ValidationError>(); for (FormSectionController section : getSections()) { for (FormElementController element : section.getElements()) { if (element instanceof LabeledFieldController) ...
[ "public", "List", "<", "ValidationError", ">", "validateInput", "(", ")", "{", "List", "<", "ValidationError", ">", "errors", "=", "new", "ArrayList", "<", "ValidationError", ">", "(", ")", ";", "for", "(", "FormSectionController", "section", ":", "getSections...
Returns a list of validation errors of the form's input @return a list of validation errors of the form's input
[ "Returns", "a", "list", "of", "validation", "errors", "of", "the", "form", "s", "input" ]
f43a6a07940cced12286c622140f3a8ae3d178a1
https://github.com/dkharrat/NexusDialog/blob/f43a6a07940cced12286c622140f3a8ae3d178a1/nexusdialog/src/main/java/com/github/dkharrat/nexusdialog/FormController.java#L176-L189
train
dkharrat/NexusDialog
nexusdialog/src/main/java/com/github/dkharrat/nexusdialog/FormFragment.java
FormFragment.recreateViews
protected void recreateViews() { ViewGroup containerView = (ViewGroup) getActivity().findViewById(R.id.form_elements_container); formController.recreateViews(containerView); }
java
protected void recreateViews() { ViewGroup containerView = (ViewGroup) getActivity().findViewById(R.id.form_elements_container); formController.recreateViews(containerView); }
[ "protected", "void", "recreateViews", "(", ")", "{", "ViewGroup", "containerView", "=", "(", "ViewGroup", ")", "getActivity", "(", ")", ".", "findViewById", "(", "R", ".", "id", ".", "form_elements_container", ")", ";", "formController", ".", "recreateViews", ...
Recreates the views for all the elements that are in the form. This method needs to be called when field are dynamically added or removed
[ "Recreates", "the", "views", "for", "all", "the", "elements", "that", "are", "in", "the", "form", ".", "This", "method", "needs", "to", "be", "called", "when", "field", "are", "dynamically", "added", "or", "removed" ]
f43a6a07940cced12286c622140f3a8ae3d178a1
https://github.com/dkharrat/NexusDialog/blob/f43a6a07940cced12286c622140f3a8ae3d178a1/nexusdialog/src/main/java/com/github/dkharrat/nexusdialog/FormFragment.java#L77-L80
train
sterodium/selenium-grid-extensions
extension-clients/file-extension-client/src/main/java/io/sterodium/extensions/client/FileExtensionClient.java
FileExtensionClient.download
public File download(String pathToFile, String extension) { return fileDownloadRequest.download(pathToFile, extension); }
java
public File download(String pathToFile, String extension) { return fileDownloadRequest.download(pathToFile, extension); }
[ "public", "File", "download", "(", "String", "pathToFile", ",", "String", "extension", ")", "{", "return", "fileDownloadRequest", ".", "download", "(", "pathToFile", ",", "extension", ")", ";", "}" ]
Download file from Selenium Node. @param pathToFile absolute path to file @return downloaded file with extension in temp directory
[ "Download", "file", "from", "Selenium", "Node", "." ]
407cde003020f7ab9e7bb5405371b0b52b5018c8
https://github.com/sterodium/selenium-grid-extensions/blob/407cde003020f7ab9e7bb5405371b0b52b5018c8/extension-clients/file-extension-client/src/main/java/io/sterodium/extensions/client/FileExtensionClient.java#L48-L50
train
spotify/async-google-pubsub-client
src/main/java/com/spotify/google/cloud/pubsub/client/Pubsub.java
Pubsub.refreshAccessToken
private void refreshAccessToken() { final Long expiresIn = credential.getExpiresInSeconds(); // trigger refresh if token is about to expire String accessToken = credential.getAccessToken(); if (accessToken == null || expiresIn != null && expiresIn <= 60) { try { credential.refreshToken();...
java
private void refreshAccessToken() { final Long expiresIn = credential.getExpiresInSeconds(); // trigger refresh if token is about to expire String accessToken = credential.getAccessToken(); if (accessToken == null || expiresIn != null && expiresIn <= 60) { try { credential.refreshToken();...
[ "private", "void", "refreshAccessToken", "(", ")", "{", "final", "Long", "expiresIn", "=", "credential", ".", "getExpiresInSeconds", "(", ")", ";", "// trigger refresh if token is about to expire", "String", "accessToken", "=", "credential", ".", "getAccessToken", "(", ...
Refresh the Google Cloud API access token, if necessary.
[ "Refresh", "the", "Google", "Cloud", "API", "access", "token", "if", "necessary", "." ]
7d021528fa5bc29be458e6f210fa62f59b71d004
https://github.com/spotify/async-google-pubsub-client/blob/7d021528fa5bc29be458e6f210fa62f59b71d004/src/main/java/com/spotify/google/cloud/pubsub/client/Pubsub.java#L230-L246
train
spotify/async-google-pubsub-client
src/main/java/com/spotify/google/cloud/pubsub/client/Pubsub.java
Pubsub.get
private <T> PubsubFuture<T> get(final String operation, final String path, final ResponseReader<T> responseReader) { return request(operation, HttpMethod.GET, path, responseReader); }
java
private <T> PubsubFuture<T> get(final String operation, final String path, final ResponseReader<T> responseReader) { return request(operation, HttpMethod.GET, path, responseReader); }
[ "private", "<", "T", ">", "PubsubFuture", "<", "T", ">", "get", "(", "final", "String", "operation", ",", "final", "String", "path", ",", "final", "ResponseReader", "<", "T", ">", "responseReader", ")", "{", "return", "request", "(", "operation", ",", "H...
Make a GET request.
[ "Make", "a", "GET", "request", "." ]
7d021528fa5bc29be458e6f210fa62f59b71d004
https://github.com/spotify/async-google-pubsub-client/blob/7d021528fa5bc29be458e6f210fa62f59b71d004/src/main/java/com/spotify/google/cloud/pubsub/client/Pubsub.java#L714-L716
train
spotify/async-google-pubsub-client
src/main/java/com/spotify/google/cloud/pubsub/client/Pubsub.java
Pubsub.post
private <T> PubsubFuture<T> post(final String operation, final String path, final Object payload, final ResponseReader<T> responseReader) { return request(operation, HttpMethod.POST, path, payload, responseReader); }
java
private <T> PubsubFuture<T> post(final String operation, final String path, final Object payload, final ResponseReader<T> responseReader) { return request(operation, HttpMethod.POST, path, payload, responseReader); }
[ "private", "<", "T", ">", "PubsubFuture", "<", "T", ">", "post", "(", "final", "String", "operation", ",", "final", "String", "path", ",", "final", "Object", "payload", ",", "final", "ResponseReader", "<", "T", ">", "responseReader", ")", "{", "return", ...
Make a POST request.
[ "Make", "a", "POST", "request", "." ]
7d021528fa5bc29be458e6f210fa62f59b71d004
https://github.com/spotify/async-google-pubsub-client/blob/7d021528fa5bc29be458e6f210fa62f59b71d004/src/main/java/com/spotify/google/cloud/pubsub/client/Pubsub.java#L721-L724
train
spotify/async-google-pubsub-client
src/main/java/com/spotify/google/cloud/pubsub/client/Pubsub.java
Pubsub.put
private <T> PubsubFuture<T> put(final String operation, final String path, final Object payload, final ResponseReader<T> responseReader) { return request(operation, HttpMethod.PUT, path, payload, responseReader); }
java
private <T> PubsubFuture<T> put(final String operation, final String path, final Object payload, final ResponseReader<T> responseReader) { return request(operation, HttpMethod.PUT, path, payload, responseReader); }
[ "private", "<", "T", ">", "PubsubFuture", "<", "T", ">", "put", "(", "final", "String", "operation", ",", "final", "String", "path", ",", "final", "Object", "payload", ",", "final", "ResponseReader", "<", "T", ">", "responseReader", ")", "{", "return", "...
Make a PUT request.
[ "Make", "a", "PUT", "request", "." ]
7d021528fa5bc29be458e6f210fa62f59b71d004
https://github.com/spotify/async-google-pubsub-client/blob/7d021528fa5bc29be458e6f210fa62f59b71d004/src/main/java/com/spotify/google/cloud/pubsub/client/Pubsub.java#L729-L732
train
spotify/async-google-pubsub-client
src/main/java/com/spotify/google/cloud/pubsub/client/Pubsub.java
Pubsub.delete
private <T> PubsubFuture<T> delete(final String operation, final String path, final ResponseReader<T> responseReader) { return request(operation, HttpMethod.DELETE, path, responseReader); }
java
private <T> PubsubFuture<T> delete(final String operation, final String path, final ResponseReader<T> responseReader) { return request(operation, HttpMethod.DELETE, path, responseReader); }
[ "private", "<", "T", ">", "PubsubFuture", "<", "T", ">", "delete", "(", "final", "String", "operation", ",", "final", "String", "path", ",", "final", "ResponseReader", "<", "T", ">", "responseReader", ")", "{", "return", "request", "(", "operation", ",", ...
Make a DELETE request.
[ "Make", "a", "DELETE", "request", "." ]
7d021528fa5bc29be458e6f210fa62f59b71d004
https://github.com/spotify/async-google-pubsub-client/blob/7d021528fa5bc29be458e6f210fa62f59b71d004/src/main/java/com/spotify/google/cloud/pubsub/client/Pubsub.java#L737-L739
train
spotify/async-google-pubsub-client
src/main/java/com/spotify/google/cloud/pubsub/client/Publisher.java
Publisher.publish
public CompletableFuture<String> publish(final String topic, final Message message) { final TopicQueue queue = topics.computeIfAbsent(topic, TopicQueue::new); final CompletableFuture<String> future = queue.send(message); listener.publishingMessage(this, topic, message, future); return future; }
java
public CompletableFuture<String> publish(final String topic, final Message message) { final TopicQueue queue = topics.computeIfAbsent(topic, TopicQueue::new); final CompletableFuture<String> future = queue.send(message); listener.publishingMessage(this, topic, message, future); return future; }
[ "public", "CompletableFuture", "<", "String", ">", "publish", "(", "final", "String", "topic", ",", "final", "Message", "message", ")", "{", "final", "TopicQueue", "queue", "=", "topics", ".", "computeIfAbsent", "(", "topic", ",", "TopicQueue", "::", "new", ...
Publish a message on a specific topic. @param topic The topic name to publish on. Note that this is the short name, not the fully qualified name including project. The project to publish on is configured using the {@link Builder}. @param message The message to publish. @return A future that is fulfilled with the res...
[ "Publish", "a", "message", "on", "a", "specific", "topic", "." ]
7d021528fa5bc29be458e6f210fa62f59b71d004
https://github.com/spotify/async-google-pubsub-client/blob/7d021528fa5bc29be458e6f210fa62f59b71d004/src/main/java/com/spotify/google/cloud/pubsub/client/Publisher.java#L180-L185
train
spotify/async-google-pubsub-client
src/main/java/com/spotify/google/cloud/pubsub/client/Publisher.java
Publisher.topicQueueSize
public int topicQueueSize(final String topic) { final TopicQueue topicQueue = this.topics.get(topic); return topicQueue == null ? 0 : topicQueue.queue.size(); }
java
public int topicQueueSize(final String topic) { final TopicQueue topicQueue = this.topics.get(topic); return topicQueue == null ? 0 : topicQueue.queue.size(); }
[ "public", "int", "topicQueueSize", "(", "final", "String", "topic", ")", "{", "final", "TopicQueue", "topicQueue", "=", "this", ".", "topics", ".", "get", "(", "topic", ")", ";", "return", "topicQueue", "==", "null", "?", "0", ":", "topicQueue", ".", "qu...
Get the current queue size for the given topic name. Returns 0 if the topic does not exist. @param topic the topic name
[ "Get", "the", "current", "queue", "size", "for", "the", "given", "topic", "name", ".", "Returns", "0", "if", "the", "topic", "does", "not", "exist", "." ]
7d021528fa5bc29be458e6f210fa62f59b71d004
https://github.com/spotify/async-google-pubsub-client/blob/7d021528fa5bc29be458e6f210fa62f59b71d004/src/main/java/com/spotify/google/cloud/pubsub/client/Publisher.java#L250-L253
train
spotify/async-google-pubsub-client
src/main/java/com/spotify/google/cloud/pubsub/client/Publisher.java
Publisher.sendPending
private void sendPending() { while (outstanding.get() < concurrency) { final TopicQueue queue = pendingTopics.poll(); if (queue == null) { return; } queue.pending = false; final int sent = queue.sendBatch(); // Did we send a whole batch? Then there might be more message...
java
private void sendPending() { while (outstanding.get() < concurrency) { final TopicQueue queue = pendingTopics.poll(); if (queue == null) { return; } queue.pending = false; final int sent = queue.sendBatch(); // Did we send a whole batch? Then there might be more message...
[ "private", "void", "sendPending", "(", ")", "{", "while", "(", "outstanding", ".", "get", "(", ")", "<", "concurrency", ")", "{", "final", "TopicQueue", "queue", "=", "pendingTopics", ".", "poll", "(", ")", ";", "if", "(", "queue", "==", "null", ")", ...
Send any pending topics.
[ "Send", "any", "pending", "topics", "." ]
7d021528fa5bc29be458e6f210fa62f59b71d004
https://github.com/spotify/async-google-pubsub-client/blob/7d021528fa5bc29be458e6f210fa62f59b71d004/src/main/java/com/spotify/google/cloud/pubsub/client/Publisher.java#L455-L471
train
Dynatrace/OneAgent-SDK-for-Java
samples/webrequest/src/main/java/com/dynatrace/oneagent/sdk/samples/webrequest/FakedWebserver.java
FakedWebserver.serve
private void serve(HttpRequest request, HttpResponse response) { String url = request.getUri(); System.out.println("[Server] serve " + url); IncomingWebRequestTracer incomingWebrequestTracer = oneAgentSDK.traceIncomingWebRequest(webAppInfo, url, request.getMethod()); // add request header, parameter and remote...
java
private void serve(HttpRequest request, HttpResponse response) { String url = request.getUri(); System.out.println("[Server] serve " + url); IncomingWebRequestTracer incomingWebrequestTracer = oneAgentSDK.traceIncomingWebRequest(webAppInfo, url, request.getMethod()); // add request header, parameter and remote...
[ "private", "void", "serve", "(", "HttpRequest", "request", ",", "HttpResponse", "response", ")", "{", "String", "url", "=", "request", ".", "getUri", "(", ")", ";", "System", ".", "out", ".", "println", "(", "\"[Server] serve \"", "+", "url", ")", ";", "...
faked http request handling. shows usage of OneAgent SDK's incoming webrequest API
[ "faked", "http", "request", "handling", ".", "shows", "usage", "of", "OneAgent", "SDK", "s", "incoming", "webrequest", "API" ]
a554cd971179faf8e598dd93df342a603d39e734
https://github.com/Dynatrace/OneAgent-SDK-for-Java/blob/a554cd971179faf8e598dd93df342a603d39e734/samples/webrequest/src/main/java/com/dynatrace/oneagent/sdk/samples/webrequest/FakedWebserver.java#L110-L141
train
Dynatrace/OneAgent-SDK-for-Java
samples/messaging/src/main/java/com/dynatrace/oneagent/sdk/samples/messaging/MessagingApp.java
MessagingApp.receiveMessage
private void receiveMessage() { MessagingSystemInfo messagingSystemInfo = oneAgentSdk.createMessagingSystemInfo("DynatraceSample", "theQueue", MessageDestinationType.QUEUE, ChannelType.IN_PROCESS, null); IncomingMessageReceiveTracer incomingMessageReceiveTracer = oneAgentSdk.traceIncomingMessageReceive(messagingSys...
java
private void receiveMessage() { MessagingSystemInfo messagingSystemInfo = oneAgentSdk.createMessagingSystemInfo("DynatraceSample", "theQueue", MessageDestinationType.QUEUE, ChannelType.IN_PROCESS, null); IncomingMessageReceiveTracer incomingMessageReceiveTracer = oneAgentSdk.traceIncomingMessageReceive(messagingSys...
[ "private", "void", "receiveMessage", "(", ")", "{", "MessagingSystemInfo", "messagingSystemInfo", "=", "oneAgentSdk", ".", "createMessagingSystemInfo", "(", "\"DynatraceSample\"", ",", "\"theQueue\"", ",", "MessageDestinationType", ".", "QUEUE", ",", "ChannelType", ".", ...
shows how to trace a blocking receive of a message
[ "shows", "how", "to", "trace", "a", "blocking", "receive", "of", "a", "message" ]
a554cd971179faf8e598dd93df342a603d39e734
https://github.com/Dynatrace/OneAgent-SDK-for-Java/blob/a554cd971179faf8e598dd93df342a603d39e734/samples/messaging/src/main/java/com/dynatrace/oneagent/sdk/samples/messaging/MessagingApp.java#L122-L151
train
rampo/UpdateChecker
library/src/main/java/com/rampo/updatechecker/UpdateChecker.java
UpdateChecker.versionDownloadableFound
@Override public void versionDownloadableFound(String versionDownloadable) { if (Comparator.isVersionDownloadableNewer(mActivity, versionDownloadable)) { if (hasToShowNotice(versionDownloadable) && !hasUserTappedToNotShowNoticeAgain(versionDownloadable)) { mLibraryResultCallaback...
java
@Override public void versionDownloadableFound(String versionDownloadable) { if (Comparator.isVersionDownloadableNewer(mActivity, versionDownloadable)) { if (hasToShowNotice(versionDownloadable) && !hasUserTappedToNotShowNoticeAgain(versionDownloadable)) { mLibraryResultCallaback...
[ "@", "Override", "public", "void", "versionDownloadableFound", "(", "String", "versionDownloadable", ")", "{", "if", "(", "Comparator", ".", "isVersionDownloadableNewer", "(", "mActivity", ",", "versionDownloadable", ")", ")", "{", "if", "(", "hasToShowNotice", "(",...
If the library found a version available on the Store, and it's different from the installed one, notify it to the user. @param versionDownloadable String to compare to the version installed of the app.
[ "If", "the", "library", "found", "a", "version", "available", "on", "the", "Store", "and", "it", "s", "different", "from", "the", "installed", "one", "notify", "it", "to", "the", "user", "." ]
738da234d46396b6396e15e7261f38b0cabf9913
https://github.com/rampo/UpdateChecker/blob/738da234d46396b6396e15e7261f38b0cabf9913/library/src/main/java/com/rampo/updatechecker/UpdateChecker.java#L137-L149
train
rampo/UpdateChecker
library/src/main/java/com/rampo/updatechecker/UpdateChecker.java
UpdateChecker.hasUserTappedToNotShowNoticeAgain
private boolean hasUserTappedToNotShowNoticeAgain(String versionDownloadable) { SharedPreferences prefs = mActivity.getSharedPreferences(PREFS_FILENAME, 0); String prefKey = DONT_SHOW_AGAIN_PREF_KEY + versionDownloadable; return prefs.getBoolean(prefKey, false); }
java
private boolean hasUserTappedToNotShowNoticeAgain(String versionDownloadable) { SharedPreferences prefs = mActivity.getSharedPreferences(PREFS_FILENAME, 0); String prefKey = DONT_SHOW_AGAIN_PREF_KEY + versionDownloadable; return prefs.getBoolean(prefKey, false); }
[ "private", "boolean", "hasUserTappedToNotShowNoticeAgain", "(", "String", "versionDownloadable", ")", "{", "SharedPreferences", "prefs", "=", "mActivity", ".", "getSharedPreferences", "(", "PREFS_FILENAME", ",", "0", ")", ";", "String", "prefKey", "=", "DONT_SHOW_AGAIN_...
Get if the user has tapped on "No, thanks" button on dialog for this downloable version. @param versionDownloadable version downloadable from the Store. @see com.rampo.updatechecker.notice.Dialog#userHasTappedToNotShowNoticeAgain(android.content.Context, String)
[ "Get", "if", "the", "user", "has", "tapped", "on", "No", "thanks", "button", "on", "dialog", "for", "this", "downloable", "version", "." ]
738da234d46396b6396e15e7261f38b0cabf9913
https://github.com/rampo/UpdateChecker/blob/738da234d46396b6396e15e7261f38b0cabf9913/library/src/main/java/com/rampo/updatechecker/UpdateChecker.java#L251-L255
train
rampo/UpdateChecker
library/src/main/java/com/rampo/updatechecker/UpdateChecker.java
UpdateChecker.saveNumberOfChecksForUpdatedVersion
private void saveNumberOfChecksForUpdatedVersion(String versionDownloadable, int mChecksMade) { mChecksMade++; SharedPreferences prefs = mActivity.getSharedPreferences(PREFS_FILENAME, 0); SharedPreferences.Editor editor = prefs.edit(); editor.putInt(SUCCESSFUL_CHEKS_PREF_KEY + versionDow...
java
private void saveNumberOfChecksForUpdatedVersion(String versionDownloadable, int mChecksMade) { mChecksMade++; SharedPreferences prefs = mActivity.getSharedPreferences(PREFS_FILENAME, 0); SharedPreferences.Editor editor = prefs.edit(); editor.putInt(SUCCESSFUL_CHEKS_PREF_KEY + versionDow...
[ "private", "void", "saveNumberOfChecksForUpdatedVersion", "(", "String", "versionDownloadable", ",", "int", "mChecksMade", ")", "{", "mChecksMade", "++", ";", "SharedPreferences", "prefs", "=", "mActivity", ".", "getSharedPreferences", "(", "PREFS_FILENAME", ",", "0", ...
Update number of checks for this version downloadable from the Store.
[ "Update", "number", "of", "checks", "for", "this", "version", "downloadable", "from", "the", "Store", "." ]
738da234d46396b6396e15e7261f38b0cabf9913
https://github.com/rampo/UpdateChecker/blob/738da234d46396b6396e15e7261f38b0cabf9913/library/src/main/java/com/rampo/updatechecker/UpdateChecker.java#L276-L283
train
rampo/UpdateChecker
library/src/main/java/com/rampo/updatechecker/Comparator.java
Comparator.isVersionDownloadableNewer
public static boolean isVersionDownloadableNewer(Activity mActivity, String versionDownloadable) { String versionInstalled = null; try { versionInstalled = mActivity.getPackageManager().getPackageInfo(mActivity.getPackageName(), 0).versionName; } catch (PackageManager.NameNotFoundExc...
java
public static boolean isVersionDownloadableNewer(Activity mActivity, String versionDownloadable) { String versionInstalled = null; try { versionInstalled = mActivity.getPackageManager().getPackageInfo(mActivity.getPackageName(), 0).versionName; } catch (PackageManager.NameNotFoundExc...
[ "public", "static", "boolean", "isVersionDownloadableNewer", "(", "Activity", "mActivity", ",", "String", "versionDownloadable", ")", "{", "String", "versionInstalled", "=", "null", ";", "try", "{", "versionInstalled", "=", "mActivity", ".", "getPackageManager", "(", ...
Compare the string versionDownloadable to the version installed of the app. @param versionDownloadable String to compare to the version installed of the app.
[ "Compare", "the", "string", "versionDownloadable", "to", "the", "version", "installed", "of", "the", "app", "." ]
738da234d46396b6396e15e7261f38b0cabf9913
https://github.com/rampo/UpdateChecker/blob/738da234d46396b6396e15e7261f38b0cabf9913/library/src/main/java/com/rampo/updatechecker/Comparator.java#L27-L38
train
rampo/UpdateChecker
library/src/main/java/com/rampo/updatechecker/utils/Network.java
Network.isAvailable
public static boolean isAvailable(Context context) { boolean connected = false; ConnectivityManager cm = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE); if (cm != null) { NetworkInfo ni = cm.getActiveNetworkInfo(); if (ni != null) { ...
java
public static boolean isAvailable(Context context) { boolean connected = false; ConnectivityManager cm = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE); if (cm != null) { NetworkInfo ni = cm.getActiveNetworkInfo(); if (ni != null) { ...
[ "public", "static", "boolean", "isAvailable", "(", "Context", "context", ")", "{", "boolean", "connected", "=", "false", ";", "ConnectivityManager", "cm", "=", "(", "ConnectivityManager", ")", "context", ".", "getSystemService", "(", "Context", ".", "CONNECTIVITY_...
Check if a network is available
[ "Check", "if", "a", "network", "is", "available" ]
738da234d46396b6396e15e7261f38b0cabf9913
https://github.com/rampo/UpdateChecker/blob/738da234d46396b6396e15e7261f38b0cabf9913/library/src/main/java/com/rampo/updatechecker/utils/Network.java#L14-L24
train
rampo/UpdateChecker
library/src/main/java/com/rampo/updatechecker/ASyncCheck.java
ASyncCheck.onPostExecute
@Override protected void onPostExecute(Integer result) { if (result == VERSION_DOWNLOADABLE_FOUND) { mResultInterface.versionDownloadableFound(mVersionDownloadable); } else if (result == NETWORK_ERROR) { mResultInterface.networkError(); Network.logConnectionError(...
java
@Override protected void onPostExecute(Integer result) { if (result == VERSION_DOWNLOADABLE_FOUND) { mResultInterface.versionDownloadableFound(mVersionDownloadable); } else if (result == NETWORK_ERROR) { mResultInterface.networkError(); Network.logConnectionError(...
[ "@", "Override", "protected", "void", "onPostExecute", "(", "Integer", "result", ")", "{", "if", "(", "result", "==", "VERSION_DOWNLOADABLE_FOUND", ")", "{", "mResultInterface", ".", "versionDownloadableFound", "(", "mVersionDownloadable", ")", ";", "}", "else", "...
Return to UpdateChecker class to work with the versionDownloadable if the library found it. @param result
[ "Return", "to", "UpdateChecker", "class", "to", "work", "with", "the", "versionDownloadable", "if", "the", "library", "found", "it", "." ]
738da234d46396b6396e15e7261f38b0cabf9913
https://github.com/rampo/UpdateChecker/blob/738da234d46396b6396e15e7261f38b0cabf9913/library/src/main/java/com/rampo/updatechecker/ASyncCheck.java#L134-L151
train
bazaarvoice/ostrich
zookeeper/registry/src/main/java/com/bazaarvoice/ostrich/registry/zookeeper/ZooKeeperServiceRegistry.java
ZooKeeperServiceRegistry.makeServicePath
public static String makeServicePath(String serviceName) { checkNotNull(serviceName); checkArgument(!"".equals(serviceName)); return ZKPaths.makePath(ROOT_SERVICES_PATH, serviceName); }
java
public static String makeServicePath(String serviceName) { checkNotNull(serviceName); checkArgument(!"".equals(serviceName)); return ZKPaths.makePath(ROOT_SERVICES_PATH, serviceName); }
[ "public", "static", "String", "makeServicePath", "(", "String", "serviceName", ")", "{", "checkNotNull", "(", "serviceName", ")", ";", "checkArgument", "(", "!", "\"\"", ".", "equals", "(", "serviceName", ")", ")", ";", "return", "ZKPaths", ".", "makePath", ...
Construct the path in ZooKeeper to where a service's children live. @param serviceName The name of the service to get the ZooKeeper path for. @return The ZooKeeper path.
[ "Construct", "the", "path", "in", "ZooKeeper", "to", "where", "a", "service", "s", "children", "live", "." ]
13591867870ab23445253f11fc872662a8028191
https://github.com/bazaarvoice/ostrich/blob/13591867870ab23445253f11fc872662a8028191/zookeeper/registry/src/main/java/com/bazaarvoice/ostrich/registry/zookeeper/ZooKeeperServiceRegistry.java#L153-L157
train
bazaarvoice/ostrich
core/src/main/java/com/bazaarvoice/ostrich/pool/ServiceCachingPolicyBuilder.java
ServiceCachingPolicyBuilder.withMaxServiceInstanceIdleTime
public ServiceCachingPolicyBuilder withMaxServiceInstanceIdleTime(int maxServiceInstanceIdleTime, TimeUnit unit) { checkState(maxServiceInstanceIdleTime > 0); checkNotNull(unit); _maxServiceInstanceIdleTimeNanos = unit.toNanos(maxServiceInstanceIdleTime); return this; }
java
public ServiceCachingPolicyBuilder withMaxServiceInstanceIdleTime(int maxServiceInstanceIdleTime, TimeUnit unit) { checkState(maxServiceInstanceIdleTime > 0); checkNotNull(unit); _maxServiceInstanceIdleTimeNanos = unit.toNanos(maxServiceInstanceIdleTime); return this; }
[ "public", "ServiceCachingPolicyBuilder", "withMaxServiceInstanceIdleTime", "(", "int", "maxServiceInstanceIdleTime", ",", "TimeUnit", "unit", ")", "{", "checkState", "(", "maxServiceInstanceIdleTime", ">", "0", ")", ";", "checkNotNull", "(", "unit", ")", ";", "_maxServi...
Set the amount of time a cached instance is allowed to sit idle in the cache before being eligible for expiration. If never called, cached instances will not expire solely due to idle time. @param maxServiceInstanceIdleTime The time an instance may be idle before allowed to expire. @param unit T...
[ "Set", "the", "amount", "of", "time", "a", "cached", "instance", "is", "allowed", "to", "sit", "idle", "in", "the", "cache", "before", "being", "eligible", "for", "expiration", ".", "If", "never", "called", "cached", "instances", "will", "not", "expire", "...
13591867870ab23445253f11fc872662a8028191
https://github.com/bazaarvoice/ostrich/blob/13591867870ab23445253f11fc872662a8028191/core/src/main/java/com/bazaarvoice/ostrich/pool/ServiceCachingPolicyBuilder.java#L102-L108
train
bazaarvoice/ostrich
core/src/main/java/com/bazaarvoice/ostrich/pool/MultiThreadedClientServiceCache.java
MultiThreadedClientServiceCache.destroyService
private void destroyService(ServiceHandle<S> serviceHandle) { try { _serviceFactory.destroy(serviceHandle.getEndPoint(), serviceHandle.getService()); } catch (Exception e) { // this should not happen, but if it does, swallow the exception and log it LOG.warn("Error de...
java
private void destroyService(ServiceHandle<S> serviceHandle) { try { _serviceFactory.destroy(serviceHandle.getEndPoint(), serviceHandle.getService()); } catch (Exception e) { // this should not happen, but if it does, swallow the exception and log it LOG.warn("Error de...
[ "private", "void", "destroyService", "(", "ServiceHandle", "<", "S", ">", "serviceHandle", ")", "{", "try", "{", "_serviceFactory", ".", "destroy", "(", "serviceHandle", ".", "getEndPoint", "(", ")", ",", "serviceHandle", ".", "getService", "(", ")", ")", ";...
Destroys a service handle quietly, swallows any exception occurred @param serviceHandle to destroy
[ "Destroys", "a", "service", "handle", "quietly", "swallows", "any", "exception", "occurred" ]
13591867870ab23445253f11fc872662a8028191
https://github.com/bazaarvoice/ostrich/blob/13591867870ab23445253f11fc872662a8028191/core/src/main/java/com/bazaarvoice/ostrich/pool/MultiThreadedClientServiceCache.java#L353-L360
train
bazaarvoice/ostrich
core/src/main/java/com/bazaarvoice/ostrich/PartitionContextBuilder.java
PartitionContextBuilder.put
public PartitionContextBuilder put(String key, Object value) { _map.put(key, value); return this; }
java
public PartitionContextBuilder put(String key, Object value) { _map.put(key, value); return this; }
[ "public", "PartitionContextBuilder", "put", "(", "String", "key", ",", "Object", "value", ")", "{", "_map", ".", "put", "(", "key", ",", "value", ")", ";", "return", "this", ";", "}" ]
Adds the specified key and value to the partition context. Null keys or values and duplicate keys are not allowed. @return this
[ "Adds", "the", "specified", "key", "and", "value", "to", "the", "partition", "context", ".", "Null", "keys", "or", "values", "and", "duplicate", "keys", "are", "not", "allowed", "." ]
13591867870ab23445253f11fc872662a8028191
https://github.com/bazaarvoice/ostrich/blob/13591867870ab23445253f11fc872662a8028191/core/src/main/java/com/bazaarvoice/ostrich/PartitionContextBuilder.java#L41-L44
train
bazaarvoice/ostrich
core/src/main/java/com/bazaarvoice/ostrich/metrics/Metrics.java
Metrics.forInstance
public static InstanceMetrics forInstance(MetricRegistry metrics, Object instance, String serviceName) { return new InstanceMetrics(metrics, instance, serviceName); }
java
public static InstanceMetrics forInstance(MetricRegistry metrics, Object instance, String serviceName) { return new InstanceMetrics(metrics, instance, serviceName); }
[ "public", "static", "InstanceMetrics", "forInstance", "(", "MetricRegistry", "metrics", ",", "Object", "instance", ",", "String", "serviceName", ")", "{", "return", "new", "InstanceMetrics", "(", "metrics", ",", "instance", ",", "serviceName", ")", ";", "}" ]
Create a metrics instance that corresponds to a single instance of a class. This is useful for cases where there exists one instance per service. For example in a ServicePool.
[ "Create", "a", "metrics", "instance", "that", "corresponds", "to", "a", "single", "instance", "of", "a", "class", ".", "This", "is", "useful", "for", "cases", "where", "there", "exists", "one", "instance", "per", "service", ".", "For", "example", "in", "a"...
13591867870ab23445253f11fc872662a8028191
https://github.com/bazaarvoice/ostrich/blob/13591867870ab23445253f11fc872662a8028191/core/src/main/java/com/bazaarvoice/ostrich/metrics/Metrics.java#L39-L41
train
bazaarvoice/ostrich
core/src/main/java/com/bazaarvoice/ostrich/pool/AnnotationPartitionContextSupplier.java
AnnotationPartitionContextSupplier.collectPartitionKeyAnnotations
private String[] collectPartitionKeyAnnotations(Method method) { Annotation[][] annotations = method.getParameterAnnotations(); String[] keyMappings = new String[annotations.length]; boolean keyMappingFound = false; Map<String, Integer> unique = Maps.newHashMap(); for (int i = 0;...
java
private String[] collectPartitionKeyAnnotations(Method method) { Annotation[][] annotations = method.getParameterAnnotations(); String[] keyMappings = new String[annotations.length]; boolean keyMappingFound = false; Map<String, Integer> unique = Maps.newHashMap(); for (int i = 0;...
[ "private", "String", "[", "]", "collectPartitionKeyAnnotations", "(", "Method", "method", ")", "{", "Annotation", "[", "]", "[", "]", "annotations", "=", "method", ".", "getParameterAnnotations", "(", ")", ";", "String", "[", "]", "keyMappings", "=", "new", ...
Returns an array indexed by argument index with the value of the @PartitionKey annotation for each argument, or null if no arguments are annotated with @PartitionKey.
[ "Returns", "an", "array", "indexed", "by", "argument", "index", "with", "the", "value", "of", "the" ]
13591867870ab23445253f11fc872662a8028191
https://github.com/bazaarvoice/ostrich/blob/13591867870ab23445253f11fc872662a8028191/core/src/main/java/com/bazaarvoice/ostrich/pool/AnnotationPartitionContextSupplier.java#L81-L99
train
bazaarvoice/ostrich
core/src/main/java/com/bazaarvoice/ostrich/pool/SingleThreadedClientServiceCache.java
SingleThreadedClientServiceCache.checkIn
@Override public void checkIn(ServiceHandle<S> handle) throws Exception { checkNotNull(handle); S service = handle.getService(); ServiceEndPoint endPoint = handle.getEndPoint(); // Figure out if we should check this revision in. If it was created before the last known invalid revi...
java
@Override public void checkIn(ServiceHandle<S> handle) throws Exception { checkNotNull(handle); S service = handle.getService(); ServiceEndPoint endPoint = handle.getEndPoint(); // Figure out if we should check this revision in. If it was created before the last known invalid revi...
[ "@", "Override", "public", "void", "checkIn", "(", "ServiceHandle", "<", "S", ">", "handle", ")", "throws", "Exception", "{", "checkNotNull", "(", "handle", ")", ";", "S", "service", "=", "handle", ".", "getService", "(", ")", ";", "ServiceEndPoint", "endP...
Returns a service instance for an end point to the cache so that it may be used by other users. @param handle The service handle that is being checked in. @throws Exception Never.
[ "Returns", "a", "service", "instance", "for", "an", "end", "point", "to", "the", "cache", "so", "that", "it", "may", "be", "used", "by", "other", "users", "." ]
13591867870ab23445253f11fc872662a8028191
https://github.com/bazaarvoice/ostrich/blob/13591867870ab23445253f11fc872662a8028191/core/src/main/java/com/bazaarvoice/ostrich/pool/SingleThreadedClientServiceCache.java#L197-L214
train
bazaarvoice/ostrich
core/src/main/java/com/bazaarvoice/ostrich/partition/ConsistentHashPartitionFilter.java
ConsistentHashPartitionFilter.computeHashCodes
private List<Integer> computeHashCodes(String endPointId) { // Use the libketama approach of using MD5 hashes to generate 32-bit random values. This assigns a set of // randomly generated ranges to each end point. The individual ranges may vary widely in size, but, with // sufficient # of entr...
java
private List<Integer> computeHashCodes(String endPointId) { // Use the libketama approach of using MD5 hashes to generate 32-bit random values. This assigns a set of // randomly generated ranges to each end point. The individual ranges may vary widely in size, but, with // sufficient # of entr...
[ "private", "List", "<", "Integer", ">", "computeHashCodes", "(", "String", "endPointId", ")", "{", "// Use the libketama approach of using MD5 hashes to generate 32-bit random values. This assigns a set of", "// randomly generated ranges to each end point. The individual ranges may vary wi...
Returns a list of pseudo-random 32-bit values derived from the specified end point ID.
[ "Returns", "a", "list", "of", "pseudo", "-", "random", "32", "-", "bit", "values", "derived", "from", "the", "specified", "end", "point", "ID", "." ]
13591867870ab23445253f11fc872662a8028191
https://github.com/bazaarvoice/ostrich/blob/13591867870ab23445253f11fc872662a8028191/core/src/main/java/com/bazaarvoice/ostrich/partition/ConsistentHashPartitionFilter.java#L144-L160
train
bazaarvoice/ostrich
core/src/main/java/com/bazaarvoice/ostrich/pool/ServicePoolProxies.java
ServicePoolProxies.close
public static <S> void close(S dynamicProxy) { // Use closeQuietly since ServicePool.close() doesn't throw IOException. try { Closeables.close(getPool(dynamicProxy), true); } catch (IOException e) { throw new AssertionError(); // close swallows IOExceptions } ...
java
public static <S> void close(S dynamicProxy) { // Use closeQuietly since ServicePool.close() doesn't throw IOException. try { Closeables.close(getPool(dynamicProxy), true); } catch (IOException e) { throw new AssertionError(); // close swallows IOExceptions } ...
[ "public", "static", "<", "S", ">", "void", "close", "(", "S", "dynamicProxy", ")", "{", "// Use closeQuietly since ServicePool.close() doesn't throw IOException.", "try", "{", "Closeables", ".", "close", "(", "getPool", "(", "dynamicProxy", ")", ",", "true", ")", ...
Closes the service pool associated with the specified dynamic service proxy. @param dynamicProxy A service pool dynamic proxy created by {@link ServicePoolBuilder#buildProxy}. @param <S> The service interface type.
[ "Closes", "the", "service", "pool", "associated", "with", "the", "specified", "dynamic", "service", "proxy", "." ]
13591867870ab23445253f11fc872662a8028191
https://github.com/bazaarvoice/ostrich/blob/13591867870ab23445253f11fc872662a8028191/core/src/main/java/com/bazaarvoice/ostrich/pool/ServicePoolProxies.java#L33-L40
train
bazaarvoice/ostrich
core/src/main/java/com/bazaarvoice/ostrich/discovery/ConfiguredFixedHostDiscoverySource.java
ConfiguredFixedHostDiscoverySource.serialize
@SuppressWarnings("UnusedParameters") protected String serialize(String serviceName, String id, Payload payload) { return String.valueOf(payload); }
java
@SuppressWarnings("UnusedParameters") protected String serialize(String serviceName, String id, Payload payload) { return String.valueOf(payload); }
[ "@", "SuppressWarnings", "(", "\"UnusedParameters\"", ")", "protected", "String", "serialize", "(", "String", "serviceName", ",", "String", "id", ",", "Payload", "payload", ")", "{", "return", "String", ".", "valueOf", "(", "payload", ")", ";", "}" ]
Subclasses may override this to customize the persistent format of the payload.
[ "Subclasses", "may", "override", "this", "to", "customize", "the", "persistent", "format", "of", "the", "payload", "." ]
13591867870ab23445253f11fc872662a8028191
https://github.com/bazaarvoice/ostrich/blob/13591867870ab23445253f11fc872662a8028191/core/src/main/java/com/bazaarvoice/ostrich/discovery/ConfiguredFixedHostDiscoverySource.java#L64-L67
train
Ekryd/sortpom
sorter/src/main/java/sortpom/wrapper/ElementUtil.java
ElementUtil.getDeepName
static String getDeepName(final Element element) { if (element == null) { return ""; } return getDeepName(element.getParentElement()) + '/' + element.getName(); }
java
static String getDeepName(final Element element) { if (element == null) { return ""; } return getDeepName(element.getParentElement()) + '/' + element.getName(); }
[ "static", "String", "getDeepName", "(", "final", "Element", "element", ")", "{", "if", "(", "element", "==", "null", ")", "{", "return", "\"\"", ";", "}", "return", "getDeepName", "(", "element", ".", "getParentElement", "(", ")", ")", "+", "'", "'", "...
Returns fully qualified name for an Xml element.
[ "Returns", "fully", "qualified", "name", "for", "an", "Xml", "element", "." ]
27056420803ed04001e4149b04a719fbac774c5d
https://github.com/Ekryd/sortpom/blob/27056420803ed04001e4149b04a719fbac774c5d/sorter/src/main/java/sortpom/wrapper/ElementUtil.java#L17-L22
train
Ekryd/sortpom
sorter/src/main/java/sortpom/wrapper/ElementUtil.java
ElementUtil.isElementParentName
static boolean isElementParentName(Element element, String name) { Element parent = element.getParentElement(); if (parent == null) { return false; } return isElementName(parent, name); }
java
static boolean isElementParentName(Element element, String name) { Element parent = element.getParentElement(); if (parent == null) { return false; } return isElementName(parent, name); }
[ "static", "boolean", "isElementParentName", "(", "Element", "element", ",", "String", "name", ")", "{", "Element", "parent", "=", "element", ".", "getParentElement", "(", ")", ";", "if", "(", "parent", "==", "null", ")", "{", "return", "false", ";", "}", ...
Returns true if an elements parents name is same as argument
[ "Returns", "true", "if", "an", "elements", "parents", "name", "is", "same", "as", "argument" ]
27056420803ed04001e4149b04a719fbac774c5d
https://github.com/Ekryd/sortpom/blob/27056420803ed04001e4149b04a719fbac774c5d/sorter/src/main/java/sortpom/wrapper/ElementUtil.java#L25-L31
train
Ekryd/sortpom
sorter/src/main/java/sortpom/wrapper/operation/HierarchyWrapper.java
HierarchyWrapper.createWrappedStructure
void createWrappedStructure(final WrapperFactory factory) { HierarchyWrapper currentWrapper = null; for (Content child : castToContentList(elementContent)) { Wrapper<?> wrapper = factory.create(child); if (wrapper instanceof SingleNewlineInTextWrapper) { continue;...
java
void createWrappedStructure(final WrapperFactory factory) { HierarchyWrapper currentWrapper = null; for (Content child : castToContentList(elementContent)) { Wrapper<?> wrapper = factory.create(child); if (wrapper instanceof SingleNewlineInTextWrapper) { continue;...
[ "void", "createWrappedStructure", "(", "final", "WrapperFactory", "factory", ")", "{", "HierarchyWrapper", "currentWrapper", "=", "null", ";", "for", "(", "Content", "child", ":", "castToContentList", "(", "elementContent", ")", ")", "{", "Wrapper", "<", "?", ">...
Traverses the initial xml element wrapper and builds hierarchy
[ "Traverses", "the", "initial", "xml", "element", "wrapper", "and", "builds", "hierarchy" ]
27056420803ed04001e4149b04a719fbac774c5d
https://github.com/Ekryd/sortpom/blob/27056420803ed04001e4149b04a719fbac774c5d/sorter/src/main/java/sortpom/wrapper/operation/HierarchyWrapper.java#L36-L54
train
Ekryd/sortpom
sorter/src/main/java/sortpom/wrapper/operation/HierarchyWrapper.java
HierarchyWrapper.processOperation
void processOperation(HierarchyWrapperOperation operation) { // Hook for start operation.startOfProcess(); // Hook to process other content (newlines and comments) otherContentList.forEach(operation::processOtherContent); if (elementContent != null && elementContent.isContentEl...
java
void processOperation(HierarchyWrapperOperation operation) { // Hook for start operation.startOfProcess(); // Hook to process other content (newlines and comments) otherContentList.forEach(operation::processOtherContent); if (elementContent != null && elementContent.isContentEl...
[ "void", "processOperation", "(", "HierarchyWrapperOperation", "operation", ")", "{", "// Hook for start", "operation", ".", "startOfProcess", "(", ")", ";", "// Hook to process other content (newlines and comments)", "otherContentList", ".", "forEach", "(", "operation", "::",...
Template method to traverse xml hierarchy
[ "Template", "method", "to", "traverse", "xml", "hierarchy" ]
27056420803ed04001e4149b04a719fbac774c5d
https://github.com/Ekryd/sortpom/blob/27056420803ed04001e4149b04a719fbac774c5d/sorter/src/main/java/sortpom/wrapper/operation/HierarchyWrapper.java#L71-L95
train
Ekryd/sortpom
sorter/src/main/java/sortpom/processinstruction/XmlProcessingInstructionParser.java
XmlProcessingInstructionParser.scanForIgnoredSections
public void scanForIgnoredSections(String originalXml) { this.originalXml = originalXml; SortpomPiScanner sortpomPiScanner = new SortpomPiScanner(logger); sortpomPiScanner.scan(originalXml); if (sortpomPiScanner.isScanError()) { throw new FailureException(sortpomPiScanner.get...
java
public void scanForIgnoredSections(String originalXml) { this.originalXml = originalXml; SortpomPiScanner sortpomPiScanner = new SortpomPiScanner(logger); sortpomPiScanner.scan(originalXml); if (sortpomPiScanner.isScanError()) { throw new FailureException(sortpomPiScanner.get...
[ "public", "void", "scanForIgnoredSections", "(", "String", "originalXml", ")", "{", "this", ".", "originalXml", "=", "originalXml", ";", "SortpomPiScanner", "sortpomPiScanner", "=", "new", "SortpomPiScanner", "(", "logger", ")", ";", "sortpomPiScanner", ".", "scan",...
Checks if pom file contains any processing instructions
[ "Checks", "if", "pom", "file", "contains", "any", "processing", "instructions" ]
27056420803ed04001e4149b04a719fbac774c5d
https://github.com/Ekryd/sortpom/blob/27056420803ed04001e4149b04a719fbac774c5d/sorter/src/main/java/sortpom/processinstruction/XmlProcessingInstructionParser.java#L23-L31
train
Ekryd/sortpom
sorter/src/main/java/sortpom/parameter/IndentCharacters.java
IndentCharacters.getIndentCharacters
public String getIndentCharacters() { if (nrOfIndentSpace == 0) { return ""; } if (nrOfIndentSpace == INDENT_TAB) { return "\t"; } if (nrOfIndentSpace < INDENT_TAB || nrOfIndentSpace > MAX_INDENT_SPACES) { throw new FailureException("nrOfIndent...
java
public String getIndentCharacters() { if (nrOfIndentSpace == 0) { return ""; } if (nrOfIndentSpace == INDENT_TAB) { return "\t"; } if (nrOfIndentSpace < INDENT_TAB || nrOfIndentSpace > MAX_INDENT_SPACES) { throw new FailureException("nrOfIndent...
[ "public", "String", "getIndentCharacters", "(", ")", "{", "if", "(", "nrOfIndentSpace", "==", "0", ")", "{", "return", "\"\"", ";", "}", "if", "(", "nrOfIndentSpace", "==", "INDENT_TAB", ")", "{", "return", "\"\\t\"", ";", "}", "if", "(", "nrOfIndentSpace"...
Gets the indent characters from parameter. @return the indent characters
[ "Gets", "the", "indent", "characters", "from", "parameter", "." ]
27056420803ed04001e4149b04a719fbac774c5d
https://github.com/Ekryd/sortpom/blob/27056420803ed04001e4149b04a719fbac774c5d/sorter/src/main/java/sortpom/parameter/IndentCharacters.java#L28-L41
train
Ekryd/sortpom
sorter/src/main/java/sortpom/util/FileUtil.java
FileUtil.setup
public void setup(PluginParameters parameters) { this.pomFile = parameters.pomFile; this.backupFileExtension = parameters.backupFileExtension; this.encoding = parameters.encoding; this.customSortOrderFile = parameters.customSortOrderFile; this.predefinedSortOrder = parameters.pre...
java
public void setup(PluginParameters parameters) { this.pomFile = parameters.pomFile; this.backupFileExtension = parameters.backupFileExtension; this.encoding = parameters.encoding; this.customSortOrderFile = parameters.customSortOrderFile; this.predefinedSortOrder = parameters.pre...
[ "public", "void", "setup", "(", "PluginParameters", "parameters", ")", "{", "this", ".", "pomFile", "=", "parameters", ".", "pomFile", ";", "this", ".", "backupFileExtension", "=", "parameters", ".", "backupFileExtension", ";", "this", ".", "encoding", "=", "p...
Initializes the class with sortpom parameters.
[ "Initializes", "the", "class", "with", "sortpom", "parameters", "." ]
27056420803ed04001e4149b04a719fbac774c5d
https://github.com/Ekryd/sortpom/blob/27056420803ed04001e4149b04a719fbac774c5d/sorter/src/main/java/sortpom/util/FileUtil.java#L30-L37
train
Ekryd/sortpom
sorter/src/main/java/sortpom/util/FileUtil.java
FileUtil.getPomFileContent
public String getPomFileContent() { try (InputStream inputStream = new FileInputStream(pomFile)) { return IOUtils.toString(inputStream, encoding); } catch (UnsupportedCharsetException ex) { throw new FailureException("Could not handle encoding: " + encoding, ex); } catch ...
java
public String getPomFileContent() { try (InputStream inputStream = new FileInputStream(pomFile)) { return IOUtils.toString(inputStream, encoding); } catch (UnsupportedCharsetException ex) { throw new FailureException("Could not handle encoding: " + encoding, ex); } catch ...
[ "public", "String", "getPomFileContent", "(", ")", "{", "try", "(", "InputStream", "inputStream", "=", "new", "FileInputStream", "(", "pomFile", ")", ")", "{", "return", "IOUtils", ".", "toString", "(", "inputStream", ",", "encoding", ")", ";", "}", "catch",...
Loads the pom file that will be sorted. @return Content of the file
[ "Loads", "the", "pom", "file", "that", "will", "be", "sorted", "." ]
27056420803ed04001e4149b04a719fbac774c5d
https://github.com/Ekryd/sortpom/blob/27056420803ed04001e4149b04a719fbac774c5d/sorter/src/main/java/sortpom/util/FileUtil.java#L72-L80
train
Ekryd/sortpom
sorter/src/main/java/sortpom/util/FileUtil.java
FileUtil.getDefaultSortOrderXml
private String getDefaultSortOrderXml() throws IOException { CheckedSupplier<InputStream, IOException> createStreamFunc = () -> { if (customSortOrderFile != null) { UrlWrapper urlWrapper = new UrlWrapper(customSortOrderFile); if (urlWrapper.isUrl()) { ...
java
private String getDefaultSortOrderXml() throws IOException { CheckedSupplier<InputStream, IOException> createStreamFunc = () -> { if (customSortOrderFile != null) { UrlWrapper urlWrapper = new UrlWrapper(customSortOrderFile); if (urlWrapper.isUrl()) { ...
[ "private", "String", "getDefaultSortOrderXml", "(", ")", "throws", "IOException", "{", "CheckedSupplier", "<", "InputStream", ",", "IOException", ">", "createStreamFunc", "=", "(", ")", "->", "{", "if", "(", "customSortOrderFile", "!=", "null", ")", "{", "UrlWra...
Retrieves the default sort order for sortpom @return Content of the default sort order file
[ "Retrieves", "the", "default", "sort", "order", "for", "sortpom" ]
27056420803ed04001e4149b04a719fbac774c5d
https://github.com/Ekryd/sortpom/blob/27056420803ed04001e4149b04a719fbac774c5d/sorter/src/main/java/sortpom/util/FileUtil.java#L114-L132
train
Ekryd/sortpom
sorter/src/main/java/sortpom/util/FileUtil.java
FileUtil.openCustomSortOrderFile
private InputStream openCustomSortOrderFile() throws FileNotFoundException { InputStream inputStream; try { inputStream = new FileInputStream(customSortOrderFile); } catch (FileNotFoundException ex) { // try classpath try { URL resource = this....
java
private InputStream openCustomSortOrderFile() throws FileNotFoundException { InputStream inputStream; try { inputStream = new FileInputStream(customSortOrderFile); } catch (FileNotFoundException ex) { // try classpath try { URL resource = this....
[ "private", "InputStream", "openCustomSortOrderFile", "(", ")", "throws", "FileNotFoundException", "{", "InputStream", "inputStream", ";", "try", "{", "inputStream", "=", "new", "FileInputStream", "(", "customSortOrderFile", ")", ";", "}", "catch", "(", "FileNotFoundEx...
Load custom sort order file from absolute or class path. @return a stream to the opened resource
[ "Load", "custom", "sort", "order", "file", "from", "absolute", "or", "class", "path", "." ]
27056420803ed04001e4149b04a719fbac774c5d
https://github.com/Ekryd/sortpom/blob/27056420803ed04001e4149b04a719fbac774c5d/sorter/src/main/java/sortpom/util/FileUtil.java#L139-L157
train
Ekryd/sortpom
sorter/src/main/java/sortpom/util/XmlOrderedResult.java
XmlOrderedResult.nameDiffers
public static XmlOrderedResult nameDiffers(String originalElementName, String newElementName) { return new XmlOrderedResult(false, String.format("The xml element <%s> should be placed before <%s>", newElementName, originalElementName)); }
java
public static XmlOrderedResult nameDiffers(String originalElementName, String newElementName) { return new XmlOrderedResult(false, String.format("The xml element <%s> should be placed before <%s>", newElementName, originalElementName)); }
[ "public", "static", "XmlOrderedResult", "nameDiffers", "(", "String", "originalElementName", ",", "String", "newElementName", ")", "{", "return", "new", "XmlOrderedResult", "(", "false", ",", "String", ".", "format", "(", "\"The xml element <%s> should be placed before <%...
The xml elements was not in the right order
[ "The", "xml", "elements", "was", "not", "in", "the", "right", "order" ]
27056420803ed04001e4149b04a719fbac774c5d
https://github.com/Ekryd/sortpom/blob/27056420803ed04001e4149b04a719fbac774c5d/sorter/src/main/java/sortpom/util/XmlOrderedResult.java#L24-L27
train
Ekryd/sortpom
sorter/src/main/java/sortpom/wrapper/operation/DetachOperation.java
DetachOperation.processElement
@Override public void processElement(Wrapper<Element> elementWrapper) { Element content = elementWrapper.getContent(); content.detach(); content.removeContent(); }
java
@Override public void processElement(Wrapper<Element> elementWrapper) { Element content = elementWrapper.getContent(); content.detach(); content.removeContent(); }
[ "@", "Override", "public", "void", "processElement", "(", "Wrapper", "<", "Element", ">", "elementWrapper", ")", "{", "Element", "content", "=", "elementWrapper", ".", "getContent", "(", ")", ";", "content", ".", "detach", "(", ")", ";", "content", ".", "r...
Detach each xml element
[ "Detach", "each", "xml", "element" ]
27056420803ed04001e4149b04a719fbac774c5d
https://github.com/Ekryd/sortpom/blob/27056420803ed04001e4149b04a719fbac774c5d/sorter/src/main/java/sortpom/wrapper/operation/DetachOperation.java#L22-L27
train
Ekryd/sortpom
sorter/src/main/java/sortpom/processinstruction/SortpomPiScanner.java
SortpomPiScanner.scan
public void scan(String originalXml) { Matcher matcher = INSTRUCTION_PATTERN.matcher(originalXml); while (matcher.find()) { scanOneInstruction(matcher.group(1)); containsIgnoredSections = true; } if (expectedNextInstruction != IGNORE) { addError(String...
java
public void scan(String originalXml) { Matcher matcher = INSTRUCTION_PATTERN.matcher(originalXml); while (matcher.find()) { scanOneInstruction(matcher.group(1)); containsIgnoredSections = true; } if (expectedNextInstruction != IGNORE) { addError(String...
[ "public", "void", "scan", "(", "String", "originalXml", ")", "{", "Matcher", "matcher", "=", "INSTRUCTION_PATTERN", ".", "matcher", "(", "originalXml", ")", ";", "while", "(", "matcher", ".", "find", "(", ")", ")", "{", "scanOneInstruction", "(", "matcher", ...
Scan and verifies the pom file for processing instructions
[ "Scan", "and", "verifies", "the", "pom", "file", "for", "processing", "instructions" ]
27056420803ed04001e4149b04a719fbac774c5d
https://github.com/Ekryd/sortpom/blob/27056420803ed04001e4149b04a719fbac774c5d/sorter/src/main/java/sortpom/processinstruction/SortpomPiScanner.java#L26-L36
train
Ekryd/sortpom
sorter/src/main/java/sortpom/wrapper/operation/SortAttributesOperation.java
SortAttributesOperation.processElement
@Override public void processElement(Wrapper<Element> elementWrapper) { Element element = elementWrapper.getContent(); element.setAttributes(getSortedAttributes(element)); }
java
@Override public void processElement(Wrapper<Element> elementWrapper) { Element element = elementWrapper.getContent(); element.setAttributes(getSortedAttributes(element)); }
[ "@", "Override", "public", "void", "processElement", "(", "Wrapper", "<", "Element", ">", "elementWrapper", ")", "{", "Element", "element", "=", "elementWrapper", ".", "getContent", "(", ")", ";", "element", ".", "setAttributes", "(", "getSortedAttributes", "(",...
Sort attributes of each element
[ "Sort", "attributes", "of", "each", "element" ]
27056420803ed04001e4149b04a719fbac774c5d
https://github.com/Ekryd/sortpom/blob/27056420803ed04001e4149b04a719fbac774c5d/sorter/src/main/java/sortpom/wrapper/operation/SortAttributesOperation.java#L21-L25
train
Ekryd/sortpom
sorter/src/main/java/sortpom/wrapper/operation/GetContentStructureOperation.java
GetContentStructureOperation.processOtherContent
@Override public void processOtherContent(Wrapper<Content> content) { if (parentElement != null) { parentElement.addContent(content.getContent()); } }
java
@Override public void processOtherContent(Wrapper<Content> content) { if (parentElement != null) { parentElement.addContent(content.getContent()); } }
[ "@", "Override", "public", "void", "processOtherContent", "(", "Wrapper", "<", "Content", ">", "content", ")", "{", "if", "(", "parentElement", "!=", "null", ")", "{", "parentElement", ".", "addContent", "(", "content", ".", "getContent", "(", ")", ")", ";...
Add all 'other content' to the parent xml element
[ "Add", "all", "other", "content", "to", "the", "parent", "xml", "element" ]
27056420803ed04001e4149b04a719fbac774c5d
https://github.com/Ekryd/sortpom/blob/27056420803ed04001e4149b04a719fbac774c5d/sorter/src/main/java/sortpom/wrapper/operation/GetContentStructureOperation.java#L27-L32
train
Ekryd/sortpom
sorter/src/main/java/sortpom/wrapper/operation/GetContentStructureOperation.java
GetContentStructureOperation.processElement
@Override public void processElement(Wrapper<Element> element) { activeElement = element.getContent(); if (parentElement != null) { parentElement.addContent(activeElement); } }
java
@Override public void processElement(Wrapper<Element> element) { activeElement = element.getContent(); if (parentElement != null) { parentElement.addContent(activeElement); } }
[ "@", "Override", "public", "void", "processElement", "(", "Wrapper", "<", "Element", ">", "element", ")", "{", "activeElement", "=", "element", ".", "getContent", "(", ")", ";", "if", "(", "parentElement", "!=", "null", ")", "{", "parentElement", ".", "add...
Add the element to its parent
[ "Add", "the", "element", "to", "its", "parent" ]
27056420803ed04001e4149b04a719fbac774c5d
https://github.com/Ekryd/sortpom/blob/27056420803ed04001e4149b04a719fbac774c5d/sorter/src/main/java/sortpom/wrapper/operation/GetContentStructureOperation.java#L35-L42
train
Ekryd/sortpom
sorter/src/main/java/sortpom/wrapper/operation/SortChildrenOperation.java
SortChildrenOperation.manipulateChildElements
@Override public void manipulateChildElements(List<HierarchyWrapper> children) { for (int i = 0; i < children.size(); i++) { HierarchyWrapper wrapperImpl = children.get(i); final Wrapper<Element> wrapper = wrapperImpl.getElementContent(); if (wrapper != null && wrapper.i...
java
@Override public void manipulateChildElements(List<HierarchyWrapper> children) { for (int i = 0; i < children.size(); i++) { HierarchyWrapper wrapperImpl = children.get(i); final Wrapper<Element> wrapper = wrapperImpl.getElementContent(); if (wrapper != null && wrapper.i...
[ "@", "Override", "public", "void", "manipulateChildElements", "(", "List", "<", "HierarchyWrapper", ">", "children", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "children", ".", "size", "(", ")", ";", "i", "++", ")", "{", "HierarchyWrapp...
Sort all children of an element
[ "Sort", "all", "children", "of", "an", "element" ]
27056420803ed04001e4149b04a719fbac774c5d
https://github.com/Ekryd/sortpom/blob/27056420803ed04001e4149b04a719fbac774c5d/sorter/src/main/java/sortpom/wrapper/operation/SortChildrenOperation.java#L17-L28
train
Ekryd/sortpom
sorter/src/main/java/sortpom/wrapper/operation/ToStringOperation.java
ToStringOperation.startOfProcess
@Override public void startOfProcess() { String previousBaseIndent = baseIndent.substring(INDENT_LENGTH); builder.append(previousBaseIndent).append("HierarchyWrapper{\n"); processFirstOtherContent = true; }
java
@Override public void startOfProcess() { String previousBaseIndent = baseIndent.substring(INDENT_LENGTH); builder.append(previousBaseIndent).append("HierarchyWrapper{\n"); processFirstOtherContent = true; }
[ "@", "Override", "public", "void", "startOfProcess", "(", ")", "{", "String", "previousBaseIndent", "=", "baseIndent", ".", "substring", "(", "INDENT_LENGTH", ")", ";", "builder", ".", "append", "(", "previousBaseIndent", ")", ".", "append", "(", "\"HierarchyWra...
Add text before each element
[ "Add", "text", "before", "each", "element" ]
27056420803ed04001e4149b04a719fbac774c5d
https://github.com/Ekryd/sortpom/blob/27056420803ed04001e4149b04a719fbac774c5d/sorter/src/main/java/sortpom/wrapper/operation/ToStringOperation.java#L34-L39
train
Ekryd/sortpom
sorter/src/main/java/sortpom/wrapper/operation/ToStringOperation.java
ToStringOperation.processOtherContent
@Override public void processOtherContent(Wrapper<Content> content) { if (processFirstOtherContent) { builder.append(baseIndent).append("otherContentList=").append("\n"); processFirstOtherContent = false; } builder.append(content.toString(baseIndent)).append("\n"); ...
java
@Override public void processOtherContent(Wrapper<Content> content) { if (processFirstOtherContent) { builder.append(baseIndent).append("otherContentList=").append("\n"); processFirstOtherContent = false; } builder.append(content.toString(baseIndent)).append("\n"); ...
[ "@", "Override", "public", "void", "processOtherContent", "(", "Wrapper", "<", "Content", ">", "content", ")", "{", "if", "(", "processFirstOtherContent", ")", "{", "builder", ".", "append", "(", "baseIndent", ")", ".", "append", "(", "\"otherContentList=\"", ...
Add each 'other element' to string
[ "Add", "each", "other", "element", "to", "string" ]
27056420803ed04001e4149b04a719fbac774c5d
https://github.com/Ekryd/sortpom/blob/27056420803ed04001e4149b04a719fbac774c5d/sorter/src/main/java/sortpom/wrapper/operation/ToStringOperation.java#L42-L49
train
Ekryd/sortpom
sorter/src/main/java/sortpom/wrapper/operation/ToStringOperation.java
ToStringOperation.processElement
@Override public void processElement(Wrapper<Element> elementWrapper) { builder.append(baseIndent).append("elementContent=").append(elementWrapper).append("\n"); }
java
@Override public void processElement(Wrapper<Element> elementWrapper) { builder.append(baseIndent).append("elementContent=").append(elementWrapper).append("\n"); }
[ "@", "Override", "public", "void", "processElement", "(", "Wrapper", "<", "Element", ">", "elementWrapper", ")", "{", "builder", ".", "append", "(", "baseIndent", ")", ".", "append", "(", "\"elementContent=\"", ")", ".", "append", "(", "elementWrapper", ")", ...
Add each element to string
[ "Add", "each", "element", "to", "string" ]
27056420803ed04001e4149b04a719fbac774c5d
https://github.com/Ekryd/sortpom/blob/27056420803ed04001e4149b04a719fbac774c5d/sorter/src/main/java/sortpom/wrapper/operation/ToStringOperation.java#L52-L55
train
Ekryd/sortpom
sorter/src/main/java/sortpom/wrapper/operation/ToStringOperation.java
ToStringOperation.manipulateChildElements
@Override public void manipulateChildElements(List<HierarchyWrapper> children) { if (!children.isEmpty()) { builder.append(baseIndent).append("children=").append("\n"); } }
java
@Override public void manipulateChildElements(List<HierarchyWrapper> children) { if (!children.isEmpty()) { builder.append(baseIndent).append("children=").append("\n"); } }
[ "@", "Override", "public", "void", "manipulateChildElements", "(", "List", "<", "HierarchyWrapper", ">", "children", ")", "{", "if", "(", "!", "children", ".", "isEmpty", "(", ")", ")", "{", "builder", ".", "append", "(", "baseIndent", ")", ".", "append", ...
Add text before processing each child
[ "Add", "text", "before", "processing", "each", "child" ]
27056420803ed04001e4149b04a719fbac774c5d
https://github.com/Ekryd/sortpom/blob/27056420803ed04001e4149b04a719fbac774c5d/sorter/src/main/java/sortpom/wrapper/operation/ToStringOperation.java#L58-L63
train