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
primefaces-extensions/core
src/main/java/org/primefaces/extensions/component/sheet/SheetColumn.java
SheetColumn.getColWidth
public Integer getColWidth() { final Object result = getStateHelper().eval(PropertyKeys.colWidth, null); if (result == null) { return null; } return Integer.valueOf(result.toString()); }
java
public Integer getColWidth() { final Object result = getStateHelper().eval(PropertyKeys.colWidth, null); if (result == null) { return null; } return Integer.valueOf(result.toString()); }
[ "public", "Integer", "getColWidth", "(", ")", "{", "final", "Object", "result", "=", "getStateHelper", "(", ")", ".", "eval", "(", "PropertyKeys", ".", "colWidth", ",", "null", ")", ";", "if", "(", "result", "==", "null", ")", "{", "return", "null", ";...
The column width @return
[ "The", "column", "width" ]
afdbca591f60f47898e3517e1e939bc2f63d5355
https://github.com/primefaces-extensions/core/blob/afdbca591f60f47898e3517e1e939bc2f63d5355/src/main/java/org/primefaces/extensions/component/sheet/SheetColumn.java#L267-L273
train
primefaces-extensions/core
src/main/java/org/primefaces/extensions/component/sheet/SheetColumn.java
SheetColumn.getFilterOptions
public Collection<SelectItem> getFilterOptions() { return (Collection<SelectItem>) getStateHelper().eval(PropertyKeys.filterOptions, null); }
java
public Collection<SelectItem> getFilterOptions() { return (Collection<SelectItem>) getStateHelper().eval(PropertyKeys.filterOptions, null); }
[ "public", "Collection", "<", "SelectItem", ">", "getFilterOptions", "(", ")", "{", "return", "(", "Collection", "<", "SelectItem", ">", ")", "getStateHelper", "(", ")", ".", "eval", "(", "PropertyKeys", ".", "filterOptions", ",", "null", ")", ";", "}" ]
The filterOptions expression @return
[ "The", "filterOptions", "expression" ]
afdbca591f60f47898e3517e1e939bc2f63d5355
https://github.com/primefaces-extensions/core/blob/afdbca591f60f47898e3517e1e939bc2f63d5355/src/main/java/org/primefaces/extensions/component/sheet/SheetColumn.java#L492-L494
train
primefaces-extensions/core
src/main/java/org/primefaces/extensions/component/sheet/SheetColumn.java
SheetColumn.getSheet
public Sheet getSheet() { if (sheet != null) { return sheet; } UIComponent parent = getParent(); while (parent != null && !(parent instanceof Sheet)) { parent = parent.getParent(); } return (Sheet) parent; }
java
public Sheet getSheet() { if (sheet != null) { return sheet; } UIComponent parent = getParent(); while (parent != null && !(parent instanceof Sheet)) { parent = parent.getParent(); } return (Sheet) parent; }
[ "public", "Sheet", "getSheet", "(", ")", "{", "if", "(", "sheet", "!=", "null", ")", "{", "return", "sheet", ";", "}", "UIComponent", "parent", "=", "getParent", "(", ")", ";", "while", "(", "parent", "!=", "null", "&&", "!", "(", "parent", "instance...
Get the parent sheet @return
[ "Get", "the", "parent", "sheet" ]
afdbca591f60f47898e3517e1e939bc2f63d5355
https://github.com/primefaces-extensions/core/blob/afdbca591f60f47898e3517e1e939bc2f63d5355/src/main/java/org/primefaces/extensions/component/sheet/SheetColumn.java#L508-L518
train
primefaces-extensions/core
src/main/java/org/primefaces/extensions/component/sheet/SheetColumn.java
SheetColumn.validateRequired
protected boolean validateRequired(final FacesContext context, final Object newValue) { // If our value is valid, enforce the required property if present if (isValid() && isRequired() && isEmpty(newValue)) { final String requiredMessageStr = getRequiredMessage(); FacesMessage me...
java
protected boolean validateRequired(final FacesContext context, final Object newValue) { // If our value is valid, enforce the required property if present if (isValid() && isRequired() && isEmpty(newValue)) { final String requiredMessageStr = getRequiredMessage(); FacesMessage me...
[ "protected", "boolean", "validateRequired", "(", "final", "FacesContext", "context", ",", "final", "Object", "newValue", ")", "{", "// If our value is valid, enforce the required property if present", "if", "(", "isValid", "(", ")", "&&", "isRequired", "(", ")", "&&", ...
Validates the value against the required flags on this column. @param context the FacesContext @param newValue the new value for this column @return true if passes validation, otherwise valse
[ "Validates", "the", "value", "against", "the", "required", "flags", "on", "this", "column", "." ]
afdbca591f60f47898e3517e1e939bc2f63d5355
https://github.com/primefaces-extensions/core/blob/afdbca591f60f47898e3517e1e939bc2f63d5355/src/main/java/org/primefaces/extensions/component/sheet/SheetColumn.java#L674-L700
train
Credntia/MVBarcodeReader
mvbarcodereader/src/main/java/devliving/online/mvbarcodereader/BarcodeCaptureFragment.java
BarcodeCaptureFragment.requestCameraPermission
private void requestCameraPermission() { Log.w("BARCODE-SCANNER", "Camera permission is not granted. Requesting permission"); final String[] permissions = new String[]{Manifest.permission.CAMERA}; if (!shouldShowRequestPermissionRationale(Manifest.permission.CAMERA)) { requestPermi...
java
private void requestCameraPermission() { Log.w("BARCODE-SCANNER", "Camera permission is not granted. Requesting permission"); final String[] permissions = new String[]{Manifest.permission.CAMERA}; if (!shouldShowRequestPermissionRationale(Manifest.permission.CAMERA)) { requestPermi...
[ "private", "void", "requestCameraPermission", "(", ")", "{", "Log", ".", "w", "(", "\"BARCODE-SCANNER\"", ",", "\"Camera permission is not granted. Requesting permission\"", ")", ";", "final", "String", "[", "]", "permissions", "=", "new", "String", "[", "]", "{", ...
Handles the requesting of the camera permission. This includes showing a "Snackbar" message of why the permission is needed then sending the request.
[ "Handles", "the", "requesting", "of", "the", "camera", "permission", ".", "This", "includes", "showing", "a", "Snackbar", "message", "of", "why", "the", "permission", "is", "needed", "then", "sending", "the", "request", "." ]
2a2561f1c3b4d4e3c046a341fbf23a31eabfda8d
https://github.com/Credntia/MVBarcodeReader/blob/2a2561f1c3b4d4e3c046a341fbf23a31eabfda8d/mvbarcodereader/src/main/java/devliving/online/mvbarcodereader/BarcodeCaptureFragment.java#L274-L307
train
Credntia/MVBarcodeReader
mvbarcodereader/src/main/java/devliving/online/mvbarcodereader/BarcodeCaptureFragment.java
BarcodeCaptureFragment.onTouch
@Override public boolean onTouch(View v, MotionEvent event) { boolean b = scaleGestureDetector.onTouchEvent(event); boolean c = gestureDetector.onTouchEvent(event); return b || c || v.onTouchEvent(event); }
java
@Override public boolean onTouch(View v, MotionEvent event) { boolean b = scaleGestureDetector.onTouchEvent(event); boolean c = gestureDetector.onTouchEvent(event); return b || c || v.onTouchEvent(event); }
[ "@", "Override", "public", "boolean", "onTouch", "(", "View", "v", ",", "MotionEvent", "event", ")", "{", "boolean", "b", "=", "scaleGestureDetector", ".", "onTouchEvent", "(", "event", ")", ";", "boolean", "c", "=", "gestureDetector", ".", "onTouchEvent", "...
Called when a touch event is dispatched to a view. This allows listeners to get a chance to respond before the target view. @param v The view the touch event has been dispatched to. @param event The MotionEvent object containing full information about the event. @return True if the listener has consumed the event,...
[ "Called", "when", "a", "touch", "event", "is", "dispatched", "to", "a", "view", ".", "This", "allows", "listeners", "to", "get", "a", "chance", "to", "respond", "before", "the", "target", "view", "." ]
2a2561f1c3b4d4e3c046a341fbf23a31eabfda8d
https://github.com/Credntia/MVBarcodeReader/blob/2a2561f1c3b4d4e3c046a341fbf23a31eabfda8d/mvbarcodereader/src/main/java/devliving/online/mvbarcodereader/BarcodeCaptureFragment.java#L423-L430
train
Credntia/MVBarcodeReader
mvbarcodereader/src/main/java/devliving/online/mvbarcodereader/BarcodeCaptureFragment.java
BarcodeCaptureFragment.onTap
protected boolean onTap(float rawX, float rawY) { Log.d("CAPTURE-FRAGMENT", "got tap at: (" + rawX + ", " + rawY + ")"); Barcode barcode = null; if (mMode == MVBarcodeScanner.ScanningMode.SINGLE_AUTO) { BarcodeGraphic graphic = mGraphicOverlay.getFirstGraphic(); if (gra...
java
protected boolean onTap(float rawX, float rawY) { Log.d("CAPTURE-FRAGMENT", "got tap at: (" + rawX + ", " + rawY + ")"); Barcode barcode = null; if (mMode == MVBarcodeScanner.ScanningMode.SINGLE_AUTO) { BarcodeGraphic graphic = mGraphicOverlay.getFirstGraphic(); if (gra...
[ "protected", "boolean", "onTap", "(", "float", "rawX", ",", "float", "rawY", ")", "{", "Log", ".", "d", "(", "\"CAPTURE-FRAGMENT\"", ",", "\"got tap at: (\"", "+", "rawX", "+", "\", \"", "+", "rawY", "+", "\")\"", ")", ";", "Barcode", "barcode", "=", "nu...
onTap is called to capture the oldest barcode currently detected and return it to the caller. @param rawX - the raw position of the tap @param rawY - the raw position of the tap. @return true if the activity is ending.
[ "onTap", "is", "called", "to", "capture", "the", "oldest", "barcode", "currently", "detected", "and", "return", "it", "to", "the", "caller", "." ]
2a2561f1c3b4d4e3c046a341fbf23a31eabfda8d
https://github.com/Credntia/MVBarcodeReader/blob/2a2561f1c3b4d4e3c046a341fbf23a31eabfda8d/mvbarcodereader/src/main/java/devliving/online/mvbarcodereader/BarcodeCaptureFragment.java#L440-L487
train
Credntia/MVBarcodeReader
mvbarcodereader/src/main/java/devliving/online/mvbarcodereader/BarcodeGraphicTracker.java
BarcodeGraphicTracker.onNewItem
@Override public void onNewItem(int id, Barcode item) { mGraphic.setId(id); if (mListener != null) mListener.onNewBarcodeDetected(id, item); }
java
@Override public void onNewItem(int id, Barcode item) { mGraphic.setId(id); if (mListener != null) mListener.onNewBarcodeDetected(id, item); }
[ "@", "Override", "public", "void", "onNewItem", "(", "int", "id", ",", "Barcode", "item", ")", "{", "mGraphic", ".", "setId", "(", "id", ")", ";", "if", "(", "mListener", "!=", "null", ")", "mListener", ".", "onNewBarcodeDetected", "(", "id", ",", "ite...
Start tracking the detected item instance within the item overlay.
[ "Start", "tracking", "the", "detected", "item", "instance", "within", "the", "item", "overlay", "." ]
2a2561f1c3b4d4e3c046a341fbf23a31eabfda8d
https://github.com/Credntia/MVBarcodeReader/blob/2a2561f1c3b4d4e3c046a341fbf23a31eabfda8d/mvbarcodereader/src/main/java/devliving/online/mvbarcodereader/BarcodeGraphicTracker.java#L50-L54
train
Credntia/MVBarcodeReader
mvbarcodereader/src/main/java/devliving/online/mvbarcodereader/BarcodeGraphic.java
BarcodeGraphic.draw
@Override public void draw(Canvas canvas) { Barcode barcode = mBarcode; if (barcode == null) { return; } // Draws the bounding box around the barcode. RectF rect = getViewBoundingBox(barcode); canvas.drawRect(rect, mOverlayPaint); /** *...
java
@Override public void draw(Canvas canvas) { Barcode barcode = mBarcode; if (barcode == null) { return; } // Draws the bounding box around the barcode. RectF rect = getViewBoundingBox(barcode); canvas.drawRect(rect, mOverlayPaint); /** *...
[ "@", "Override", "public", "void", "draw", "(", "Canvas", "canvas", ")", "{", "Barcode", "barcode", "=", "mBarcode", ";", "if", "(", "barcode", "==", "null", ")", "{", "return", ";", "}", "// Draws the bounding box around the barcode.", "RectF", "rect", "=", ...
Draws the barcode annotations for position, size, and raw value on the supplied canvas.
[ "Draws", "the", "barcode", "annotations", "for", "position", "size", "and", "raw", "value", "on", "the", "supplied", "canvas", "." ]
2a2561f1c3b4d4e3c046a341fbf23a31eabfda8d
https://github.com/Credntia/MVBarcodeReader/blob/2a2561f1c3b4d4e3c046a341fbf23a31eabfda8d/mvbarcodereader/src/main/java/devliving/online/mvbarcodereader/BarcodeGraphic.java#L123-L158
train
gwt-maven-plugin/gwt-maven-plugin
src/main/java/org/codehaus/mojo/gwt/AbstractGwtMojo.java
AbstractGwtMojo.addClasspathElements
protected int addClasspathElements( Collection<?> elements, URL[] urls, int startPosition ) throws MojoExecutionException { for ( Object object : elements ) { try { if ( object instanceof Artifact ) { urls[startPosit...
java
protected int addClasspathElements( Collection<?> elements, URL[] urls, int startPosition ) throws MojoExecutionException { for ( Object object : elements ) { try { if ( object instanceof Artifact ) { urls[startPosit...
[ "protected", "int", "addClasspathElements", "(", "Collection", "<", "?", ">", "elements", ",", "URL", "[", "]", "urls", ",", "int", "startPosition", ")", "throws", "MojoExecutionException", "{", "for", "(", "Object", "object", ":", "elements", ")", "{", "try...
Add classpath elements to a classpath URL set @param elements the initial URL set @param urls the urls to add @param startPosition the position to insert URLS @return full classpath URL set @throws MojoExecutionException some error occured
[ "Add", "classpath", "elements", "to", "a", "classpath", "URL", "set" ]
0cdd5054b43f182cc22a8acf61ec79ac42b0dfdc
https://github.com/gwt-maven-plugin/gwt-maven-plugin/blob/0cdd5054b43f182cc22a8acf61ec79ac42b0dfdc/src/main/java/org/codehaus/mojo/gwt/AbstractGwtMojo.java#L184-L213
train
gwt-maven-plugin/gwt-maven-plugin
src/main/java/org/codehaus/mojo/gwt/AbstractGwtMojo.java
AbstractGwtMojo.getClasspath
public Collection<File> getClasspath( String scope ) throws MojoExecutionException { try { Collection<File> files = classpathBuilder.buildClasspathList( getProject(), scope, getProjectArtifacts(), isGenerator() ); if ( getLog().isDebugEnabled() ) { ...
java
public Collection<File> getClasspath( String scope ) throws MojoExecutionException { try { Collection<File> files = classpathBuilder.buildClasspathList( getProject(), scope, getProjectArtifacts(), isGenerator() ); if ( getLog().isDebugEnabled() ) { ...
[ "public", "Collection", "<", "File", ">", "getClasspath", "(", "String", "scope", ")", "throws", "MojoExecutionException", "{", "try", "{", "Collection", "<", "File", ">", "files", "=", "classpathBuilder", ".", "buildClasspathList", "(", "getProject", "(", ")", ...
Build the GWT classpath for the specified scope @param scope Artifact.SCOPE_COMPILE or Artifact.SCOPE_TEST @return a collection of dependencies as Files for the specified scope. @throws MojoExecutionException if classPath building failed
[ "Build", "the", "GWT", "classpath", "for", "the", "specified", "scope" ]
0cdd5054b43f182cc22a8acf61ec79ac42b0dfdc
https://github.com/gwt-maven-plugin/gwt-maven-plugin/blob/0cdd5054b43f182cc22a8acf61ec79ac42b0dfdc/src/main/java/org/codehaus/mojo/gwt/AbstractGwtMojo.java#L223-L244
train
gwt-maven-plugin/gwt-maven-plugin
src/main/java/org/codehaus/mojo/gwt/AbstractGwtMojo.java
AbstractGwtMojo.checkGwtUserVersion
private void checkGwtUserVersion() throws MojoExecutionException { InputStream inputStream = Thread.currentThread().getContextClassLoader() .getResourceAsStream( "org/codehaus/mojo/gwt/mojoGwtVersion.properties" ); Properties properties = new Properties(); try { ...
java
private void checkGwtUserVersion() throws MojoExecutionException { InputStream inputStream = Thread.currentThread().getContextClassLoader() .getResourceAsStream( "org/codehaus/mojo/gwt/mojoGwtVersion.properties" ); Properties properties = new Properties(); try { ...
[ "private", "void", "checkGwtUserVersion", "(", ")", "throws", "MojoExecutionException", "{", "InputStream", "inputStream", "=", "Thread", ".", "currentThread", "(", ")", ".", "getContextClassLoader", "(", ")", ".", "getResourceAsStream", "(", "\"org/codehaus/mojo/gwt/mo...
Check gwt-user dependency matches plugin version
[ "Check", "gwt", "-", "user", "dependency", "matches", "plugin", "version" ]
0cdd5054b43f182cc22a8acf61ec79ac42b0dfdc
https://github.com/gwt-maven-plugin/gwt-maven-plugin/blob/0cdd5054b43f182cc22a8acf61ec79ac42b0dfdc/src/main/java/org/codehaus/mojo/gwt/AbstractGwtMojo.java#L311-L343
train
gwt-maven-plugin/gwt-maven-plugin
src/main/java/org/codehaus/mojo/gwt/eclipse/EclipseUtil.java
EclipseUtil.getProjectName
public String getProjectName( MavenProject project ) { File dotProject = new File( project.getBasedir(), ".project" ); try { Xpp3Dom dom = Xpp3DomBuilder.build( ReaderFactory.newXmlReader( dotProject ) ); return dom.getChild( "name" ).getValue(); } cat...
java
public String getProjectName( MavenProject project ) { File dotProject = new File( project.getBasedir(), ".project" ); try { Xpp3Dom dom = Xpp3DomBuilder.build( ReaderFactory.newXmlReader( dotProject ) ); return dom.getChild( "name" ).getValue(); } cat...
[ "public", "String", "getProjectName", "(", "MavenProject", "project", ")", "{", "File", "dotProject", "=", "new", "File", "(", "project", ".", "getBasedir", "(", ")", ",", "\".project\"", ")", ";", "try", "{", "Xpp3Dom", "dom", "=", "Xpp3DomBuilder", ".", ...
Read the Eclipse project name for .project file. Fall back to artifactId on error @return project name in eclipse workspace
[ "Read", "the", "Eclipse", "project", "name", "for", ".", "project", "file", ".", "Fall", "back", "to", "artifactId", "on", "error" ]
0cdd5054b43f182cc22a8acf61ec79ac42b0dfdc
https://github.com/gwt-maven-plugin/gwt-maven-plugin/blob/0cdd5054b43f182cc22a8acf61ec79ac42b0dfdc/src/main/java/org/codehaus/mojo/gwt/eclipse/EclipseUtil.java#L44-L57
train
gwt-maven-plugin/gwt-maven-plugin
src/main/java/org/codehaus/mojo/gwt/ClasspathBuilder.java
ClasspathBuilder.getScopeArtifacts
private List<Artifact> getScopeArtifacts( final MavenProject project, final String scope ) { if ( SCOPE_COMPILE.equals( scope ) ) { return project.getCompileArtifacts(); } if ( SCOPE_RUNTIME.equals( scope ) ) { return project.getRuntimeArtifacts(); ...
java
private List<Artifact> getScopeArtifacts( final MavenProject project, final String scope ) { if ( SCOPE_COMPILE.equals( scope ) ) { return project.getCompileArtifacts(); } if ( SCOPE_RUNTIME.equals( scope ) ) { return project.getRuntimeArtifacts(); ...
[ "private", "List", "<", "Artifact", ">", "getScopeArtifacts", "(", "final", "MavenProject", "project", ",", "final", "String", "scope", ")", "{", "if", "(", "SCOPE_COMPILE", ".", "equals", "(", "scope", ")", ")", "{", "return", "project", ".", "getCompileArt...
Get artifacts for specific scope. @param project @param scope @return
[ "Get", "artifacts", "for", "specific", "scope", "." ]
0cdd5054b43f182cc22a8acf61ec79ac42b0dfdc
https://github.com/gwt-maven-plugin/gwt-maven-plugin/blob/0cdd5054b43f182cc22a8acf61ec79ac42b0dfdc/src/main/java/org/codehaus/mojo/gwt/ClasspathBuilder.java#L195-L213
train
gwt-maven-plugin/gwt-maven-plugin
src/main/java/org/codehaus/mojo/gwt/ClasspathBuilder.java
ClasspathBuilder.getSourceRoots
private List<String> getSourceRoots( final MavenProject project, final String scope ) { if ( SCOPE_COMPILE.equals( scope ) || SCOPE_RUNTIME.equals( scope ) ) { return project.getCompileSourceRoots(); } else if ( SCOPE_TEST.equals( scope ) ) { List<Stri...
java
private List<String> getSourceRoots( final MavenProject project, final String scope ) { if ( SCOPE_COMPILE.equals( scope ) || SCOPE_RUNTIME.equals( scope ) ) { return project.getCompileSourceRoots(); } else if ( SCOPE_TEST.equals( scope ) ) { List<Stri...
[ "private", "List", "<", "String", ">", "getSourceRoots", "(", "final", "MavenProject", "project", ",", "final", "String", "scope", ")", "{", "if", "(", "SCOPE_COMPILE", ".", "equals", "(", "scope", ")", "||", "SCOPE_RUNTIME", ".", "equals", "(", "scope", "...
Get source roots for specific scope. @param project @param scope @return
[ "Get", "source", "roots", "for", "specific", "scope", "." ]
0cdd5054b43f182cc22a8acf61ec79ac42b0dfdc
https://github.com/gwt-maven-plugin/gwt-maven-plugin/blob/0cdd5054b43f182cc22a8acf61ec79ac42b0dfdc/src/main/java/org/codehaus/mojo/gwt/ClasspathBuilder.java#L222-L239
train
gwt-maven-plugin/gwt-maven-plugin
src/main/java/org/codehaus/mojo/gwt/ClasspathBuilder.java
ClasspathBuilder.getResources
private List<Resource> getResources( final MavenProject project, final String scope ) { if ( SCOPE_COMPILE.equals( scope ) || SCOPE_RUNTIME.equals( scope ) ) { return project.getResources(); } else if ( SCOPE_TEST.equals( scope ) ) { List<Resource> res...
java
private List<Resource> getResources( final MavenProject project, final String scope ) { if ( SCOPE_COMPILE.equals( scope ) || SCOPE_RUNTIME.equals( scope ) ) { return project.getResources(); } else if ( SCOPE_TEST.equals( scope ) ) { List<Resource> res...
[ "private", "List", "<", "Resource", ">", "getResources", "(", "final", "MavenProject", "project", ",", "final", "String", "scope", ")", "{", "if", "(", "SCOPE_COMPILE", ".", "equals", "(", "scope", ")", "||", "SCOPE_RUNTIME", ".", "equals", "(", "scope", "...
Get resources for specific scope. @param project @param scope @return
[ "Get", "resources", "for", "specific", "scope", "." ]
0cdd5054b43f182cc22a8acf61ec79ac42b0dfdc
https://github.com/gwt-maven-plugin/gwt-maven-plugin/blob/0cdd5054b43f182cc22a8acf61ec79ac42b0dfdc/src/main/java/org/codehaus/mojo/gwt/ClasspathBuilder.java#L248-L265
train
gwt-maven-plugin/gwt-maven-plugin
src/main/java/org/codehaus/mojo/gwt/ClasspathBuilder.java
ClasspathBuilder.getProjectReferenceId
private String getProjectReferenceId( final String groupId, final String artifactId, final String version ) { return groupId + ":" + artifactId + ":" + version; }
java
private String getProjectReferenceId( final String groupId, final String artifactId, final String version ) { return groupId + ":" + artifactId + ":" + version; }
[ "private", "String", "getProjectReferenceId", "(", "final", "String", "groupId", ",", "final", "String", "artifactId", ",", "final", "String", "version", ")", "{", "return", "groupId", "+", "\":\"", "+", "artifactId", "+", "\":\"", "+", "version", ";", "}" ]
Cut from MavenProject.java @param groupId @param artifactId @param version @return
[ "Cut", "from", "MavenProject", ".", "java" ]
0cdd5054b43f182cc22a8acf61ec79ac42b0dfdc
https://github.com/gwt-maven-plugin/gwt-maven-plugin/blob/0cdd5054b43f182cc22a8acf61ec79ac42b0dfdc/src/main/java/org/codehaus/mojo/gwt/ClasspathBuilder.java#L303-L306
train
gwt-maven-plugin/gwt-maven-plugin
src/main/java/org/codehaus/mojo/gwt/AbstractGwtModuleMojo.java
AbstractGwtModuleMojo.getModules
public String[] getModules() { // module has higher priority if set by expression if ( module != null ) { return new String[] { module }; } if ( modules == null ) { //Use a Set to avoid duplicate when user set src/main/java as <resource> ...
java
public String[] getModules() { // module has higher priority if set by expression if ( module != null ) { return new String[] { module }; } if ( modules == null ) { //Use a Set to avoid duplicate when user set src/main/java as <resource> ...
[ "public", "String", "[", "]", "getModules", "(", ")", "{", "// module has higher priority if set by expression", "if", "(", "module", "!=", "null", ")", "{", "return", "new", "String", "[", "]", "{", "module", "}", ";", "}", "if", "(", "modules", "==", "nu...
FIXME move to DefaultGwtModuleReader !
[ "FIXME", "move", "to", "DefaultGwtModuleReader", "!" ]
0cdd5054b43f182cc22a8acf61ec79ac42b0dfdc
https://github.com/gwt-maven-plugin/gwt-maven-plugin/blob/0cdd5054b43f182cc22a8acf61ec79ac42b0dfdc/src/main/java/org/codehaus/mojo/gwt/AbstractGwtModuleMojo.java#L84-L146
train
gwt-maven-plugin/gwt-maven-plugin
src/main/java/org/codehaus/mojo/gwt/GenerateAsyncMojo.java
GenerateAsyncMojo.isDeprecated
private boolean isDeprecated( JavaMethod method ) { if ( method == null ) return false; for ( Annotation annotation : method.getAnnotations() ) { if ( "java.lang.Deprecated".equals( annotation.getType().getFullyQualifiedName() ) ) { return...
java
private boolean isDeprecated( JavaMethod method ) { if ( method == null ) return false; for ( Annotation annotation : method.getAnnotations() ) { if ( "java.lang.Deprecated".equals( annotation.getType().getFullyQualifiedName() ) ) { return...
[ "private", "boolean", "isDeprecated", "(", "JavaMethod", "method", ")", "{", "if", "(", "method", "==", "null", ")", "return", "false", ";", "for", "(", "Annotation", "annotation", ":", "method", ".", "getAnnotations", "(", ")", ")", "{", "if", "(", "\"j...
Determine if a client service method is deprecated. @see MGWT-352
[ "Determine", "if", "a", "client", "service", "method", "is", "deprecated", "." ]
0cdd5054b43f182cc22a8acf61ec79ac42b0dfdc
https://github.com/gwt-maven-plugin/gwt-maven-plugin/blob/0cdd5054b43f182cc22a8acf61ec79ac42b0dfdc/src/main/java/org/codehaus/mojo/gwt/GenerateAsyncMojo.java#L375-L389
train
gwt-maven-plugin/gwt-maven-plugin
src/main/java/org/codehaus/mojo/gwt/GwtModule.java
GwtModule.getInherits
public Set<GwtModule> getInherits() throws GwtModuleReaderException { if ( inherits != null ) { return inherits; } inherits = new HashSet<GwtModule>(); addInheritedModules( inherits, getLocalInherits() ); return inherits; }
java
public Set<GwtModule> getInherits() throws GwtModuleReaderException { if ( inherits != null ) { return inherits; } inherits = new HashSet<GwtModule>(); addInheritedModules( inherits, getLocalInherits() ); return inherits; }
[ "public", "Set", "<", "GwtModule", ">", "getInherits", "(", ")", "throws", "GwtModuleReaderException", "{", "if", "(", "inherits", "!=", "null", ")", "{", "return", "inherits", ";", "}", "inherits", "=", "new", "HashSet", "<", "GwtModule", ">", "(", ")", ...
Build the set of inhertied modules. Due to xml inheritence mecanism, there may be cicles in the inheritence graph, so we build a set of inherited modules
[ "Build", "the", "set", "of", "inhertied", "modules", ".", "Due", "to", "xml", "inheritence", "mecanism", "there", "may", "be", "cicles", "in", "the", "inheritence", "graph", "so", "we", "build", "a", "set", "of", "inherited", "modules" ]
0cdd5054b43f182cc22a8acf61ec79ac42b0dfdc
https://github.com/gwt-maven-plugin/gwt-maven-plugin/blob/0cdd5054b43f182cc22a8acf61ec79ac42b0dfdc/src/main/java/org/codehaus/mojo/gwt/GwtModule.java#L140-L152
train
gwt-maven-plugin/gwt-maven-plugin
src/main/java/org/codehaus/mojo/gwt/GwtResourcesBaseMojo.java
GwtResourcesBaseMojo.getAllResourceFiles
protected Collection<ResourceFile> getAllResourceFiles() throws MojoExecutionException { try { Set<ResourceFile> sourcesAndResources = new HashSet<ResourceFile>(); Set<String> sourcesAndResourcesPath = new HashSet<String>(); sourcesAndResourcesPath.addAll(...
java
protected Collection<ResourceFile> getAllResourceFiles() throws MojoExecutionException { try { Set<ResourceFile> sourcesAndResources = new HashSet<ResourceFile>(); Set<String> sourcesAndResourcesPath = new HashSet<String>(); sourcesAndResourcesPath.addAll(...
[ "protected", "Collection", "<", "ResourceFile", ">", "getAllResourceFiles", "(", ")", "throws", "MojoExecutionException", "{", "try", "{", "Set", "<", "ResourceFile", ">", "sourcesAndResources", "=", "new", "HashSet", "<", "ResourceFile", ">", "(", ")", ";", "Se...
Collect GWT java source code and module descriptor to be added as resources.
[ "Collect", "GWT", "java", "source", "code", "and", "module", "descriptor", "to", "be", "added", "as", "resources", "." ]
0cdd5054b43f182cc22a8acf61ec79ac42b0dfdc
https://github.com/gwt-maven-plugin/gwt-maven-plugin/blob/0cdd5054b43f182cc22a8acf61ec79ac42b0dfdc/src/main/java/org/codehaus/mojo/gwt/GwtResourcesBaseMojo.java#L64-L118
train
gwt-maven-plugin/gwt-maven-plugin
generated-archetype/some-artifact/src/main/java/com/company/server/GreetingServiceImpl.java
GreetingServiceImpl.escapeHtml
private String escapeHtml(String html) { if (html == null) { return null; } return html.replaceAll("&", "&amp;").replaceAll("<", "&lt;").replaceAll( ">", "&gt;"); }
java
private String escapeHtml(String html) { if (html == null) { return null; } return html.replaceAll("&", "&amp;").replaceAll("<", "&lt;").replaceAll( ">", "&gt;"); }
[ "private", "String", "escapeHtml", "(", "String", "html", ")", "{", "if", "(", "html", "==", "null", ")", "{", "return", "null", ";", "}", "return", "html", ".", "replaceAll", "(", "\"&\"", ",", "\"&amp;\"", ")", ".", "replaceAll", "(", "\"<\"", ",", ...
Escape an html string. Escaping data received from the client helps to prevent cross-site script vulnerabilities. @param html the html string to escape @return the escaped string
[ "Escape", "an", "html", "string", ".", "Escaping", "data", "received", "from", "the", "client", "helps", "to", "prevent", "cross", "-", "site", "script", "vulnerabilities", "." ]
0cdd5054b43f182cc22a8acf61ec79ac42b0dfdc
https://github.com/gwt-maven-plugin/gwt-maven-plugin/blob/0cdd5054b43f182cc22a8acf61ec79ac42b0dfdc/generated-archetype/some-artifact/src/main/java/com/company/server/GreetingServiceImpl.java#L41-L47
train
eurekaclinical/eurekaclinical-common
src/main/java/org/eurekaclinical/common/filter/AutoAuthCriteriaParser.java
AutoAuthCriteriaParser.parse
public boolean parse(String criteria, Map<String, ? extends Object> attributes) throws CriteriaParseException { if (criteria == null) { return true; } else { try { return Boolean.parseBoolean(FREEMARKER_BUILTINS.eval(criteria, attributes)); } catch (Te...
java
public boolean parse(String criteria, Map<String, ? extends Object> attributes) throws CriteriaParseException { if (criteria == null) { return true; } else { try { return Boolean.parseBoolean(FREEMARKER_BUILTINS.eval(criteria, attributes)); } catch (Te...
[ "public", "boolean", "parse", "(", "String", "criteria", ",", "Map", "<", "String", ",", "?", "extends", "Object", ">", "attributes", ")", "throws", "CriteriaParseException", "{", "if", "(", "criteria", "==", "null", ")", "{", "return", "true", ";", "}", ...
Parses the provided criteria expression, which must have a boolean value. @param criteria the criteria expression string. If <code>null</code>, this method returns <code>true</code>. @param attributes any user attribute-value pairs. The attribute names may be used as variables. @return <code>true</code> if the provide...
[ "Parses", "the", "provided", "criteria", "expression", "which", "must", "have", "a", "boolean", "value", "." ]
1867102ff43fe94e519f76a074d5f5923e9be61c
https://github.com/eurekaclinical/eurekaclinical-common/blob/1867102ff43fe94e519f76a074d5f5923e9be61c/src/main/java/org/eurekaclinical/common/filter/AutoAuthCriteriaParser.java#L49-L59
train
eurekaclinical/eurekaclinical-common
src/main/java/org/eurekaclinical/common/auth/AuthorizedUserSupport.java
AuthorizedUserSupport.getUser
public E getUser(HttpServletRequest servletRequest) { AttributePrincipal principal = getUserPrincipal(servletRequest); E result = this.userDao.getByPrincipal(principal); if (result == null) { throw new HttpStatusException(Status.FORBIDDEN, "User " + principal.getName() + " is not...
java
public E getUser(HttpServletRequest servletRequest) { AttributePrincipal principal = getUserPrincipal(servletRequest); E result = this.userDao.getByPrincipal(principal); if (result == null) { throw new HttpStatusException(Status.FORBIDDEN, "User " + principal.getName() + " is not...
[ "public", "E", "getUser", "(", "HttpServletRequest", "servletRequest", ")", "{", "AttributePrincipal", "principal", "=", "getUserPrincipal", "(", "servletRequest", ")", ";", "E", "result", "=", "this", ".", "userDao", ".", "getByPrincipal", "(", "principal", ")", ...
Returns the user object, or if there isn't one, throws an exception. @param servletRequest the HTTP servlet request. @return the user object. @throws HttpStatusException if the logged-in user isn't in the user table, which means the user is not authorized to use eureka-protempa-etl.
[ "Returns", "the", "user", "object", "or", "if", "there", "isn", "t", "one", "throws", "an", "exception", "." ]
1867102ff43fe94e519f76a074d5f5923e9be61c
https://github.com/eurekaclinical/eurekaclinical-common/blob/1867102ff43fe94e519f76a074d5f5923e9be61c/src/main/java/org/eurekaclinical/common/auth/AuthorizedUserSupport.java#L61-L68
train
eurekaclinical/eurekaclinical-common
src/main/java/org/eurekaclinical/common/config/ClientSessionListener.java
ClientSessionListener.attributeReplaced
@Override public void attributeReplaced(HttpSessionBindingEvent hse) { Object possibleClient = hse.getValue(); closeClient(possibleClient); }
java
@Override public void attributeReplaced(HttpSessionBindingEvent hse) { Object possibleClient = hse.getValue(); closeClient(possibleClient); }
[ "@", "Override", "public", "void", "attributeReplaced", "(", "HttpSessionBindingEvent", "hse", ")", "{", "Object", "possibleClient", "=", "hse", ".", "getValue", "(", ")", ";", "closeClient", "(", "possibleClient", ")", ";", "}" ]
Attempts to close the old client. @param hse the session binding event.
[ "Attempts", "to", "close", "the", "old", "client", "." ]
1867102ff43fe94e519f76a074d5f5923e9be61c
https://github.com/eurekaclinical/eurekaclinical-common/blob/1867102ff43fe94e519f76a074d5f5923e9be61c/src/main/java/org/eurekaclinical/common/config/ClientSessionListener.java#L52-L56
train
eurekaclinical/eurekaclinical-common
src/main/java/org/eurekaclinical/common/config/ClientSessionListener.java
ClientSessionListener.attributeRemoved
@Override public void attributeRemoved(HttpSessionBindingEvent hse) { Object possibleClient = hse.getValue(); closeClient(possibleClient); }
java
@Override public void attributeRemoved(HttpSessionBindingEvent hse) { Object possibleClient = hse.getValue(); closeClient(possibleClient); }
[ "@", "Override", "public", "void", "attributeRemoved", "(", "HttpSessionBindingEvent", "hse", ")", "{", "Object", "possibleClient", "=", "hse", ".", "getValue", "(", ")", ";", "closeClient", "(", "possibleClient", ")", ";", "}" ]
Attempts to close the client. @param hse the session event.
[ "Attempts", "to", "close", "the", "client", "." ]
1867102ff43fe94e519f76a074d5f5923e9be61c
https://github.com/eurekaclinical/eurekaclinical-common/blob/1867102ff43fe94e519f76a074d5f5923e9be61c/src/main/java/org/eurekaclinical/common/config/ClientSessionListener.java#L63-L67
train
eurekaclinical/eurekaclinical-common
src/main/java/org/eurekaclinical/common/comm/clients/EurekaClinicalClient.java
EurekaClinicalClient.doDelete
protected void doDelete(String path, MultivaluedMap<String, String> headers) throws ClientException { this.readLock.lock(); try { ClientResponse response = this.getResourceWrapper() .rewritten(path, HttpMethod.DELETE) .delete(ClientResponse.class); ...
java
protected void doDelete(String path, MultivaluedMap<String, String> headers) throws ClientException { this.readLock.lock(); try { ClientResponse response = this.getResourceWrapper() .rewritten(path, HttpMethod.DELETE) .delete(ClientResponse.class); ...
[ "protected", "void", "doDelete", "(", "String", "path", ",", "MultivaluedMap", "<", "String", ",", "String", ">", "headers", ")", "throws", "ClientException", "{", "this", ".", "readLock", ".", "lock", "(", ")", ";", "try", "{", "ClientResponse", "response",...
Deletes the resource specified by the path. @param headers any HTTP headers. Can be <code>null</code>. @param path the path to the resource. Cannot be <code>null</code>. @throws ClientException if a status code other than 204 (No Content), 202 (Accepted), and 200 (OK) is returned.
[ "Deletes", "the", "resource", "specified", "by", "the", "path", "." ]
1867102ff43fe94e519f76a074d5f5923e9be61c
https://github.com/eurekaclinical/eurekaclinical-common/blob/1867102ff43fe94e519f76a074d5f5923e9be61c/src/main/java/org/eurekaclinical/common/comm/clients/EurekaClinicalClient.java#L129-L142
train
eurekaclinical/eurekaclinical-common
src/main/java/org/eurekaclinical/common/comm/clients/EurekaClinicalClient.java
EurekaClinicalClient.doPut
protected void doPut(String path) throws ClientException { this.readLock.lock(); try { ClientResponse response = this.getResourceWrapper() .rewritten(path, HttpMethod.PUT) .put(ClientResponse.class); errorIfStatusNotEqualTo(response, Client...
java
protected void doPut(String path) throws ClientException { this.readLock.lock(); try { ClientResponse response = this.getResourceWrapper() .rewritten(path, HttpMethod.PUT) .put(ClientResponse.class); errorIfStatusNotEqualTo(response, Client...
[ "protected", "void", "doPut", "(", "String", "path", ")", "throws", "ClientException", "{", "this", ".", "readLock", ".", "lock", "(", ")", ";", "try", "{", "ClientResponse", "response", "=", "this", ".", "getResourceWrapper", "(", ")", ".", "rewritten", "...
Updates the resource specified by the path, for situations where the nature of the update is completely specified by the path alone. @param path the path to the resource. Cannot be <code>null</code>. @throws ClientException if a status code other than 204 (No Content) and 200 (OK) is returned.
[ "Updates", "the", "resource", "specified", "by", "the", "path", "for", "situations", "where", "the", "nature", "of", "the", "update", "is", "completely", "specified", "by", "the", "path", "alone", "." ]
1867102ff43fe94e519f76a074d5f5923e9be61c
https://github.com/eurekaclinical/eurekaclinical-common/blob/1867102ff43fe94e519f76a074d5f5923e9be61c/src/main/java/org/eurekaclinical/common/comm/clients/EurekaClinicalClient.java#L153-L166
train
eurekaclinical/eurekaclinical-common
src/main/java/org/eurekaclinical/common/comm/clients/EurekaClinicalClient.java
EurekaClinicalClient.doPut
protected void doPut(String path, Object o) throws ClientException { doPut(path, o, null); }
java
protected void doPut(String path, Object o) throws ClientException { doPut(path, o, null); }
[ "protected", "void", "doPut", "(", "String", "path", ",", "Object", "o", ")", "throws", "ClientException", "{", "doPut", "(", "path", ",", "o", ",", "null", ")", ";", "}" ]
Updates the resource specified by the path. Sends to the server a Content Type header for JSON. @param o the updated object, will be transmitted as JSON. It must be a Java bean or an object that the object mapper that is in use knows about. @param path the path to the resource. Cannot be <code>null</code>. @throws Cl...
[ "Updates", "the", "resource", "specified", "by", "the", "path", ".", "Sends", "to", "the", "server", "a", "Content", "Type", "header", "for", "JSON", "." ]
1867102ff43fe94e519f76a074d5f5923e9be61c
https://github.com/eurekaclinical/eurekaclinical-common/blob/1867102ff43fe94e519f76a074d5f5923e9be61c/src/main/java/org/eurekaclinical/common/comm/clients/EurekaClinicalClient.java#L179-L181
train
eurekaclinical/eurekaclinical-common
src/main/java/org/eurekaclinical/common/comm/clients/EurekaClinicalClient.java
EurekaClinicalClient.doGet
protected <T> T doGet(String path, Class<T> cls) throws ClientException { return doGet(path, cls, null); }
java
protected <T> T doGet(String path, Class<T> cls) throws ClientException { return doGet(path, cls, null); }
[ "protected", "<", "T", ">", "T", "doGet", "(", "String", "path", ",", "Class", "<", "T", ">", "cls", ")", "throws", "ClientException", "{", "return", "doGet", "(", "path", ",", "cls", ",", "null", ")", ";", "}" ]
Gets the resource specified by the path. Sends to the server an Accepts header for JSON. @param <T> the type of the resource. @param path the path to the resource. Cannot be <code>null</code>. @param cls the type of the resource. Cannot be <code>null</code>. @return the resource. @throws ClientException if a status ...
[ "Gets", "the", "resource", "specified", "by", "the", "path", ".", "Sends", "to", "the", "server", "an", "Accepts", "header", "for", "JSON", "." ]
1867102ff43fe94e519f76a074d5f5923e9be61c
https://github.com/eurekaclinical/eurekaclinical-common/blob/1867102ff43fe94e519f76a074d5f5923e9be61c/src/main/java/org/eurekaclinical/common/comm/clients/EurekaClinicalClient.java#L225-L227
train
eurekaclinical/eurekaclinical-common
src/main/java/org/eurekaclinical/common/comm/clients/EurekaClinicalClient.java
EurekaClinicalClient.doGet
protected <T> T doGet(String path, Class<T> cls, MultivaluedMap<String, String> headers) throws ClientException { this.readLock.lock(); try { WebResource.Builder requestBuilder = getResourceWrapper().rewritten(path, HttpMethod.GET).getRequestBuilder(); requestBuilder = ensureJson...
java
protected <T> T doGet(String path, Class<T> cls, MultivaluedMap<String, String> headers) throws ClientException { this.readLock.lock(); try { WebResource.Builder requestBuilder = getResourceWrapper().rewritten(path, HttpMethod.GET).getRequestBuilder(); requestBuilder = ensureJson...
[ "protected", "<", "T", ">", "T", "doGet", "(", "String", "path", ",", "Class", "<", "T", ">", "cls", ",", "MultivaluedMap", "<", "String", ",", "String", ">", "headers", ")", "throws", "ClientException", "{", "this", ".", "readLock", ".", "lock", "(", ...
Gets the resource specified by the path. @param <T> the type of the resource. @param path the path to the resource. Cannot be <code>null</code>. @param cls the type of the resource. Cannot be <code>null</code>. @param headers any headers. if no Accepts header is provided, an Accepts header for JSON will be added. @re...
[ "Gets", "the", "resource", "specified", "by", "the", "path", "." ]
1867102ff43fe94e519f76a074d5f5923e9be61c
https://github.com/eurekaclinical/eurekaclinical-common/blob/1867102ff43fe94e519f76a074d5f5923e9be61c/src/main/java/org/eurekaclinical/common/comm/clients/EurekaClinicalClient.java#L242-L255
train
eurekaclinical/eurekaclinical-common
src/main/java/org/eurekaclinical/common/comm/clients/EurekaClinicalClient.java
EurekaClinicalClient.doGet
protected <T> T doGet(String path, MultivaluedMap<String, String> queryParams, GenericType<T> genericType) throws ClientException { return doGet(path, queryParams, genericType, null); }
java
protected <T> T doGet(String path, MultivaluedMap<String, String> queryParams, GenericType<T> genericType) throws ClientException { return doGet(path, queryParams, genericType, null); }
[ "protected", "<", "T", ">", "T", "doGet", "(", "String", "path", ",", "MultivaluedMap", "<", "String", ",", "String", ">", "queryParams", ",", "GenericType", "<", "T", ">", "genericType", ")", "throws", "ClientException", "{", "return", "doGet", "(", "path...
Gets the requested resource. Adds an appropriate Accepts header. @param <T> the type of the requested resource. @param path the path to the resource. @param queryParams any query parameters to send. @param genericType the type of the requested resource. @return the requested resource. @throws ClientException if a stat...
[ "Gets", "the", "requested", "resource", ".", "Adds", "an", "appropriate", "Accepts", "header", "." ]
1867102ff43fe94e519f76a074d5f5923e9be61c
https://github.com/eurekaclinical/eurekaclinical-common/blob/1867102ff43fe94e519f76a074d5f5923e9be61c/src/main/java/org/eurekaclinical/common/comm/clients/EurekaClinicalClient.java#L398-L400
train
eurekaclinical/eurekaclinical-common
src/main/java/org/eurekaclinical/common/comm/clients/EurekaClinicalClient.java
EurekaClinicalClient.doPost
protected <T> T doPost(String path, MultivaluedMap<String, String> formParams, Class<T> cls, MultivaluedMap<String, String> headers) throws ClientException { this.readLock.lock(); try { WebResource.Builder requestBuilder = getResourceWrapper().rewritten(path, HttpMethod.POST).getRequestBuild...
java
protected <T> T doPost(String path, MultivaluedMap<String, String> formParams, Class<T> cls, MultivaluedMap<String, String> headers) throws ClientException { this.readLock.lock(); try { WebResource.Builder requestBuilder = getResourceWrapper().rewritten(path, HttpMethod.POST).getRequestBuild...
[ "protected", "<", "T", ">", "T", "doPost", "(", "String", "path", ",", "MultivaluedMap", "<", "String", ",", "String", ">", "formParams", ",", "Class", "<", "T", ">", "cls", ",", "MultivaluedMap", "<", "String", ",", "String", ">", "headers", ")", "thr...
Submits a form and gets back a JSON object. @param <T> the type of the object that is expected in the response. @param path the API to call. @param formParams the form parameters to send. @param cls the type of object that is expected in the response. @param headers any headers. If there is no Accepts header, an Accep...
[ "Submits", "a", "form", "and", "gets", "back", "a", "JSON", "object", "." ]
1867102ff43fe94e519f76a074d5f5923e9be61c
https://github.com/eurekaclinical/eurekaclinical-common/blob/1867102ff43fe94e519f76a074d5f5923e9be61c/src/main/java/org/eurekaclinical/common/comm/clients/EurekaClinicalClient.java#L460-L473
train
eurekaclinical/eurekaclinical-common
src/main/java/org/eurekaclinical/common/comm/clients/EurekaClinicalClient.java
EurekaClinicalClient.doPost
protected void doPost(String path) throws ClientException { this.readLock.lock(); try { ClientResponse response = getResourceWrapper().rewritten(path, HttpMethod.POST) .post(ClientResponse.class); errorIfStatusNotEqualTo(response, ClientResponse.Status.OK, Cli...
java
protected void doPost(String path) throws ClientException { this.readLock.lock(); try { ClientResponse response = getResourceWrapper().rewritten(path, HttpMethod.POST) .post(ClientResponse.class); errorIfStatusNotEqualTo(response, ClientResponse.Status.OK, Cli...
[ "protected", "void", "doPost", "(", "String", "path", ")", "throws", "ClientException", "{", "this", ".", "readLock", ".", "lock", "(", ")", ";", "try", "{", "ClientResponse", "response", "=", "getResourceWrapper", "(", ")", ".", "rewritten", "(", "path", ...
Makes a POST call to the specified path. @param path the path to call. @throws ClientException if a status code other than 200 (OK) and 204 (No Content) is returned.
[ "Makes", "a", "POST", "call", "to", "the", "specified", "path", "." ]
1867102ff43fe94e519f76a074d5f5923e9be61c
https://github.com/eurekaclinical/eurekaclinical-common/blob/1867102ff43fe94e519f76a074d5f5923e9be61c/src/main/java/org/eurekaclinical/common/comm/clients/EurekaClinicalClient.java#L527-L539
train
eurekaclinical/eurekaclinical-common
src/main/java/org/eurekaclinical/common/comm/clients/EurekaClinicalClient.java
EurekaClinicalClient.doPostForm
protected void doPostForm(String path, MultivaluedMap<String, String> formParams) throws ClientException { doPostForm(path, formParams, null); }
java
protected void doPostForm(String path, MultivaluedMap<String, String> formParams) throws ClientException { doPostForm(path, formParams, null); }
[ "protected", "void", "doPostForm", "(", "String", "path", ",", "MultivaluedMap", "<", "String", ",", "String", ">", "formParams", ")", "throws", "ClientException", "{", "doPostForm", "(", "path", ",", "formParams", ",", "null", ")", ";", "}" ]
Submits a form. Adds appropriate Accepts and Content Type headers. @param path the API to call. @param formParams the form parameters to send. @throws ClientException if a status code other than 200 (OK) and 204 (No Content) is returned.
[ "Submits", "a", "form", ".", "Adds", "appropriate", "Accepts", "and", "Content", "Type", "headers", "." ]
1867102ff43fe94e519f76a074d5f5923e9be61c
https://github.com/eurekaclinical/eurekaclinical-common/blob/1867102ff43fe94e519f76a074d5f5923e9be61c/src/main/java/org/eurekaclinical/common/comm/clients/EurekaClinicalClient.java#L550-L552
train
eurekaclinical/eurekaclinical-common
src/main/java/org/eurekaclinical/common/comm/clients/EurekaClinicalClient.java
EurekaClinicalClient.doPostForm
protected void doPostForm(String path, MultivaluedMap<String, String> formParams, MultivaluedMap<String, String> headers) throws ClientException { this.readLock.lock(); try { WebResource.Builder requestBuilder = getResourceWrapper().rewritten(path, HttpMethod.POST).getRequestBuilder(); ...
java
protected void doPostForm(String path, MultivaluedMap<String, String> formParams, MultivaluedMap<String, String> headers) throws ClientException { this.readLock.lock(); try { WebResource.Builder requestBuilder = getResourceWrapper().rewritten(path, HttpMethod.POST).getRequestBuilder(); ...
[ "protected", "void", "doPostForm", "(", "String", "path", ",", "MultivaluedMap", "<", "String", ",", "String", ">", "formParams", ",", "MultivaluedMap", "<", "String", ",", "String", ">", "headers", ")", "throws", "ClientException", "{", "this", ".", "readLock...
Submits a form. @param path the API to call. @param formParams the multi-part form content. @param headers any headers to send. If no Content Type header is specified, it adds a Content Type for form data. @throws ClientException if a status code other than 200 (OK) and 204 (No Content) is returned.
[ "Submits", "a", "form", "." ]
1867102ff43fe94e519f76a074d5f5923e9be61c
https://github.com/eurekaclinical/eurekaclinical-common/blob/1867102ff43fe94e519f76a074d5f5923e9be61c/src/main/java/org/eurekaclinical/common/comm/clients/EurekaClinicalClient.java#L565-L578
train
eurekaclinical/eurekaclinical-common
src/main/java/org/eurekaclinical/common/comm/clients/EurekaClinicalClient.java
EurekaClinicalClient.doPostMultipart
public void doPostMultipart(String path, FormDataMultiPart formDataMultiPart) throws ClientException { this.readLock.lock(); try { ClientResponse response = getResourceWrapper() .rewritten(path, HttpMethod.POST) .type(Boundary.addBoundary(MediaType.MUL...
java
public void doPostMultipart(String path, FormDataMultiPart formDataMultiPart) throws ClientException { this.readLock.lock(); try { ClientResponse response = getResourceWrapper() .rewritten(path, HttpMethod.POST) .type(Boundary.addBoundary(MediaType.MUL...
[ "public", "void", "doPostMultipart", "(", "String", "path", ",", "FormDataMultiPart", "formDataMultiPart", ")", "throws", "ClientException", "{", "this", ".", "readLock", ".", "lock", "(", ")", ";", "try", "{", "ClientResponse", "response", "=", "getResourceWrappe...
Submits a multi-part form. Adds appropriate Accepts and Content Type headers. @param path the API to call. @param formDataMultiPart the multi-part form content. @throws ClientException if a status code other than 200 (OK) and 204 (No Content) is returned.
[ "Submits", "a", "multi", "-", "part", "form", ".", "Adds", "appropriate", "Accepts", "and", "Content", "Type", "headers", "." ]
1867102ff43fe94e519f76a074d5f5923e9be61c
https://github.com/eurekaclinical/eurekaclinical-common/blob/1867102ff43fe94e519f76a074d5f5923e9be61c/src/main/java/org/eurekaclinical/common/comm/clients/EurekaClinicalClient.java#L639-L653
train
eurekaclinical/eurekaclinical-common
src/main/java/org/eurekaclinical/common/comm/clients/EurekaClinicalClient.java
EurekaClinicalClient.doPostMultipart
public void doPostMultipart(String path, FormDataMultiPart formDataMultiPart, MultivaluedMap<String, String> headers) throws ClientException { this.readLock.lock(); try { WebResource.Builder requestBuilder = getResourceWrapper() .rewritten(path, HttpMethod.POST).getReques...
java
public void doPostMultipart(String path, FormDataMultiPart formDataMultiPart, MultivaluedMap<String, String> headers) throws ClientException { this.readLock.lock(); try { WebResource.Builder requestBuilder = getResourceWrapper() .rewritten(path, HttpMethod.POST).getReques...
[ "public", "void", "doPostMultipart", "(", "String", "path", ",", "FormDataMultiPart", "formDataMultiPart", ",", "MultivaluedMap", "<", "String", ",", "String", ">", "headers", ")", "throws", "ClientException", "{", "this", ".", "readLock", ".", "lock", "(", ")",...
Submits a multi-part form. @param path the API to call. @param formDataMultiPart the multi-part form content. @param headers any headers to add. If no Content Type header is provided, this method adds a Content Type header for multi-part forms data. @throws ClientException if a status code other than 200 (OK) and 204...
[ "Submits", "a", "multi", "-", "part", "form", "." ]
1867102ff43fe94e519f76a074d5f5923e9be61c
https://github.com/eurekaclinical/eurekaclinical-common/blob/1867102ff43fe94e519f76a074d5f5923e9be61c/src/main/java/org/eurekaclinical/common/comm/clients/EurekaClinicalClient.java#L666-L681
train
eurekaclinical/eurekaclinical-common
src/main/java/org/eurekaclinical/common/comm/clients/EurekaClinicalClient.java
EurekaClinicalClient.doPostMultipart
protected void doPostMultipart(String path, InputStream inputStream) throws ClientException { doPostMultipart(path, inputStream, null); }
java
protected void doPostMultipart(String path, InputStream inputStream) throws ClientException { doPostMultipart(path, inputStream, null); }
[ "protected", "void", "doPostMultipart", "(", "String", "path", ",", "InputStream", "inputStream", ")", "throws", "ClientException", "{", "doPostMultipart", "(", "path", ",", "inputStream", ",", "null", ")", ";", "}" ]
Submits a multi-part form in an input stream. Adds appropriate Accepts and Content Type headers. @param path the the API to call. @param inputStream the multi-part form content. @throws ClientException if a status code other than 200 (OK) and 204 (No Content) is returned.
[ "Submits", "a", "multi", "-", "part", "form", "in", "an", "input", "stream", ".", "Adds", "appropriate", "Accepts", "and", "Content", "Type", "headers", "." ]
1867102ff43fe94e519f76a074d5f5923e9be61c
https://github.com/eurekaclinical/eurekaclinical-common/blob/1867102ff43fe94e519f76a074d5f5923e9be61c/src/main/java/org/eurekaclinical/common/comm/clients/EurekaClinicalClient.java#L693-L695
train
eurekaclinical/eurekaclinical-common
src/main/java/org/eurekaclinical/common/comm/clients/EurekaClinicalClient.java
EurekaClinicalClient.doPostCreate
protected URI doPostCreate(String path, Object o) throws ClientException { return doPostCreate(path, o, null); }
java
protected URI doPostCreate(String path, Object o) throws ClientException { return doPostCreate(path, o, null); }
[ "protected", "URI", "doPostCreate", "(", "String", "path", ",", "Object", "o", ")", "throws", "ClientException", "{", "return", "doPostCreate", "(", "path", ",", "o", ",", "null", ")", ";", "}" ]
Creates a resource specified as a JSON object. Adds appropriate Accepts and Content Type headers. @param path the the API to call. @param o the object that will be converted to JSON for sending. Must either be a Java bean or be recognized by the object mapper. @return the URI representing the created resource, for use...
[ "Creates", "a", "resource", "specified", "as", "a", "JSON", "object", ".", "Adds", "appropriate", "Accepts", "and", "Content", "Type", "headers", "." ]
1867102ff43fe94e519f76a074d5f5923e9be61c
https://github.com/eurekaclinical/eurekaclinical-common/blob/1867102ff43fe94e519f76a074d5f5923e9be61c/src/main/java/org/eurekaclinical/common/comm/clients/EurekaClinicalClient.java#L737-L739
train
eurekaclinical/eurekaclinical-common
src/main/java/org/eurekaclinical/common/comm/clients/EurekaClinicalClient.java
EurekaClinicalClient.doPostCreate
protected URI doPostCreate(String path, Object o, MultivaluedMap<String, String> headers) throws ClientException { this.readLock.lock(); try { WebResource.Builder requestBuilder = getResourceWrapper().rewritten(path, HttpMethod.POST).getRequestBuilder(); requestBuilder = ensurePo...
java
protected URI doPostCreate(String path, Object o, MultivaluedMap<String, String> headers) throws ClientException { this.readLock.lock(); try { WebResource.Builder requestBuilder = getResourceWrapper().rewritten(path, HttpMethod.POST).getRequestBuilder(); requestBuilder = ensurePo...
[ "protected", "URI", "doPostCreate", "(", "String", "path", ",", "Object", "o", ",", "MultivaluedMap", "<", "String", ",", "String", ">", "headers", ")", "throws", "ClientException", "{", "this", ".", "readLock", ".", "lock", "(", ")", ";", "try", "{", "W...
Creates a resource specified as a JSON object. @param path the the API to call. @param o the object that will be converted to JSON for sending. Must either be a Java bean or be recognized by the object mapper. @param headers If no Content Type header is provided, this method adds a Content Type header for JSON. @retur...
[ "Creates", "a", "resource", "specified", "as", "a", "JSON", "object", "." ]
1867102ff43fe94e519f76a074d5f5923e9be61c
https://github.com/eurekaclinical/eurekaclinical-common/blob/1867102ff43fe94e519f76a074d5f5923e9be61c/src/main/java/org/eurekaclinical/common/comm/clients/EurekaClinicalClient.java#L754-L771
train
eurekaclinical/eurekaclinical-common
src/main/java/org/eurekaclinical/common/comm/clients/EurekaClinicalClient.java
EurekaClinicalClient.doPostCreateMultipart
protected URI doPostCreateMultipart(String path, InputStream inputStream) throws ClientException { return doPostCreateMultipart(path, inputStream, null); }
java
protected URI doPostCreateMultipart(String path, InputStream inputStream) throws ClientException { return doPostCreateMultipart(path, inputStream, null); }
[ "protected", "URI", "doPostCreateMultipart", "(", "String", "path", ",", "InputStream", "inputStream", ")", "throws", "ClientException", "{", "return", "doPostCreateMultipart", "(", "path", ",", "inputStream", ",", "null", ")", ";", "}" ]
Creates a resource specified as a multi-part form in an input stream. Adds appropriate Accepts and Content Type headers. @param path the the API to call. @param inputStream the multi-part form content. @return the URI representing the created resource, for use in subsequent operations on the resource. @throws ClientEx...
[ "Creates", "a", "resource", "specified", "as", "a", "multi", "-", "part", "form", "in", "an", "input", "stream", ".", "Adds", "appropriate", "Accepts", "and", "Content", "Type", "headers", "." ]
1867102ff43fe94e519f76a074d5f5923e9be61c
https://github.com/eurekaclinical/eurekaclinical-common/blob/1867102ff43fe94e519f76a074d5f5923e9be61c/src/main/java/org/eurekaclinical/common/comm/clients/EurekaClinicalClient.java#L784-L786
train
eurekaclinical/eurekaclinical-common
src/main/java/org/eurekaclinical/common/comm/clients/EurekaClinicalClient.java
EurekaClinicalClient.doPostCreateMultipart
protected URI doPostCreateMultipart(String path, InputStream inputStream, MultivaluedMap<String, String> headers) throws ClientException { this.readLock.lock(); try { WebResource.Builder requestBuilder = getResourceWrapper().rewritten(path, HttpMethod.POST).getRequestBuilder(); r...
java
protected URI doPostCreateMultipart(String path, InputStream inputStream, MultivaluedMap<String, String> headers) throws ClientException { this.readLock.lock(); try { WebResource.Builder requestBuilder = getResourceWrapper().rewritten(path, HttpMethod.POST).getRequestBuilder(); r...
[ "protected", "URI", "doPostCreateMultipart", "(", "String", "path", ",", "InputStream", "inputStream", ",", "MultivaluedMap", "<", "String", ",", "String", ">", "headers", ")", "throws", "ClientException", "{", "this", ".", "readLock", ".", "lock", "(", ")", "...
Creates a resource specified as a multi-part form in an input stream. @param path the the API to call. @param inputStream the multi-part form content. @param headers any headers to send. If no Accepts header is provided, this method as an Accepts header for text/plain. If no Content Type header is provided, this metho...
[ "Creates", "a", "resource", "specified", "as", "a", "multi", "-", "part", "form", "in", "an", "input", "stream", "." ]
1867102ff43fe94e519f76a074d5f5923e9be61c
https://github.com/eurekaclinical/eurekaclinical-common/blob/1867102ff43fe94e519f76a074d5f5923e9be61c/src/main/java/org/eurekaclinical/common/comm/clients/EurekaClinicalClient.java#L802-L819
train
eurekaclinical/eurekaclinical-common
src/main/java/org/eurekaclinical/common/comm/clients/EurekaClinicalClient.java
EurekaClinicalClient.doPostCreateMultipart
protected URI doPostCreateMultipart(String path, FormDataMultiPart formDataMultiPart) throws ClientException { this.readLock.lock(); try { ClientResponse response = getResourceWrapper() .rewritten(path, HttpMethod.POST) .type(Boundary.addBoundary(Media...
java
protected URI doPostCreateMultipart(String path, FormDataMultiPart formDataMultiPart) throws ClientException { this.readLock.lock(); try { ClientResponse response = getResourceWrapper() .rewritten(path, HttpMethod.POST) .type(Boundary.addBoundary(Media...
[ "protected", "URI", "doPostCreateMultipart", "(", "String", "path", ",", "FormDataMultiPart", "formDataMultiPart", ")", "throws", "ClientException", "{", "this", ".", "readLock", ".", "lock", "(", ")", ";", "try", "{", "ClientResponse", "response", "=", "getResour...
Creates a resource specified as a multi-part form. Adds appropriate Accepts and Content Type headers. @param path the the API to call. @param formDataMultiPart the form content. @return the URI representing the created resource, for use in subsequent operations on the resource. @throws ClientException if a status code...
[ "Creates", "a", "resource", "specified", "as", "a", "multi", "-", "part", "form", ".", "Adds", "appropriate", "Accepts", "and", "Content", "Type", "headers", "." ]
1867102ff43fe94e519f76a074d5f5923e9be61c
https://github.com/eurekaclinical/eurekaclinical-common/blob/1867102ff43fe94e519f76a074d5f5923e9be61c/src/main/java/org/eurekaclinical/common/comm/clients/EurekaClinicalClient.java#L832-L851
train
eurekaclinical/eurekaclinical-common
src/main/java/org/eurekaclinical/common/comm/clients/EurekaClinicalClient.java
EurekaClinicalClient.doPostForProxy
protected ClientResponse doPostForProxy(String path, InputStream inputStream, MultivaluedMap<String, String> parameterMap, MultivaluedMap<String, String> headers) throws ClientException { this.readLock.lock(); try { WebResource.Builder requestBuilder = getResourceWrapper().rewritten(path, Ht...
java
protected ClientResponse doPostForProxy(String path, InputStream inputStream, MultivaluedMap<String, String> parameterMap, MultivaluedMap<String, String> headers) throws ClientException { this.readLock.lock(); try { WebResource.Builder requestBuilder = getResourceWrapper().rewritten(path, Ht...
[ "protected", "ClientResponse", "doPostForProxy", "(", "String", "path", ",", "InputStream", "inputStream", ",", "MultivaluedMap", "<", "String", ",", "String", ">", "parameterMap", ",", "MultivaluedMap", "<", "String", ",", "String", ">", "headers", ")", "throws",...
Passes a new resource, form or other POST body to a proxied server. @param path the path to the resource. Cannot be <code>null</code>. @param inputStream the contents of the POST body. Cannot be <code>null</code>. @param parameterMap query parameters. May be <code>null</code>. @param headers any request headers to add...
[ "Passes", "a", "new", "resource", "form", "or", "other", "POST", "body", "to", "a", "proxied", "server", "." ]
1867102ff43fe94e519f76a074d5f5923e9be61c
https://github.com/eurekaclinical/eurekaclinical-common/blob/1867102ff43fe94e519f76a074d5f5923e9be61c/src/main/java/org/eurekaclinical/common/comm/clients/EurekaClinicalClient.java#L868-L879
train
eurekaclinical/eurekaclinical-common
src/main/java/org/eurekaclinical/common/comm/clients/EurekaClinicalClient.java
EurekaClinicalClient.doGetForProxy
protected ClientResponse doGetForProxy(String path, MultivaluedMap<String, String> parameterMap, MultivaluedMap<String, String> headers) throws ClientException { this.readLock.lock(); try { WebResource.Builder requestBuilder = getResourceWrapper().rewritten(path, HttpMethod.GET, parameterMap...
java
protected ClientResponse doGetForProxy(String path, MultivaluedMap<String, String> parameterMap, MultivaluedMap<String, String> headers) throws ClientException { this.readLock.lock(); try { WebResource.Builder requestBuilder = getResourceWrapper().rewritten(path, HttpMethod.GET, parameterMap...
[ "protected", "ClientResponse", "doGetForProxy", "(", "String", "path", ",", "MultivaluedMap", "<", "String", ",", "String", ">", "parameterMap", ",", "MultivaluedMap", "<", "String", ",", "String", ">", "headers", ")", "throws", "ClientException", "{", "this", "...
Gets a resource from a proxied server. @param path the path to the resource. Cannot be <code>null</code>. @param parameterMap query parameters. May be <code>null</code>. @param headers any request headers to add. @return ClientResponse the proxied server's response information. @throws ClientException if the proxied...
[ "Gets", "a", "resource", "from", "a", "proxied", "server", "." ]
1867102ff43fe94e519f76a074d5f5923e9be61c
https://github.com/eurekaclinical/eurekaclinical-common/blob/1867102ff43fe94e519f76a074d5f5923e9be61c/src/main/java/org/eurekaclinical/common/comm/clients/EurekaClinicalClient.java#L978-L989
train
eurekaclinical/eurekaclinical-common
src/main/java/org/eurekaclinical/common/comm/clients/EurekaClinicalClient.java
EurekaClinicalClient.doDeleteForProxy
protected ClientResponse doDeleteForProxy(String path, MultivaluedMap<String, String> parameterMap, MultivaluedMap<String, String> headers) throws ClientException { this.readLock.lock(); try { WebResource.Builder requestBuilder = getResourceWrapper().rewritten(path, HttpMethod.DELETE, parame...
java
protected ClientResponse doDeleteForProxy(String path, MultivaluedMap<String, String> parameterMap, MultivaluedMap<String, String> headers) throws ClientException { this.readLock.lock(); try { WebResource.Builder requestBuilder = getResourceWrapper().rewritten(path, HttpMethod.DELETE, parame...
[ "protected", "ClientResponse", "doDeleteForProxy", "(", "String", "path", ",", "MultivaluedMap", "<", "String", ",", "String", ">", "parameterMap", ",", "MultivaluedMap", "<", "String", ",", "String", ">", "headers", ")", "throws", "ClientException", "{", "this", ...
Deletes a resource from a proxied server. @param path the path to the resource. Cannot be <code>null</code>. @param parameterMap query parameters. May be <code>null</code>. @param headers any request headers to add. @return ClientResponse the proxied server's response information. @throws ClientException if the prox...
[ "Deletes", "a", "resource", "from", "a", "proxied", "server", "." ]
1867102ff43fe94e519f76a074d5f5923e9be61c
https://github.com/eurekaclinical/eurekaclinical-common/blob/1867102ff43fe94e519f76a074d5f5923e9be61c/src/main/java/org/eurekaclinical/common/comm/clients/EurekaClinicalClient.java#L1004-L1015
train
eurekaclinical/eurekaclinical-common
src/main/java/org/eurekaclinical/common/comm/clients/EurekaClinicalClient.java
EurekaClinicalClient.errorIfStatusEqualTo
protected void errorIfStatusEqualTo(ClientResponse response, ClientResponse.Status... status) throws ClientException { errorIf(response, status, true); }
java
protected void errorIfStatusEqualTo(ClientResponse response, ClientResponse.Status... status) throws ClientException { errorIf(response, status, true); }
[ "protected", "void", "errorIfStatusEqualTo", "(", "ClientResponse", "response", ",", "ClientResponse", ".", "Status", "...", "status", ")", "throws", "ClientException", "{", "errorIf", "(", "response", ",", "status", ",", "true", ")", ";", "}" ]
If there is an unexpected status code, this method gets the status message, closes the response, and throws an exception. @param response the response. @param status the expected status code(s). @throws ClientException if the response had a status code other than those listed.
[ "If", "there", "is", "an", "unexpected", "status", "code", "this", "method", "gets", "the", "status", "message", "closes", "the", "response", "and", "throws", "an", "exception", "." ]
1867102ff43fe94e519f76a074d5f5923e9be61c
https://github.com/eurekaclinical/eurekaclinical-common/blob/1867102ff43fe94e519f76a074d5f5923e9be61c/src/main/java/org/eurekaclinical/common/comm/clients/EurekaClinicalClient.java#L1026-L1029
train
eurekaclinical/eurekaclinical-common
src/main/java/org/eurekaclinical/common/comm/clients/EurekaClinicalClient.java
EurekaClinicalClient.extractId
protected Long extractId(URI uri) { String uriStr = uri.toString(); return Long.valueOf(uriStr.substring(uriStr.lastIndexOf("/") + 1)); }
java
protected Long extractId(URI uri) { String uriStr = uri.toString(); return Long.valueOf(uriStr.substring(uriStr.lastIndexOf("/") + 1)); }
[ "protected", "Long", "extractId", "(", "URI", "uri", ")", "{", "String", "uriStr", "=", "uri", ".", "toString", "(", ")", ";", "return", "Long", ".", "valueOf", "(", "uriStr", ".", "substring", "(", "uriStr", ".", "lastIndexOf", "(", "\"/\"", ")", "+",...
Extracts the id of the resource specified in the response body from a POST call. @param uri The URI. @return the id of the resource.
[ "Extracts", "the", "id", "of", "the", "resource", "specified", "in", "the", "response", "body", "from", "a", "POST", "call", "." ]
1867102ff43fe94e519f76a074d5f5923e9be61c
https://github.com/eurekaclinical/eurekaclinical-common/blob/1867102ff43fe94e519f76a074d5f5923e9be61c/src/main/java/org/eurekaclinical/common/comm/clients/EurekaClinicalClient.java#L1052-L1055
train
eurekaclinical/eurekaclinical-common
src/main/java/org/eurekaclinical/common/comm/clients/EurekaClinicalClient.java
EurekaClinicalClient.contains
private static boolean contains(Object[] arr, Object member) { for (Object mem : arr) { if (Objects.equals(mem, member)) { return true; } } return false; }
java
private static boolean contains(Object[] arr, Object member) { for (Object mem : arr) { if (Objects.equals(mem, member)) { return true; } } return false; }
[ "private", "static", "boolean", "contains", "(", "Object", "[", "]", "arr", ",", "Object", "member", ")", "{", "for", "(", "Object", "mem", ":", "arr", ")", "{", "if", "(", "Objects", ".", "equals", "(", "mem", ",", "member", ")", ")", "{", "return...
Tests array membership. @param arr the array. @param member an object. @return <code>true</code> if the provided object is a member of the provided array, or <code>false</code> if not.
[ "Tests", "array", "membership", "." ]
1867102ff43fe94e519f76a074d5f5923e9be61c
https://github.com/eurekaclinical/eurekaclinical-common/blob/1867102ff43fe94e519f76a074d5f5923e9be61c/src/main/java/org/eurekaclinical/common/comm/clients/EurekaClinicalClient.java#L1140-L1147
train
eurekaclinical/eurekaclinical-common
src/main/java/org/eurekaclinical/common/comm/clients/EurekaClinicalClient.java
EurekaClinicalClient.ensureJsonHeaders
private static WebResource.Builder ensureJsonHeaders(MultivaluedMap<String, String> headers, WebResource.Builder requestBuilder, boolean contentType, boolean accept) { boolean hasContentType = false; boolean hasAccept = false; if (headers != null) { for (Map.Entry<String, List<String...
java
private static WebResource.Builder ensureJsonHeaders(MultivaluedMap<String, String> headers, WebResource.Builder requestBuilder, boolean contentType, boolean accept) { boolean hasContentType = false; boolean hasAccept = false; if (headers != null) { for (Map.Entry<String, List<String...
[ "private", "static", "WebResource", ".", "Builder", "ensureJsonHeaders", "(", "MultivaluedMap", "<", "String", ",", "String", ">", "headers", ",", "WebResource", ".", "Builder", "requestBuilder", ",", "boolean", "contentType", ",", "boolean", "accept", ")", "{", ...
Adds the specified headers to the request builder. Provides default headers for JSON objects requests and submissions. @param headers the headers to add. @param requestBuilder the request builder. Cannot be <code>null</code>. @param contentType <code>true</code> to add a default Content Type header if no Content Type ...
[ "Adds", "the", "specified", "headers", "to", "the", "request", "builder", ".", "Provides", "default", "headers", "for", "JSON", "objects", "requests", "and", "submissions", "." ]
1867102ff43fe94e519f76a074d5f5923e9be61c
https://github.com/eurekaclinical/eurekaclinical-common/blob/1867102ff43fe94e519f76a074d5f5923e9be61c/src/main/java/org/eurekaclinical/common/comm/clients/EurekaClinicalClient.java#L1161-L1184
train
apptentive/apptentive-android
apptentive/src/main/java/com/apptentive/android/sdk/util/image/PreviewImageView.java
PreviewImageView.checkBorderAndCenterWhenScale
private void checkBorderAndCenterWhenScale() { RectF rect = getMatrixRectF(); float deltaX = 0; float deltaY = 0; int width = getWidth(); int height = getHeight(); if (rect.width() >= width) { if (rect.left > 0) { deltaX = -rect.left; } if (rect.right < width) { deltaX = width - rect.rig...
java
private void checkBorderAndCenterWhenScale() { RectF rect = getMatrixRectF(); float deltaX = 0; float deltaY = 0; int width = getWidth(); int height = getHeight(); if (rect.width() >= width) { if (rect.left > 0) { deltaX = -rect.left; } if (rect.right < width) { deltaX = width - rect.rig...
[ "private", "void", "checkBorderAndCenterWhenScale", "(", ")", "{", "RectF", "rect", "=", "getMatrixRectF", "(", ")", ";", "float", "deltaX", "=", "0", ";", "float", "deltaY", "=", "0", ";", "int", "width", "=", "getWidth", "(", ")", ";", "int", "height",...
Prevent visual artifact when scaling
[ "Prevent", "visual", "artifact", "when", "scaling" ]
887c08d7bd5ae6488a90366dfb58f58938861a93
https://github.com/apptentive/apptentive-android/blob/887c08d7bd5ae6488a90366dfb58f58938861a93/apptentive/src/main/java/com/apptentive/android/sdk/util/image/PreviewImageView.java#L267-L302
train
apptentive/apptentive-android
apptentive/src/main/java/com/apptentive/android/sdk/util/image/PreviewImageView.java
PreviewImageView.getMatrixRectF
private RectF getMatrixRectF() { Matrix matrix = scaleMatrix; RectF rect = new RectF(); Drawable d = getDrawable(); if (null != d) { rect.set(0, 0, d.getIntrinsicWidth(), d.getIntrinsicHeight()); matrix.mapRect(rect); } return rect; }
java
private RectF getMatrixRectF() { Matrix matrix = scaleMatrix; RectF rect = new RectF(); Drawable d = getDrawable(); if (null != d) { rect.set(0, 0, d.getIntrinsicWidth(), d.getIntrinsicHeight()); matrix.mapRect(rect); } return rect; }
[ "private", "RectF", "getMatrixRectF", "(", ")", "{", "Matrix", "matrix", "=", "scaleMatrix", ";", "RectF", "rect", "=", "new", "RectF", "(", ")", ";", "Drawable", "d", "=", "getDrawable", "(", ")", ";", "if", "(", "null", "!=", "d", ")", "{", "rect",...
Get image boundary from matrix @return
[ "Get", "image", "boundary", "from", "matrix" ]
887c08d7bd5ae6488a90366dfb58f58938861a93
https://github.com/apptentive/apptentive-android/blob/887c08d7bd5ae6488a90366dfb58f58938861a93/apptentive/src/main/java/com/apptentive/android/sdk/util/image/PreviewImageView.java#L309-L318
train
apptentive/apptentive-android
apptentive/src/main/java/com/apptentive/android/sdk/util/image/PreviewImageView.java
PreviewImageView.checkMatrixBounds
private void checkMatrixBounds() { RectF rect = getMatrixRectF(); float deltaX = 0, deltaY = 0; final float viewWidth = getWidth(); final float viewHeight = getHeight(); // Check if image boundary exceeds imageView boundary if (rect.top > 0 && isCheckTopAndBottom) { deltaY = -rect.top; } if (rect.bo...
java
private void checkMatrixBounds() { RectF rect = getMatrixRectF(); float deltaX = 0, deltaY = 0; final float viewWidth = getWidth(); final float viewHeight = getHeight(); // Check if image boundary exceeds imageView boundary if (rect.top > 0 && isCheckTopAndBottom) { deltaY = -rect.top; } if (rect.bo...
[ "private", "void", "checkMatrixBounds", "(", ")", "{", "RectF", "rect", "=", "getMatrixRectF", "(", ")", ";", "float", "deltaX", "=", "0", ",", "deltaY", "=", "0", ";", "final", "float", "viewWidth", "=", "getWidth", "(", ")", ";", "final", "float", "v...
Check image bounday against imageView
[ "Check", "image", "bounday", "against", "imageView" ]
887c08d7bd5ae6488a90366dfb58f58938861a93
https://github.com/apptentive/apptentive-android/blob/887c08d7bd5ae6488a90366dfb58f58938861a93/apptentive/src/main/java/com/apptentive/android/sdk/util/image/PreviewImageView.java#L323-L343
train
apptentive/apptentive-android
apptentive/src/main/java/com/apptentive/android/sdk/conversation/ConversationManager.java
ConversationManager.loadConversationFromMetadata
private @Nullable Conversation loadConversationFromMetadata(ConversationMetadata metadata) throws SerializerException, ConversationLoadException { // we're going to scan metadata in attempt to find existing conversations ConversationMetadataItem item; // if the user was logged in previously - we should have an a...
java
private @Nullable Conversation loadConversationFromMetadata(ConversationMetadata metadata) throws SerializerException, ConversationLoadException { // we're going to scan metadata in attempt to find existing conversations ConversationMetadataItem item; // if the user was logged in previously - we should have an a...
[ "private", "@", "Nullable", "Conversation", "loadConversationFromMetadata", "(", "ConversationMetadata", "metadata", ")", "throws", "SerializerException", ",", "ConversationLoadException", "{", "// we're going to scan metadata in attempt to find existing conversations", "ConversationMe...
Attempts to load an existing conversation based on metadata file @return <code>null</code> is only logged out conversations available
[ "Attempts", "to", "load", "an", "existing", "conversation", "based", "on", "metadata", "file" ]
887c08d7bd5ae6488a90366dfb58f58938861a93
https://github.com/apptentive/apptentive-android/blob/887c08d7bd5ae6488a90366dfb58f58938861a93/apptentive/src/main/java/com/apptentive/android/sdk/conversation/ConversationManager.java#L235-L274
train
apptentive/apptentive-android
apptentive/src/main/java/com/apptentive/android/sdk/conversation/ConversationManager.java
ConversationManager.handleConversationStateChange
private void handleConversationStateChange(Conversation conversation) { ApptentiveLog.d(CONVERSATION, "Conversation state changed: %s", conversation); checkConversationQueue(); assertTrue(conversation != null && !conversation.hasState(UNDEFINED)); if (conversation != null && !conversation.hasState(UNDEFINED))...
java
private void handleConversationStateChange(Conversation conversation) { ApptentiveLog.d(CONVERSATION, "Conversation state changed: %s", conversation); checkConversationQueue(); assertTrue(conversation != null && !conversation.hasState(UNDEFINED)); if (conversation != null && !conversation.hasState(UNDEFINED))...
[ "private", "void", "handleConversationStateChange", "(", "Conversation", "conversation", ")", "{", "ApptentiveLog", ".", "d", "(", "CONVERSATION", ",", "\"Conversation state changed: %s\"", ",", "conversation", ")", ";", "checkConversationQueue", "(", ")", ";", "assertT...
region Conversation fetching
[ "region", "Conversation", "fetching" ]
887c08d7bd5ae6488a90366dfb58f58938861a93
https://github.com/apptentive/apptentive-android/blob/887c08d7bd5ae6488a90366dfb58f58938861a93/apptentive/src/main/java/com/apptentive/android/sdk/conversation/ConversationManager.java#L554-L591
train
apptentive/apptentive-android
apptentive/src/main/java/com/apptentive/android/sdk/storage/VersionHistory.java
VersionHistory.getTimeAtInstallTotal
public Apptentive.DateTime getTimeAtInstallTotal() { // Simply return the first item's timestamp, if there is one. if (versionHistoryItems.size() > 0) { return new Apptentive.DateTime(versionHistoryItems.get(0).getTimestamp()); } return new Apptentive.DateTime(Util.currentTimeSeconds()); }
java
public Apptentive.DateTime getTimeAtInstallTotal() { // Simply return the first item's timestamp, if there is one. if (versionHistoryItems.size() > 0) { return new Apptentive.DateTime(versionHistoryItems.get(0).getTimestamp()); } return new Apptentive.DateTime(Util.currentTimeSeconds()); }
[ "public", "Apptentive", ".", "DateTime", "getTimeAtInstallTotal", "(", ")", "{", "// Simply return the first item's timestamp, if there is one.", "if", "(", "versionHistoryItems", ".", "size", "(", ")", ">", "0", ")", "{", "return", "new", "Apptentive", ".", "DateTime...
Returns the timestamp at the first install of this app that Apptentive was aware of.
[ "Returns", "the", "timestamp", "at", "the", "first", "install", "of", "this", "app", "that", "Apptentive", "was", "aware", "of", "." ]
887c08d7bd5ae6488a90366dfb58f58938861a93
https://github.com/apptentive/apptentive-android/blob/887c08d7bd5ae6488a90366dfb58f58938861a93/apptentive/src/main/java/com/apptentive/android/sdk/storage/VersionHistory.java#L65-L71
train
apptentive/apptentive-android
apptentive/src/main/java/com/apptentive/android/sdk/storage/VersionHistory.java
VersionHistory.getTimeAtInstallForVersionCode
public Apptentive.DateTime getTimeAtInstallForVersionCode(int versionCode) { for (VersionHistoryItem item : versionHistoryItems) { if (item.getVersionCode() == versionCode) { return new Apptentive.DateTime(item.getTimestamp()); } } return new Apptentive.DateTime(Util.currentTimeSeconds()); }
java
public Apptentive.DateTime getTimeAtInstallForVersionCode(int versionCode) { for (VersionHistoryItem item : versionHistoryItems) { if (item.getVersionCode() == versionCode) { return new Apptentive.DateTime(item.getTimestamp()); } } return new Apptentive.DateTime(Util.currentTimeSeconds()); }
[ "public", "Apptentive", ".", "DateTime", "getTimeAtInstallForVersionCode", "(", "int", "versionCode", ")", "{", "for", "(", "VersionHistoryItem", "item", ":", "versionHistoryItems", ")", "{", "if", "(", "item", ".", "getVersionCode", "(", ")", "==", "versionCode",...
Returns the timestamp at the first install of the current versionCode of this app that Apptentive was aware of.
[ "Returns", "the", "timestamp", "at", "the", "first", "install", "of", "the", "current", "versionCode", "of", "this", "app", "that", "Apptentive", "was", "aware", "of", "." ]
887c08d7bd5ae6488a90366dfb58f58938861a93
https://github.com/apptentive/apptentive-android/blob/887c08d7bd5ae6488a90366dfb58f58938861a93/apptentive/src/main/java/com/apptentive/android/sdk/storage/VersionHistory.java#L76-L83
train
apptentive/apptentive-android
apptentive/src/main/java/com/apptentive/android/sdk/storage/VersionHistory.java
VersionHistory.getTimeAtInstallForVersionName
public Apptentive.DateTime getTimeAtInstallForVersionName(String versionName) { for (VersionHistoryItem item : versionHistoryItems) { Apptentive.Version entryVersionName = new Apptentive.Version(); Apptentive.Version currentVersionName = new Apptentive.Version(); entryVersionName.setVersion(item.getVersionNa...
java
public Apptentive.DateTime getTimeAtInstallForVersionName(String versionName) { for (VersionHistoryItem item : versionHistoryItems) { Apptentive.Version entryVersionName = new Apptentive.Version(); Apptentive.Version currentVersionName = new Apptentive.Version(); entryVersionName.setVersion(item.getVersionNa...
[ "public", "Apptentive", ".", "DateTime", "getTimeAtInstallForVersionName", "(", "String", "versionName", ")", "{", "for", "(", "VersionHistoryItem", "item", ":", "versionHistoryItems", ")", "{", "Apptentive", ".", "Version", "entryVersionName", "=", "new", "Apptentive...
Returns the timestamp at the first install of the current versionName of this app that Apptentive was aware of.
[ "Returns", "the", "timestamp", "at", "the", "first", "install", "of", "the", "current", "versionName", "of", "this", "app", "that", "Apptentive", "was", "aware", "of", "." ]
887c08d7bd5ae6488a90366dfb58f58938861a93
https://github.com/apptentive/apptentive-android/blob/887c08d7bd5ae6488a90366dfb58f58938861a93/apptentive/src/main/java/com/apptentive/android/sdk/storage/VersionHistory.java#L88-L99
train
apptentive/apptentive-android
apptentive/src/main/java/com/apptentive/android/sdk/storage/VersionHistory.java
VersionHistory.isUpdateForVersionCode
public boolean isUpdateForVersionCode() { Set<Integer> uniques = new HashSet<Integer>(); for (VersionHistoryItem item : versionHistoryItems) { uniques.add(item.getVersionCode()); } return uniques.size() > 1; }
java
public boolean isUpdateForVersionCode() { Set<Integer> uniques = new HashSet<Integer>(); for (VersionHistoryItem item : versionHistoryItems) { uniques.add(item.getVersionCode()); } return uniques.size() > 1; }
[ "public", "boolean", "isUpdateForVersionCode", "(", ")", "{", "Set", "<", "Integer", ">", "uniques", "=", "new", "HashSet", "<", "Integer", ">", "(", ")", ";", "for", "(", "VersionHistoryItem", "item", ":", "versionHistoryItems", ")", "{", "uniques", ".", ...
Returns true if the current versionCode is not the first version or build that we have seen. Basically, it just looks for two or more versionCodes. @return True if this is not the first versionCode of the app we've seen.
[ "Returns", "true", "if", "the", "current", "versionCode", "is", "not", "the", "first", "version", "or", "build", "that", "we", "have", "seen", ".", "Basically", "it", "just", "looks", "for", "two", "or", "more", "versionCodes", "." ]
887c08d7bd5ae6488a90366dfb58f58938861a93
https://github.com/apptentive/apptentive-android/blob/887c08d7bd5ae6488a90366dfb58f58938861a93/apptentive/src/main/java/com/apptentive/android/sdk/storage/VersionHistory.java#L107-L113
train
apptentive/apptentive-android
apptentive/src/main/java/com/apptentive/android/sdk/storage/VersionHistory.java
VersionHistory.isUpdateForVersionName
public boolean isUpdateForVersionName() { Set<String> uniques = new HashSet<String>(); for (VersionHistoryItem item : versionHistoryItems) { uniques.add(item.getVersionName()); } return uniques.size() > 1; }
java
public boolean isUpdateForVersionName() { Set<String> uniques = new HashSet<String>(); for (VersionHistoryItem item : versionHistoryItems) { uniques.add(item.getVersionName()); } return uniques.size() > 1; }
[ "public", "boolean", "isUpdateForVersionName", "(", ")", "{", "Set", "<", "String", ">", "uniques", "=", "new", "HashSet", "<", "String", ">", "(", ")", ";", "for", "(", "VersionHistoryItem", "item", ":", "versionHistoryItems", ")", "{", "uniques", ".", "a...
Returns true if the current versionName is not the first version or build that we have seen. Basically, it just looks for two or more versionNames. @return True if this is not the first versionName of the app we've seen.
[ "Returns", "true", "if", "the", "current", "versionName", "is", "not", "the", "first", "version", "or", "build", "that", "we", "have", "seen", ".", "Basically", "it", "just", "looks", "for", "two", "or", "more", "versionNames", "." ]
887c08d7bd5ae6488a90366dfb58f58938861a93
https://github.com/apptentive/apptentive-android/blob/887c08d7bd5ae6488a90366dfb58f58938861a93/apptentive/src/main/java/com/apptentive/android/sdk/storage/VersionHistory.java#L121-L127
train
apptentive/apptentive-android
apptentive/src/main/java/com/apptentive/android/sdk/module/engagement/interaction/model/InteractionManifest.java
InteractionManifest.getInteractions
public Interactions getInteractions() { try { if (!isNull(Interactions.KEY_NAME)) { Object obj = get(Interactions.KEY_NAME); if (obj instanceof JSONArray) { Interactions interactions = new Interactions(); JSONArray interactionsJSONArray = (JSONArray) obj; for (int i = 0; i < interactionsJSON...
java
public Interactions getInteractions() { try { if (!isNull(Interactions.KEY_NAME)) { Object obj = get(Interactions.KEY_NAME); if (obj instanceof JSONArray) { Interactions interactions = new Interactions(); JSONArray interactionsJSONArray = (JSONArray) obj; for (int i = 0; i < interactionsJSON...
[ "public", "Interactions", "getInteractions", "(", ")", "{", "try", "{", "if", "(", "!", "isNull", "(", "Interactions", ".", "KEY_NAME", ")", ")", "{", "Object", "obj", "=", "get", "(", "Interactions", ".", "KEY_NAME", ")", ";", "if", "(", "obj", "insta...
In addition to returning the Interactions contained in this payload, this method reformats the Interactions from a list into a map. The map is then used for further Interaction lookup. @return
[ "In", "addition", "to", "returning", "the", "Interactions", "contained", "in", "this", "payload", "this", "method", "reformats", "the", "Interactions", "from", "a", "list", "into", "a", "map", ".", "The", "map", "is", "then", "used", "for", "further", "Inter...
887c08d7bd5ae6488a90366dfb58f58938861a93
https://github.com/apptentive/apptentive-android/blob/887c08d7bd5ae6488a90366dfb58f58938861a93/apptentive/src/main/java/com/apptentive/android/sdk/module/engagement/interaction/model/InteractionManifest.java#L29-L52
train
apptentive/apptentive-android
apptentive/src/main/java/com/apptentive/android/sdk/util/threading/ConcurrentDispatchQueue.java
ConcurrentDispatchQueue.newThread
@Override public Thread newThread(Runnable r) { return new Thread(r, getName() + " (thread-" + threadNumber.getAndIncrement() + ")"); }
java
@Override public Thread newThread(Runnable r) { return new Thread(r, getName() + " (thread-" + threadNumber.getAndIncrement() + ")"); }
[ "@", "Override", "public", "Thread", "newThread", "(", "Runnable", "r", ")", "{", "return", "new", "Thread", "(", "r", ",", "getName", "(", ")", "+", "\" (thread-\"", "+", "threadNumber", ".", "getAndIncrement", "(", ")", "+", "\")\"", ")", ";", "}" ]
region Thread factory
[ "region", "Thread", "factory" ]
887c08d7bd5ae6488a90366dfb58f58938861a93
https://github.com/apptentive/apptentive-android/blob/887c08d7bd5ae6488a90366dfb58f58938861a93/apptentive/src/main/java/com/apptentive/android/sdk/util/threading/ConcurrentDispatchQueue.java#L60-L63
train
apptentive/apptentive-android
apptentive/src/main/java/com/apptentive/android/sdk/view/AutoResizeTextView.java
AutoResizeTextView.onTextChanged
@Override protected void onTextChanged(final CharSequence text, final int start, final int before, final int after) { mNeedsResize = true; // Since this view may be reused, it is good to reset the text size resetTextSize(); }
java
@Override protected void onTextChanged(final CharSequence text, final int start, final int before, final int after) { mNeedsResize = true; // Since this view may be reused, it is good to reset the text size resetTextSize(); }
[ "@", "Override", "protected", "void", "onTextChanged", "(", "final", "CharSequence", "text", ",", "final", "int", "start", ",", "final", "int", "before", ",", "final", "int", "after", ")", "{", "mNeedsResize", "=", "true", ";", "// Since this view may be reused,...
When text changes, set the force resize flag to true and reset the text size.
[ "When", "text", "changes", "set", "the", "force", "resize", "flag", "to", "true", "and", "reset", "the", "text", "size", "." ]
887c08d7bd5ae6488a90366dfb58f58938861a93
https://github.com/apptentive/apptentive-android/blob/887c08d7bd5ae6488a90366dfb58f58938861a93/apptentive/src/main/java/com/apptentive/android/sdk/view/AutoResizeTextView.java#L87-L92
train
apptentive/apptentive-android
apptentive/src/main/java/com/apptentive/android/sdk/view/AutoResizeTextView.java
AutoResizeTextView.onSizeChanged
@Override protected void onSizeChanged(int w, int h, int oldw, int oldh) { if (w != oldw || h != oldh) { mNeedsResize = true; } }
java
@Override protected void onSizeChanged(int w, int h, int oldw, int oldh) { if (w != oldw || h != oldh) { mNeedsResize = true; } }
[ "@", "Override", "protected", "void", "onSizeChanged", "(", "int", "w", ",", "int", "h", ",", "int", "oldw", ",", "int", "oldh", ")", "{", "if", "(", "w", "!=", "oldw", "||", "h", "!=", "oldh", ")", "{", "mNeedsResize", "=", "true", ";", "}", "}"...
If the text view size changed, set the force resize flag to true
[ "If", "the", "text", "view", "size", "changed", "set", "the", "force", "resize", "flag", "to", "true" ]
887c08d7bd5ae6488a90366dfb58f58938861a93
https://github.com/apptentive/apptentive-android/blob/887c08d7bd5ae6488a90366dfb58f58938861a93/apptentive/src/main/java/com/apptentive/android/sdk/view/AutoResizeTextView.java#L97-L102
train
apptentive/apptentive-android
apptentive/src/main/java/com/apptentive/android/sdk/view/AutoResizeTextView.java
AutoResizeTextView.setLineSpacing
@Override public void setLineSpacing(float add, float mult) { super.setLineSpacing(add, mult); mSpacingMult = mult; mSpacingAdd = add; }
java
@Override public void setLineSpacing(float add, float mult) { super.setLineSpacing(add, mult); mSpacingMult = mult; mSpacingAdd = add; }
[ "@", "Override", "public", "void", "setLineSpacing", "(", "float", "add", ",", "float", "mult", ")", "{", "super", ".", "setLineSpacing", "(", "add", ",", "mult", ")", ";", "mSpacingMult", "=", "mult", ";", "mSpacingAdd", "=", "add", ";", "}" ]
Override the set line spacing to update our internal reference values
[ "Override", "the", "set", "line", "spacing", "to", "update", "our", "internal", "reference", "values" ]
887c08d7bd5ae6488a90366dfb58f58938861a93
https://github.com/apptentive/apptentive-android/blob/887c08d7bd5ae6488a90366dfb58f58938861a93/apptentive/src/main/java/com/apptentive/android/sdk/view/AutoResizeTextView.java#L134-L139
train
apptentive/apptentive-android
apptentive/src/main/java/com/apptentive/android/sdk/view/AutoResizeTextView.java
AutoResizeTextView.onLayout
@Override protected void onLayout(boolean changed, int left, int top, int right, int bottom) { if (changed || mNeedsResize) { int widthLimit = (right - left) - getCompoundPaddingLeft() - getCompoundPaddingRight(); int heightLimit = (bottom - top) - getCompoundPaddingBottom() - getCompoundPaddingTop(); resiz...
java
@Override protected void onLayout(boolean changed, int left, int top, int right, int bottom) { if (changed || mNeedsResize) { int widthLimit = (right - left) - getCompoundPaddingLeft() - getCompoundPaddingRight(); int heightLimit = (bottom - top) - getCompoundPaddingBottom() - getCompoundPaddingTop(); resiz...
[ "@", "Override", "protected", "void", "onLayout", "(", "boolean", "changed", ",", "int", "left", ",", "int", "top", ",", "int", "right", ",", "int", "bottom", ")", "{", "if", "(", "changed", "||", "mNeedsResize", ")", "{", "int", "widthLimit", "=", "("...
Resize text after measuring
[ "Resize", "text", "after", "measuring" ]
887c08d7bd5ae6488a90366dfb58f58938861a93
https://github.com/apptentive/apptentive-android/blob/887c08d7bd5ae6488a90366dfb58f58938861a93/apptentive/src/main/java/com/apptentive/android/sdk/view/AutoResizeTextView.java#L212-L220
train
apptentive/apptentive-android
apptentive/src/main/java/com/apptentive/android/sdk/view/AutoResizeTextView.java
AutoResizeTextView.resizeText
public void resizeText() { int heightLimit = getHeight() - getPaddingBottom() - getPaddingTop(); int widthLimit = getWidth() - getPaddingLeft() - getPaddingRight(); resizeText(widthLimit, heightLimit); }
java
public void resizeText() { int heightLimit = getHeight() - getPaddingBottom() - getPaddingTop(); int widthLimit = getWidth() - getPaddingLeft() - getPaddingRight(); resizeText(widthLimit, heightLimit); }
[ "public", "void", "resizeText", "(", ")", "{", "int", "heightLimit", "=", "getHeight", "(", ")", "-", "getPaddingBottom", "(", ")", "-", "getPaddingTop", "(", ")", ";", "int", "widthLimit", "=", "getWidth", "(", ")", "-", "getPaddingLeft", "(", ")", "-",...
Resize the text size with default width and height
[ "Resize", "the", "text", "size", "with", "default", "width", "and", "height" ]
887c08d7bd5ae6488a90366dfb58f58938861a93
https://github.com/apptentive/apptentive-android/blob/887c08d7bd5ae6488a90366dfb58f58938861a93/apptentive/src/main/java/com/apptentive/android/sdk/view/AutoResizeTextView.java#L225-L230
train
apptentive/apptentive-android
apptentive/src/main/java/com/apptentive/android/sdk/view/AutoResizeTextView.java
AutoResizeTextView.resizeText
public void resizeText(int width, int height) { CharSequence text = getText(); // Do not resize if the view does not have dimensions or there is no text if (text == null || text.length() == 0 || height <= 0 || width <= 0 || mTextSize == 0) { return; } if (getTransformationMethod() != null) { text = get...
java
public void resizeText(int width, int height) { CharSequence text = getText(); // Do not resize if the view does not have dimensions or there is no text if (text == null || text.length() == 0 || height <= 0 || width <= 0 || mTextSize == 0) { return; } if (getTransformationMethod() != null) { text = get...
[ "public", "void", "resizeText", "(", "int", "width", ",", "int", "height", ")", "{", "CharSequence", "text", "=", "getText", "(", ")", ";", "// Do not resize if the view does not have dimensions or there is no text", "if", "(", "text", "==", "null", "||", "text", ...
Resize the text size with specified width and height @param width @param height
[ "Resize", "the", "text", "size", "with", "specified", "width", "and", "height" ]
887c08d7bd5ae6488a90366dfb58f58938861a93
https://github.com/apptentive/apptentive-android/blob/887c08d7bd5ae6488a90366dfb58f58938861a93/apptentive/src/main/java/com/apptentive/android/sdk/view/AutoResizeTextView.java#L238-L310
train
apptentive/apptentive-android
apptentive/src/main/java/com/apptentive/android/sdk/debug/LogMonitorSessionIO.java
LogMonitorSessionIO.saveCurrentSession
static void saveCurrentSession(Context context, LogMonitorSession session) { if (context == null) { throw new IllegalArgumentException("Context is null"); } if (session == null) { throw new IllegalArgumentException("Session is null"); } SharedPreferences prefs = getPrefs(context); SharedPreferences....
java
static void saveCurrentSession(Context context, LogMonitorSession session) { if (context == null) { throw new IllegalArgumentException("Context is null"); } if (session == null) { throw new IllegalArgumentException("Session is null"); } SharedPreferences prefs = getPrefs(context); SharedPreferences....
[ "static", "void", "saveCurrentSession", "(", "Context", "context", ",", "LogMonitorSession", "session", ")", "{", "if", "(", "context", "==", "null", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"Context is null\"", ")", ";", "}", "if", "(", "s...
Saves current session to the persistent storage
[ "Saves", "current", "session", "to", "the", "persistent", "storage" ]
887c08d7bd5ae6488a90366dfb58f58938861a93
https://github.com/apptentive/apptentive-android/blob/887c08d7bd5ae6488a90366dfb58f58938861a93/apptentive/src/main/java/com/apptentive/android/sdk/debug/LogMonitorSessionIO.java#L55-L68
train
apptentive/apptentive-android
apptentive/src/main/java/com/apptentive/android/sdk/debug/LogMonitorSessionIO.java
LogMonitorSessionIO.deleteCurrentSession
static void deleteCurrentSession(Context context) { SharedPreferences.Editor editor = getPrefs(context).edit(); editor.remove(PREFS_KEY_EMAIL_RECIPIENTS); editor.remove(PREFS_KEY_FILTER_PID); editor.apply(); }
java
static void deleteCurrentSession(Context context) { SharedPreferences.Editor editor = getPrefs(context).edit(); editor.remove(PREFS_KEY_EMAIL_RECIPIENTS); editor.remove(PREFS_KEY_FILTER_PID); editor.apply(); }
[ "static", "void", "deleteCurrentSession", "(", "Context", "context", ")", "{", "SharedPreferences", ".", "Editor", "editor", "=", "getPrefs", "(", "context", ")", ".", "edit", "(", ")", ";", "editor", ".", "remove", "(", "PREFS_KEY_EMAIL_RECIPIENTS", ")", ";",...
Deletes current session from the persistent storage
[ "Deletes", "current", "session", "from", "the", "persistent", "storage" ]
887c08d7bd5ae6488a90366dfb58f58938861a93
https://github.com/apptentive/apptentive-android/blob/887c08d7bd5ae6488a90366dfb58f58938861a93/apptentive/src/main/java/com/apptentive/android/sdk/debug/LogMonitorSessionIO.java#L73-L78
train
apptentive/apptentive-android
apptentive/src/main/java/com/apptentive/android/sdk/model/JsonPayload.java
JsonPayload.registerSensitiveKeys
protected static void registerSensitiveKeys(Class<? extends JsonPayload> cls) { List<Field> fields = RuntimeUtils.listFields(cls, new RuntimeUtils.FieldFilter() { @Override public boolean accept(Field field) { return Modifier.isStatic(field.getModifiers()) && // static fields field.getAnnotation(Sensi...
java
protected static void registerSensitiveKeys(Class<? extends JsonPayload> cls) { List<Field> fields = RuntimeUtils.listFields(cls, new RuntimeUtils.FieldFilter() { @Override public boolean accept(Field field) { return Modifier.isStatic(field.getModifiers()) && // static fields field.getAnnotation(Sensi...
[ "protected", "static", "void", "registerSensitiveKeys", "(", "Class", "<", "?", "extends", "JsonPayload", ">", "cls", ")", "{", "List", "<", "Field", ">", "fields", "=", "RuntimeUtils", ".", "listFields", "(", "cls", ",", "new", "RuntimeUtils", ".", "FieldFi...
region Sensitive Keys
[ "region", "Sensitive", "Keys" ]
887c08d7bd5ae6488a90366dfb58f58938861a93
https://github.com/apptentive/apptentive-android/blob/887c08d7bd5ae6488a90366dfb58f58938861a93/apptentive/src/main/java/com/apptentive/android/sdk/model/JsonPayload.java#L259-L283
train
apptentive/apptentive-android
apptentive/src/main/java/com/apptentive/android/sdk/module/messagecenter/view/ApptentiveAvatarView.java
ApptentiveAvatarView.scaleImage
private ImageScale scaleImage(int imageX, int imageY, int containerX, int containerY) { ImageScale ret = new ImageScale(); // Compare aspects faster by multiplying out the divisors. if (imageX * containerY > imageY * containerX) { // Image aspect wider than container ret.scale = (float) containerX / imageX;...
java
private ImageScale scaleImage(int imageX, int imageY, int containerX, int containerY) { ImageScale ret = new ImageScale(); // Compare aspects faster by multiplying out the divisors. if (imageX * containerY > imageY * containerX) { // Image aspect wider than container ret.scale = (float) containerX / imageX;...
[ "private", "ImageScale", "scaleImage", "(", "int", "imageX", ",", "int", "imageY", ",", "int", "containerX", ",", "int", "containerY", ")", "{", "ImageScale", "ret", "=", "new", "ImageScale", "(", ")", ";", "// Compare aspects faster by multiplying out the divisors....
This scales the image so that it fits within the container. The container may have empty space at the ends, but the entire image will be displayed.
[ "This", "scales", "the", "image", "so", "that", "it", "fits", "within", "the", "container", ".", "The", "container", "may", "have", "empty", "space", "at", "the", "ends", "but", "the", "entire", "image", "will", "be", "displayed", "." ]
887c08d7bd5ae6488a90366dfb58f58938861a93
https://github.com/apptentive/apptentive-android/blob/887c08d7bd5ae6488a90366dfb58f58938861a93/apptentive/src/main/java/com/apptentive/android/sdk/module/messagecenter/view/ApptentiveAvatarView.java#L261-L274
train
apptentive/apptentive-android
apptentive/src/main/java/com/apptentive/android/sdk/storage/EventRecord.java
EventRecord.update
public void update(double timestamp, String versionName, Integer versionCode) { last = timestamp; total++; Long countForVersionName = versionNames.get(versionName); if (countForVersionName == null) { countForVersionName = 0L; } Long countForVersionCode = versionCodes.get(versionCode); if (countForVersi...
java
public void update(double timestamp, String versionName, Integer versionCode) { last = timestamp; total++; Long countForVersionName = versionNames.get(versionName); if (countForVersionName == null) { countForVersionName = 0L; } Long countForVersionCode = versionCodes.get(versionCode); if (countForVersi...
[ "public", "void", "update", "(", "double", "timestamp", ",", "String", "versionName", ",", "Integer", "versionCode", ")", "{", "last", "=", "timestamp", ";", "total", "++", ";", "Long", "countForVersionName", "=", "versionNames", ".", "get", "(", "versionName"...
Initializes an event record or updates it with a subsequent event. @param timestamp The timestamp in seconds at which and Event occurred. @param versionName The Android versionName of the app when the event occurred. @param versionCode The Android versionCode of the app when the event occurred.
[ "Initializes", "an", "event", "record", "or", "updates", "it", "with", "a", "subsequent", "event", "." ]
887c08d7bd5ae6488a90366dfb58f58938861a93
https://github.com/apptentive/apptentive-android/blob/887c08d7bd5ae6488a90366dfb58f58938861a93/apptentive/src/main/java/com/apptentive/android/sdk/storage/EventRecord.java#L47-L60
train
apptentive/apptentive-android
apptentive/src/main/java/com/apptentive/android/sdk/serialization/ObjectSerialization.java
ObjectSerialization.serialize
public static void serialize(File file, SerializableObject object) throws IOException { AtomicFile atomicFile = new AtomicFile(file); FileOutputStream stream = null; try { stream = atomicFile.startWrite(); DataOutputStream out = new DataOutputStream(stream); object.writeExternal(out); atomicFile.finis...
java
public static void serialize(File file, SerializableObject object) throws IOException { AtomicFile atomicFile = new AtomicFile(file); FileOutputStream stream = null; try { stream = atomicFile.startWrite(); DataOutputStream out = new DataOutputStream(stream); object.writeExternal(out); atomicFile.finis...
[ "public", "static", "void", "serialize", "(", "File", "file", ",", "SerializableObject", "object", ")", "throws", "IOException", "{", "AtomicFile", "atomicFile", "=", "new", "AtomicFile", "(", "file", ")", ";", "FileOutputStream", "stream", "=", "null", ";", "...
Writes an object ot a file
[ "Writes", "an", "object", "ot", "a", "file" ]
887c08d7bd5ae6488a90366dfb58f58938861a93
https://github.com/apptentive/apptentive-android/blob/887c08d7bd5ae6488a90366dfb58f58938861a93/apptentive/src/main/java/com/apptentive/android/sdk/serialization/ObjectSerialization.java#L28-L40
train
apptentive/apptentive-android
apptentive/src/main/java/com/apptentive/android/sdk/serialization/ObjectSerialization.java
ObjectSerialization.deserialize
public static <T extends SerializableObject> T deserialize(File file, Class<T> cls) throws IOException { FileInputStream stream = null; try { stream = new FileInputStream(file); DataInputStream in = new DataInputStream(stream); try { Constructor<T> constructor = cls.getDeclaredConstructor(DataInput.cl...
java
public static <T extends SerializableObject> T deserialize(File file, Class<T> cls) throws IOException { FileInputStream stream = null; try { stream = new FileInputStream(file); DataInputStream in = new DataInputStream(stream); try { Constructor<T> constructor = cls.getDeclaredConstructor(DataInput.cl...
[ "public", "static", "<", "T", "extends", "SerializableObject", ">", "T", "deserialize", "(", "File", "file", ",", "Class", "<", "T", ">", "cls", ")", "throws", "IOException", "{", "FileInputStream", "stream", "=", "null", ";", "try", "{", "stream", "=", ...
Reads an object from a file
[ "Reads", "an", "object", "from", "a", "file" ]
887c08d7bd5ae6488a90366dfb58f58938861a93
https://github.com/apptentive/apptentive-android/blob/887c08d7bd5ae6488a90366dfb58f58938861a93/apptentive/src/main/java/com/apptentive/android/sdk/serialization/ObjectSerialization.java#L66-L82
train
apptentive/apptentive-android
apptentive/src/main/java/com/apptentive/android/sdk/conversation/Conversation.java
Conversation.storeInteractionManifest
public void storeInteractionManifest(String interactionManifest) { try { InteractionManifest payload = new InteractionManifest(interactionManifest); Interactions interactions = payload.getInteractions(); Targets targets = payload.getTargets(); if (interactions != null && targets != null) { setTargets(...
java
public void storeInteractionManifest(String interactionManifest) { try { InteractionManifest payload = new InteractionManifest(interactionManifest); Interactions interactions = payload.getInteractions(); Targets targets = payload.getTargets(); if (interactions != null && targets != null) { setTargets(...
[ "public", "void", "storeInteractionManifest", "(", "String", "interactionManifest", ")", "{", "try", "{", "InteractionManifest", "payload", "=", "new", "InteractionManifest", "(", "interactionManifest", ")", ";", "Interactions", "interactions", "=", "payload", ".", "g...
Made public for testing. There is no other reason to use this method directly.
[ "Made", "public", "for", "testing", ".", "There", "is", "no", "other", "reason", "to", "use", "this", "method", "directly", "." ]
887c08d7bd5ae6488a90366dfb58f58938861a93
https://github.com/apptentive/apptentive-android/blob/887c08d7bd5ae6488a90366dfb58f58938861a93/apptentive/src/main/java/com/apptentive/android/sdk/conversation/Conversation.java#L318-L333
train
apptentive/apptentive-android
apptentive/src/main/java/com/apptentive/android/sdk/conversation/Conversation.java
Conversation.migrateConversationData
boolean migrateConversationData() throws SerializerException { long start = System.currentTimeMillis(); File legacyConversationDataFile = Util.getUnencryptedFilename(conversationDataFile); if (legacyConversationDataFile.exists()) { try { ApptentiveLog.d(CONVERSATION, "Migrating %sconversation data...", has...
java
boolean migrateConversationData() throws SerializerException { long start = System.currentTimeMillis(); File legacyConversationDataFile = Util.getUnencryptedFilename(conversationDataFile); if (legacyConversationDataFile.exists()) { try { ApptentiveLog.d(CONVERSATION, "Migrating %sconversation data...", has...
[ "boolean", "migrateConversationData", "(", ")", "throws", "SerializerException", "{", "long", "start", "=", "System", ".", "currentTimeMillis", "(", ")", ";", "File", "legacyConversationDataFile", "=", "Util", ".", "getUnencryptedFilename", "(", "conversationDataFile", ...
Attempts to migrate from the legacy clear text format. @return <code>false</code> if failed.
[ "Attempts", "to", "migrate", "from", "the", "legacy", "clear", "text", "format", "." ]
887c08d7bd5ae6488a90366dfb58f58938861a93
https://github.com/apptentive/apptentive-android/blob/887c08d7bd5ae6488a90366dfb58f58938861a93/apptentive/src/main/java/com/apptentive/android/sdk/conversation/Conversation.java#L399-L417
train
apptentive/apptentive-android
apptentive/src/main/java/com/apptentive/android/sdk/view/ApptentiveNestedScrollView.java
ApptentiveNestedScrollView.scrollToChild
public void scrollToChild(View child) { child.getDrawingRect(mTempRect); /* Offset from child's local coordinates to ScrollView coordinates */ offsetDescendantRectToMyCoords(child, mTempRect); int scrollDelta = computeScrollDeltaToGetChildRectOnScreen(mTempRect); if (scrollDelta != 0) { scrollBy(0...
java
public void scrollToChild(View child) { child.getDrawingRect(mTempRect); /* Offset from child's local coordinates to ScrollView coordinates */ offsetDescendantRectToMyCoords(child, mTempRect); int scrollDelta = computeScrollDeltaToGetChildRectOnScreen(mTempRect); if (scrollDelta != 0) { scrollBy(0...
[ "public", "void", "scrollToChild", "(", "View", "child", ")", "{", "child", ".", "getDrawingRect", "(", "mTempRect", ")", ";", "/* Offset from child's local coordinates to ScrollView coordinates */", "offsetDescendantRectToMyCoords", "(", "child", ",", "mTempRect", ")", "...
Scrolls the view to the given child. @param child the View to scroll to
[ "Scrolls", "the", "view", "to", "the", "given", "child", "." ]
887c08d7bd5ae6488a90366dfb58f58938861a93
https://github.com/apptentive/apptentive-android/blob/887c08d7bd5ae6488a90366dfb58f58938861a93/apptentive/src/main/java/com/apptentive/android/sdk/view/ApptentiveNestedScrollView.java#L1455-L1466
train
apptentive/apptentive-android
apptentive/src/main/java/com/apptentive/android/sdk/module/engagement/interaction/view/survey/SurveyQuestionChoice.java
SurveyQuestionChoice.isValid
public boolean isValid(boolean questionIsRequired) { // If required and checked, other types must have text if (questionIsRequired && isChecked() && isOtherType && (getOtherText().length() < 1)) { otherTextInputLayout.setError(" "); return false; } otherTextInputLayout.setError(null); return true; }
java
public boolean isValid(boolean questionIsRequired) { // If required and checked, other types must have text if (questionIsRequired && isChecked() && isOtherType && (getOtherText().length() < 1)) { otherTextInputLayout.setError(" "); return false; } otherTextInputLayout.setError(null); return true; }
[ "public", "boolean", "isValid", "(", "boolean", "questionIsRequired", ")", "{", "// If required and checked, other types must have text", "if", "(", "questionIsRequired", "&&", "isChecked", "(", ")", "&&", "isOtherType", "&&", "(", "getOtherText", "(", ")", ".", "leng...
An answer can only be invalid if it's checked, the question is required, and the type is "other", but nothing was typed. All answers must be valid to submit, in addition to whatever logic the question applies.
[ "An", "answer", "can", "only", "be", "invalid", "if", "it", "s", "checked", "the", "question", "is", "required", "and", "the", "type", "is", "other", "but", "nothing", "was", "typed", ".", "All", "answers", "must", "be", "valid", "to", "submit", "in", ...
887c08d7bd5ae6488a90366dfb58f58938861a93
https://github.com/apptentive/apptentive-android/blob/887c08d7bd5ae6488a90366dfb58f58938861a93/apptentive/src/main/java/com/apptentive/android/sdk/module/engagement/interaction/view/survey/SurveyQuestionChoice.java#L103-L111
train
apptentive/apptentive-android
apptentive/src/main/java/com/apptentive/android/sdk/module/messagecenter/MessageManager.java
MessageManager.fetchAndStoreMessages
void fetchAndStoreMessages(final boolean isMessageCenterForeground, final boolean showToast, @Nullable final MessageFetchListener listener) { checkConversationQueue(); try { String lastMessageId = messageStore.getLastReceivedMessageId(); fetchMessages(lastMessageId, new MessageFetchListener() { @Override...
java
void fetchAndStoreMessages(final boolean isMessageCenterForeground, final boolean showToast, @Nullable final MessageFetchListener listener) { checkConversationQueue(); try { String lastMessageId = messageStore.getLastReceivedMessageId(); fetchMessages(lastMessageId, new MessageFetchListener() { @Override...
[ "void", "fetchAndStoreMessages", "(", "final", "boolean", "isMessageCenterForeground", ",", "final", "boolean", "showToast", ",", "@", "Nullable", "final", "MessageFetchListener", "listener", ")", "{", "checkConversationQueue", "(", ")", ";", "try", "{", "String", "...
Performs a request against the server to check for messages in the conversation since the latest message we already have. This method will either be run on MessagePollingThread or as an asyncTask when Push is received.
[ "Performs", "a", "request", "against", "the", "server", "to", "check", "for", "messages", "in", "the", "conversation", "since", "the", "latest", "message", "we", "already", "have", ".", "This", "method", "will", "either", "be", "run", "on", "MessagePollingThre...
887c08d7bd5ae6488a90366dfb58f58938861a93
https://github.com/apptentive/apptentive-android/blob/887c08d7bd5ae6488a90366dfb58f58938861a93/apptentive/src/main/java/com/apptentive/android/sdk/module/messagecenter/MessageManager.java#L153-L206
train
apptentive/apptentive-android
apptentive/src/main/java/com/apptentive/android/sdk/module/messagecenter/MessageManager.java
MessageManager.onReceiveNotification
@Override public void onReceiveNotification(ApptentiveNotification notification) { checkConversationQueue(); if (notification.hasName(NOTIFICATION_ACTIVITY_STARTED) || notification.hasName(NOTIFICATION_ACTIVITY_RESUMED)) { final Activity activity = notification.getRequiredUserInfo(NOTIFICATION_KEY_ACTIVITY,...
java
@Override public void onReceiveNotification(ApptentiveNotification notification) { checkConversationQueue(); if (notification.hasName(NOTIFICATION_ACTIVITY_STARTED) || notification.hasName(NOTIFICATION_ACTIVITY_RESUMED)) { final Activity activity = notification.getRequiredUserInfo(NOTIFICATION_KEY_ACTIVITY,...
[ "@", "Override", "public", "void", "onReceiveNotification", "(", "ApptentiveNotification", "notification", ")", "{", "checkConversationQueue", "(", ")", ";", "if", "(", "notification", ".", "hasName", "(", "NOTIFICATION_ACTIVITY_STARTED", ")", "||", "notification", "....
region Notification Observer
[ "region", "Notification", "Observer" ]
887c08d7bd5ae6488a90366dfb58f58938861a93
https://github.com/apptentive/apptentive-android/blob/887c08d7bd5ae6488a90366dfb58f58938861a93/apptentive/src/main/java/com/apptentive/android/sdk/module/messagecenter/MessageManager.java#L395-L426
train
apptentive/apptentive-android
apptentive/src/main/java/com/apptentive/android/sdk/module/engagement/logic/ClauseParser.java
ClauseParser.parseValue
public static Object parseValue(Object value) { if (value == null) { return null; } if (value instanceof Double) { return new BigDecimal((Double) value); } else if (value instanceof Long) { return new BigDecimal((Long) value); } else if (value instanceof Integer) { return new BigDecimal((Integer) ...
java
public static Object parseValue(Object value) { if (value == null) { return null; } if (value instanceof Double) { return new BigDecimal((Double) value); } else if (value instanceof Long) { return new BigDecimal((Long) value); } else if (value instanceof Integer) { return new BigDecimal((Integer) ...
[ "public", "static", "Object", "parseValue", "(", "Object", "value", ")", "{", "if", "(", "value", "==", "null", ")", "{", "return", "null", ";", "}", "if", "(", "value", "instanceof", "Double", ")", "{", "return", "new", "BigDecimal", "(", "(", "Double...
Constructs complex types values from the JSONObjects that represent them. Turns all Numbers into BigDecimal for easier comparison. All fields and parameters must be run through this method. @param value @return null if value is a JSONObject, but not a complex type.
[ "Constructs", "complex", "types", "values", "from", "the", "JSONObjects", "that", "represent", "them", ".", "Turns", "all", "Numbers", "into", "BigDecimal", "for", "easier", "comparison", ".", "All", "fields", "and", "parameters", "must", "be", "run", "through",...
887c08d7bd5ae6488a90366dfb58f58938861a93
https://github.com/apptentive/apptentive-android/blob/887c08d7bd5ae6488a90366dfb58f58938861a93/apptentive/src/main/java/com/apptentive/android/sdk/module/engagement/logic/ClauseParser.java#L66-L107
train
apptentive/apptentive-android
apptentive/src/main/java/com/apptentive/android/sdk/ApptentiveInternal.java
ApptentiveInternal.invalidateCaches
private void invalidateCaches(Conversation conversation) { checkConversationQueue(); conversation.setInteractionExpiration(0L); Configuration config = Configuration.load(); config.setConfigurationCacheExpirationMillis(System.currentTimeMillis()); config.save(); }
java
private void invalidateCaches(Conversation conversation) { checkConversationQueue(); conversation.setInteractionExpiration(0L); Configuration config = Configuration.load(); config.setConfigurationCacheExpirationMillis(System.currentTimeMillis()); config.save(); }
[ "private", "void", "invalidateCaches", "(", "Conversation", "conversation", ")", "{", "checkConversationQueue", "(", ")", ";", "conversation", ".", "setInteractionExpiration", "(", "0L", ")", ";", "Configuration", "config", "=", "Configuration", ".", "load", "(", ...
We want to make sure the app is using the latest configuration from the server if the app or sdk version changes.
[ "We", "want", "to", "make", "sure", "the", "app", "is", "using", "the", "latest", "configuration", "from", "the", "server", "if", "the", "app", "or", "sdk", "version", "changes", "." ]
887c08d7bd5ae6488a90366dfb58f58938861a93
https://github.com/apptentive/apptentive-android/blob/887c08d7bd5ae6488a90366dfb58f58938861a93/apptentive/src/main/java/com/apptentive/android/sdk/ApptentiveInternal.java#L621-L628
train
apptentive/apptentive-android
apptentive/src/main/java/com/apptentive/android/sdk/ApptentiveInternal.java
ApptentiveInternal.dismissAllInteractions
public static void dismissAllInteractions() { if (!isConversationQueue()) { dispatchOnConversationQueue(new DispatchTask() { @Override protected void execute() { dismissAllInteractions(); } }); return; } ApptentiveNotificationCenter.defaultCenter().postNotification(NOTIFICATION_INTERACT...
java
public static void dismissAllInteractions() { if (!isConversationQueue()) { dispatchOnConversationQueue(new DispatchTask() { @Override protected void execute() { dismissAllInteractions(); } }); return; } ApptentiveNotificationCenter.defaultCenter().postNotification(NOTIFICATION_INTERACT...
[ "public", "static", "void", "dismissAllInteractions", "(", ")", "{", "if", "(", "!", "isConversationQueue", "(", ")", ")", "{", "dispatchOnConversationQueue", "(", "new", "DispatchTask", "(", ")", "{", "@", "Override", "protected", "void", "execute", "(", ")",...
Dismisses any currently-visible interactions. This method is for internal use and is subject to change.
[ "Dismisses", "any", "currently", "-", "visible", "interactions", ".", "This", "method", "is", "for", "internal", "use", "and", "is", "subject", "to", "change", "." ]
887c08d7bd5ae6488a90366dfb58f58938861a93
https://github.com/apptentive/apptentive-android/blob/887c08d7bd5ae6488a90366dfb58f58938861a93/apptentive/src/main/java/com/apptentive/android/sdk/ApptentiveInternal.java#L1072-L1084
train
apptentive/apptentive-android
apptentive/src/main/java/com/apptentive/android/sdk/ApptentiveInternal.java
ApptentiveInternal.storeManifestResponse
private void storeManifestResponse(Context context, String manifest) { try { File file = new File(ApptentiveLog.getLogsDirectory(context), Constants.FILE_APPTENTIVE_ENGAGEMENT_MANIFEST); Util.writeText(file, manifest); } catch (Exception e) { ApptentiveLog.e(CONVERSATION, e, "Exception while trying to save...
java
private void storeManifestResponse(Context context, String manifest) { try { File file = new File(ApptentiveLog.getLogsDirectory(context), Constants.FILE_APPTENTIVE_ENGAGEMENT_MANIFEST); Util.writeText(file, manifest); } catch (Exception e) { ApptentiveLog.e(CONVERSATION, e, "Exception while trying to save...
[ "private", "void", "storeManifestResponse", "(", "Context", "context", ",", "String", "manifest", ")", "{", "try", "{", "File", "file", "=", "new", "File", "(", "ApptentiveLog", ".", "getLogsDirectory", "(", "context", ")", ",", "Constants", ".", "FILE_APPTENT...
region Engagement Manifest Data
[ "region", "Engagement", "Manifest", "Data" ]
887c08d7bd5ae6488a90366dfb58f58938861a93
https://github.com/apptentive/apptentive-android/blob/887c08d7bd5ae6488a90366dfb58f58938861a93/apptentive/src/main/java/com/apptentive/android/sdk/ApptentiveInternal.java#L1162-L1170
train
apptentive/apptentive-android
apptentive/src/main/java/com/apptentive/android/sdk/ApptentiveInternal.java
ApptentiveInternal.updateConversationAdvertiserIdentifier
private void updateConversationAdvertiserIdentifier(Conversation conversation) { checkConversationQueue(); try { Configuration config = Configuration.load(); if (config.isCollectingAdID()) { AdvertisingIdClientInfo info = AdvertiserManager.getAdvertisingIdClientInfo(); String advertiserId = info != n...
java
private void updateConversationAdvertiserIdentifier(Conversation conversation) { checkConversationQueue(); try { Configuration config = Configuration.load(); if (config.isCollectingAdID()) { AdvertisingIdClientInfo info = AdvertiserManager.getAdvertisingIdClientInfo(); String advertiserId = info != n...
[ "private", "void", "updateConversationAdvertiserIdentifier", "(", "Conversation", "conversation", ")", "{", "checkConversationQueue", "(", ")", ";", "try", "{", "Configuration", "config", "=", "Configuration", ".", "load", "(", ")", ";", "if", "(", "config", ".", ...
region Advertiser Identifier
[ "region", "Advertiser", "Identifier" ]
887c08d7bd5ae6488a90366dfb58f58938861a93
https://github.com/apptentive/apptentive-android/blob/887c08d7bd5ae6488a90366dfb58f58938861a93/apptentive/src/main/java/com/apptentive/android/sdk/ApptentiveInternal.java#L1176-L1190
train
apptentive/apptentive-android
apptentive/src/main/java/com/apptentive/android/sdk/migration/Migrator.java
Migrator.jsonObjectToSerializableType
private static Serializable jsonObjectToSerializableType(JSONObject input) { String type = input.optString(Apptentive.Version.KEY_TYPE, null); try { if (type != null) { if (type.equals(Apptentive.Version.TYPE)) { return new Apptentive.Version(input); } else if (type.equals(Apptentive.DateTime.TYPE))...
java
private static Serializable jsonObjectToSerializableType(JSONObject input) { String type = input.optString(Apptentive.Version.KEY_TYPE, null); try { if (type != null) { if (type.equals(Apptentive.Version.TYPE)) { return new Apptentive.Version(input); } else if (type.equals(Apptentive.DateTime.TYPE))...
[ "private", "static", "Serializable", "jsonObjectToSerializableType", "(", "JSONObject", "input", ")", "{", "String", "type", "=", "input", ".", "optString", "(", "Apptentive", ".", "Version", ".", "KEY_TYPE", ",", "null", ")", ";", "try", "{", "if", "(", "ty...
Takes a legacy Apptentive Custom Data object base on JSON, and returns the modern serializable version
[ "Takes", "a", "legacy", "Apptentive", "Custom", "Data", "object", "base", "on", "JSON", "and", "returns", "the", "modern", "serializable", "version" ]
887c08d7bd5ae6488a90366dfb58f58938861a93
https://github.com/apptentive/apptentive-android/blob/887c08d7bd5ae6488a90366dfb58f58938861a93/apptentive/src/main/java/com/apptentive/android/sdk/migration/Migrator.java#L288-L303
train
apptentive/apptentive-android
apptentive/src/main/java/com/apptentive/android/sdk/encryption/resolvers/KeyResolver18.java
KeyResolver18.wrapSymmetricKey
private static String wrapSymmetricKey(KeyPair wrapperKey, SecretKey symmetricKey) throws NoSuchPaddingException, NoSuchAlgorithmException, ...
java
private static String wrapSymmetricKey(KeyPair wrapperKey, SecretKey symmetricKey) throws NoSuchPaddingException, NoSuchAlgorithmException, ...
[ "private", "static", "String", "wrapSymmetricKey", "(", "KeyPair", "wrapperKey", ",", "SecretKey", "symmetricKey", ")", "throws", "NoSuchPaddingException", ",", "NoSuchAlgorithmException", ",", "InvalidKeyException", ",", "IllegalBlockSizeException", "{", "Cipher", "cipher"...
region Key Wrapping
[ "region", "Key", "Wrapping" ]
887c08d7bd5ae6488a90366dfb58f58938861a93
https://github.com/apptentive/apptentive-android/blob/887c08d7bd5ae6488a90366dfb58f58938861a93/apptentive/src/main/java/com/apptentive/android/sdk/encryption/resolvers/KeyResolver18.java#L203-L211
train
apptentive/apptentive-android
apptentive/src/main/java/com/apptentive/android/sdk/notifications/ApptentiveNotificationCenter.java
ApptentiveNotificationCenter.resolveObserverList
private synchronized ApptentiveNotificationObserverList resolveObserverList(String name) { ApptentiveNotificationObserverList list = observerListLookup.get(name); if (list == null) { list = new ApptentiveNotificationObserverList(); observerListLookup.put(name, list); } return list; }
java
private synchronized ApptentiveNotificationObserverList resolveObserverList(String name) { ApptentiveNotificationObserverList list = observerListLookup.get(name); if (list == null) { list = new ApptentiveNotificationObserverList(); observerListLookup.put(name, list); } return list; }
[ "private", "synchronized", "ApptentiveNotificationObserverList", "resolveObserverList", "(", "String", "name", ")", "{", "ApptentiveNotificationObserverList", "list", "=", "observerListLookup", ".", "get", "(", "name", ")", ";", "if", "(", "list", "==", "null", ")", ...
Find an observer list for the specified name or creates a new one if not found.
[ "Find", "an", "observer", "list", "for", "the", "specified", "name", "or", "creates", "a", "new", "one", "if", "not", "found", "." ]
887c08d7bd5ae6488a90366dfb58f58938861a93
https://github.com/apptentive/apptentive-android/blob/887c08d7bd5ae6488a90366dfb58f58938861a93/apptentive/src/main/java/com/apptentive/android/sdk/notifications/ApptentiveNotificationCenter.java#L125-L132
train
apptentive/apptentive-android
apptentive/src/main/java/com/apptentive/android/sdk/comm/ApptentiveClient.java
ApptentiveClient.getErrorResponse
public static String getErrorResponse(HttpURLConnection connection, boolean isZipped) throws IOException { if (connection != null) { InputStream is = null; try { is = connection.getErrorStream(); if (is != null) { if (isZipped) { is = new GZIPInputStream(is); } } return Util.read...
java
public static String getErrorResponse(HttpURLConnection connection, boolean isZipped) throws IOException { if (connection != null) { InputStream is = null; try { is = connection.getErrorStream(); if (is != null) { if (isZipped) { is = new GZIPInputStream(is); } } return Util.read...
[ "public", "static", "String", "getErrorResponse", "(", "HttpURLConnection", "connection", ",", "boolean", "isZipped", ")", "throws", "IOException", "{", "if", "(", "connection", "!=", "null", ")", "{", "InputStream", "is", "=", "null", ";", "try", "{", "is", ...
Reads error response and returns it as a string. Handles gzipped streams. @param connection Current connection @return Error response as String @throws IOException
[ "Reads", "error", "response", "and", "returns", "it", "as", "a", "string", ".", "Handles", "gzipped", "streams", "." ]
887c08d7bd5ae6488a90366dfb58f58938861a93
https://github.com/apptentive/apptentive-android/blob/887c08d7bd5ae6488a90366dfb58f58938861a93/apptentive/src/main/java/com/apptentive/android/sdk/comm/ApptentiveClient.java#L32-L48
train
apptentive/apptentive-android
apptentive/src/main/java/com/apptentive/android/sdk/encryption/Encryptor.java
Encryptor.writeToEncryptedFile
public static void writeToEncryptedFile(EncryptionKey encryptionKey, File file, byte[] data) throws IOException, NoSuchPaddingException, ...
java
public static void writeToEncryptedFile(EncryptionKey encryptionKey, File file, byte[] data) throws IOException, NoSuchPaddingException, ...
[ "public", "static", "void", "writeToEncryptedFile", "(", "EncryptionKey", "encryptionKey", ",", "File", "file", ",", "byte", "[", "]", "data", ")", "throws", "IOException", ",", "NoSuchPaddingException", ",", "InvalidAlgorithmParameterException", ",", "NoSuchAlgorithmEx...
region File IO
[ "region", "File", "IO" ]
887c08d7bd5ae6488a90366dfb58f58938861a93
https://github.com/apptentive/apptentive-android/blob/887c08d7bd5ae6488a90366dfb58f58938861a93/apptentive/src/main/java/com/apptentive/android/sdk/encryption/Encryptor.java#L146-L167
train
apptentive/apptentive-android
apptentive/src/main/java/com/apptentive/android/sdk/storage/ApptentiveTaskManager.java
ApptentiveTaskManager.onFinishSending
@Override public void onFinishSending(PayloadSender sender, PayloadData payload, boolean cancelled, String errorMessage, int responseCode, JSONObject responseData) { ApptentiveNotificationCenter.defaultCenter() .postNotification(NOTIFICATION_PAYLOAD_DID_FINISH_SEND, NOTIFICATION_KEY_PAYLOAD, payload, NOTI...
java
@Override public void onFinishSending(PayloadSender sender, PayloadData payload, boolean cancelled, String errorMessage, int responseCode, JSONObject responseData) { ApptentiveNotificationCenter.defaultCenter() .postNotification(NOTIFICATION_PAYLOAD_DID_FINISH_SEND, NOTIFICATION_KEY_PAYLOAD, payload, NOTI...
[ "@", "Override", "public", "void", "onFinishSending", "(", "PayloadSender", "sender", ",", "PayloadData", "payload", ",", "boolean", "cancelled", ",", "String", "errorMessage", ",", "int", "responseCode", ",", "JSONObject", "responseData", ")", "{", "ApptentiveNotif...
region PayloadSender.Listener
[ "region", "PayloadSender", ".", "Listener" ]
887c08d7bd5ae6488a90366dfb58f58938861a93
https://github.com/apptentive/apptentive-android/blob/887c08d7bd5ae6488a90366dfb58f58938861a93/apptentive/src/main/java/com/apptentive/android/sdk/storage/ApptentiveTaskManager.java#L194-L229
train
apptentive/apptentive-android
apptentive/src/main/java/com/apptentive/android/sdk/storage/ApptentiveTaskManager.java
ApptentiveTaskManager.sendNextPayload
private void sendNextPayload() { singleThreadExecutor.execute(new Runnable() { @Override public void run() { try { sendNextPayloadSync(); } catch (Exception e) { ApptentiveLog.e(e, "Exception while trying to send next payload"); logException(e); } } }); }
java
private void sendNextPayload() { singleThreadExecutor.execute(new Runnable() { @Override public void run() { try { sendNextPayloadSync(); } catch (Exception e) { ApptentiveLog.e(e, "Exception while trying to send next payload"); logException(e); } } }); }
[ "private", "void", "sendNextPayload", "(", ")", "{", "singleThreadExecutor", ".", "execute", "(", "new", "Runnable", "(", ")", "{", "@", "Override", "public", "void", "run", "(", ")", "{", "try", "{", "sendNextPayloadSync", "(", ")", ";", "}", "catch", "...
region Payload Sending
[ "region", "Payload", "Sending" ]
887c08d7bd5ae6488a90366dfb58f58938861a93
https://github.com/apptentive/apptentive-android/blob/887c08d7bd5ae6488a90366dfb58f58938861a93/apptentive/src/main/java/com/apptentive/android/sdk/storage/ApptentiveTaskManager.java#L255-L267
train
apptentive/apptentive-android
apptentive/src/main/java/com/apptentive/android/sdk/storage/ApptentiveDatabaseHelper.java
ApptentiveDatabaseHelper.onCreate
@Override public void onCreate(SQLiteDatabase db) { ApptentiveLog.d(DATABASE, "ApptentiveDatabase.onCreate(db)"); db.execSQL(SQL_CREATE_PAYLOAD_TABLE); // Leave legacy tables in place for now. db.execSQL(TABLE_CREATE_MESSAGE); db.execSQL(TABLE_CREATE_FILESTORE); db.execSQL(TABLE_CREATE_COMPOUND_FILESTORE)...
java
@Override public void onCreate(SQLiteDatabase db) { ApptentiveLog.d(DATABASE, "ApptentiveDatabase.onCreate(db)"); db.execSQL(SQL_CREATE_PAYLOAD_TABLE); // Leave legacy tables in place for now. db.execSQL(TABLE_CREATE_MESSAGE); db.execSQL(TABLE_CREATE_FILESTORE); db.execSQL(TABLE_CREATE_COMPOUND_FILESTORE)...
[ "@", "Override", "public", "void", "onCreate", "(", "SQLiteDatabase", "db", ")", "{", "ApptentiveLog", ".", "d", "(", "DATABASE", ",", "\"ApptentiveDatabase.onCreate(db)\"", ")", ";", "db", ".", "execSQL", "(", "SQL_CREATE_PAYLOAD_TABLE", ")", ";", "// Leave legac...
This function is called only for new installs, and onUpgrade is not called in that case. Therefore, you must include the latest complete set of DDL here.
[ "This", "function", "is", "called", "only", "for", "new", "installs", "and", "onUpgrade", "is", "not", "called", "in", "that", "case", ".", "Therefore", "you", "must", "include", "the", "latest", "complete", "set", "of", "DDL", "here", "." ]
887c08d7bd5ae6488a90366dfb58f58938861a93
https://github.com/apptentive/apptentive-android/blob/887c08d7bd5ae6488a90366dfb58f58938861a93/apptentive/src/main/java/com/apptentive/android/sdk/storage/ApptentiveDatabaseHelper.java#L225-L234
train
apptentive/apptentive-android
apptentive/src/main/java/com/apptentive/android/sdk/storage/ApptentiveDatabaseHelper.java
ApptentiveDatabaseHelper.onUpgrade
@Override public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) { ApptentiveLog.d(DATABASE, "Upgrade database from %d to %d", oldVersion, newVersion); try { DatabaseMigrator migrator = createDatabaseMigrator(oldVersion, newVersion); if (migrator != null) { migrator.onUpgrade(db, oldVer...
java
@Override public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) { ApptentiveLog.d(DATABASE, "Upgrade database from %d to %d", oldVersion, newVersion); try { DatabaseMigrator migrator = createDatabaseMigrator(oldVersion, newVersion); if (migrator != null) { migrator.onUpgrade(db, oldVer...
[ "@", "Override", "public", "void", "onUpgrade", "(", "SQLiteDatabase", "db", ",", "int", "oldVersion", ",", "int", "newVersion", ")", "{", "ApptentiveLog", ".", "d", "(", "DATABASE", ",", "\"Upgrade database from %d to %d\"", ",", "oldVersion", ",", "newVersion", ...
This method is called when an app is upgraded. Add alter table statements here for each version in a non-breaking switch, so that all the necessary upgrades occur for each older version.
[ "This", "method", "is", "called", "when", "an", "app", "is", "upgraded", ".", "Add", "alter", "table", "statements", "here", "for", "each", "version", "in", "a", "non", "-", "breaking", "switch", "so", "that", "all", "the", "necessary", "upgrades", "occur"...
887c08d7bd5ae6488a90366dfb58f58938861a93
https://github.com/apptentive/apptentive-android/blob/887c08d7bd5ae6488a90366dfb58f58938861a93/apptentive/src/main/java/com/apptentive/android/sdk/storage/ApptentiveDatabaseHelper.java#L240-L256
train
apptentive/apptentive-android
apptentive/src/main/java/com/apptentive/android/sdk/notifications/ApptentiveNotificationObserverList.java
ApptentiveNotificationObserverList.notifyObservers
void notifyObservers(ApptentiveNotification notification) { boolean hasLostReferences = false; // create a temporary list of observers to avoid concurrent modification errors List<ApptentiveNotificationObserver> temp = new ArrayList<>(observers.size()); for (int i = 0; i < observers.size(); ++i) { Apptentiv...
java
void notifyObservers(ApptentiveNotification notification) { boolean hasLostReferences = false; // create a temporary list of observers to avoid concurrent modification errors List<ApptentiveNotificationObserver> temp = new ArrayList<>(observers.size()); for (int i = 0; i < observers.size(); ++i) { Apptentiv...
[ "void", "notifyObservers", "(", "ApptentiveNotification", "notification", ")", "{", "boolean", "hasLostReferences", "=", "false", ";", "// create a temporary list of observers to avoid concurrent modification errors", "List", "<", "ApptentiveNotificationObserver", ">", "temp", "=...
Posts notification to all observers.
[ "Posts", "notification", "to", "all", "observers", "." ]
887c08d7bd5ae6488a90366dfb58f58938861a93
https://github.com/apptentive/apptentive-android/blob/887c08d7bd5ae6488a90366dfb58f58938861a93/apptentive/src/main/java/com/apptentive/android/sdk/notifications/ApptentiveNotificationObserverList.java#L36-L70
train
apptentive/apptentive-android
apptentive/src/main/java/com/apptentive/android/sdk/notifications/ApptentiveNotificationObserverList.java
ApptentiveNotificationObserverList.addObserver
boolean addObserver(ApptentiveNotificationObserver observer, boolean useWeakReference) { if (observer == null) { throw new IllegalArgumentException("Observer is null"); } if (!contains(observer)) { observers.add(useWeakReference ? new ObserverWeakReference(observer) : observer); return true; } retu...
java
boolean addObserver(ApptentiveNotificationObserver observer, boolean useWeakReference) { if (observer == null) { throw new IllegalArgumentException("Observer is null"); } if (!contains(observer)) { observers.add(useWeakReference ? new ObserverWeakReference(observer) : observer); return true; } retu...
[ "boolean", "addObserver", "(", "ApptentiveNotificationObserver", "observer", ",", "boolean", "useWeakReference", ")", "{", "if", "(", "observer", "==", "null", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"Observer is null\"", ")", ";", "}", "if", ...
Adds an observer to the list without duplicates. @param useWeakReference - use weak reference if <code>true</code> @return <code>true</code> - if observer was added
[ "Adds", "an", "observer", "to", "the", "list", "without", "duplicates", "." ]
887c08d7bd5ae6488a90366dfb58f58938861a93
https://github.com/apptentive/apptentive-android/blob/887c08d7bd5ae6488a90366dfb58f58938861a93/apptentive/src/main/java/com/apptentive/android/sdk/notifications/ApptentiveNotificationObserverList.java#L78-L89
train
apptentive/apptentive-android
apptentive/src/main/java/com/apptentive/android/sdk/notifications/ApptentiveNotificationObserverList.java
ApptentiveNotificationObserverList.removeObserver
boolean removeObserver(ApptentiveNotificationObserver observer) { int index = indexOf(observer); if (index != -1) { observers.remove(index); return true; } return false; }
java
boolean removeObserver(ApptentiveNotificationObserver observer) { int index = indexOf(observer); if (index != -1) { observers.remove(index); return true; } return false; }
[ "boolean", "removeObserver", "(", "ApptentiveNotificationObserver", "observer", ")", "{", "int", "index", "=", "indexOf", "(", "observer", ")", ";", "if", "(", "index", "!=", "-", "1", ")", "{", "observers", ".", "remove", "(", "index", ")", ";", "return",...
Removes observer os its weak reference from the list @return <code>true</code> if observer was returned
[ "Removes", "observer", "os", "its", "weak", "reference", "from", "the", "list" ]
887c08d7bd5ae6488a90366dfb58f58938861a93
https://github.com/apptentive/apptentive-android/blob/887c08d7bd5ae6488a90366dfb58f58938861a93/apptentive/src/main/java/com/apptentive/android/sdk/notifications/ApptentiveNotificationObserverList.java#L96-L103
train
apptentive/apptentive-android
apptentive/src/main/java/com/apptentive/android/sdk/notifications/ApptentiveNotificationObserverList.java
ApptentiveNotificationObserverList.indexOf
private int indexOf(ApptentiveNotificationObserver observer) { for (int i = 0; i < observers.size(); ++i) { final ApptentiveNotificationObserver other = observers.get(i); if (other == observer) { return i; } final ObserverWeakReference otherReference = ObjectUtils.as(other, ObserverWeakReference.clas...
java
private int indexOf(ApptentiveNotificationObserver observer) { for (int i = 0; i < observers.size(); ++i) { final ApptentiveNotificationObserver other = observers.get(i); if (other == observer) { return i; } final ObserverWeakReference otherReference = ObjectUtils.as(other, ObserverWeakReference.clas...
[ "private", "int", "indexOf", "(", "ApptentiveNotificationObserver", "observer", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "observers", ".", "size", "(", ")", ";", "++", "i", ")", "{", "final", "ApptentiveNotificationObserver", "other", "="...
Returns an index of the observer or its weak reference. @return -1 if not found
[ "Returns", "an", "index", "of", "the", "observer", "or", "its", "weak", "reference", "." ]
887c08d7bd5ae6488a90366dfb58f58938861a93
https://github.com/apptentive/apptentive-android/blob/887c08d7bd5ae6488a90366dfb58f58938861a93/apptentive/src/main/java/com/apptentive/android/sdk/notifications/ApptentiveNotificationObserverList.java#L117-L130
train