method2testcases
stringlengths
118
3.08k
### Question: BaseRegisterActivity extends SecuredNativeSmartRegisterActivity implements BaseRegisterContract.View { @Override protected void setupViews() { } @Override boolean onCreateOptionsMenu(Menu menu); @Override void onBackPressed(); @Override void displaySyncNotification(); @Override void displayToast(int reso...
### Question: BaseRegisterActivity extends SecuredNativeSmartRegisterActivity implements BaseRegisterContract.View { @Override protected void onResumption() { presenter.registerViewConfigurations(getViewIdentifiers()); } @Override boolean onCreateOptionsMenu(Menu menu); @Override void onBackPressed(); @Override void d...
### Question: BaseRegisterActivity extends SecuredNativeSmartRegisterActivity implements BaseRegisterContract.View { @Override protected void onInitialization() { } @Override boolean onCreateOptionsMenu(Menu menu); @Override void onBackPressed(); @Override void displaySyncNotification(); @Override void displayToast(in...
### Question: BaseRegisterActivity extends SecuredNativeSmartRegisterActivity implements BaseRegisterContract.View { @Override public void onResume() { super.onResume(); if (bottomNavigationView != null && bottomNavigationView.getSelectedItemId() != R.id.action_clients) { setSelectedBottomBarMenuItem(R.id.action_client...
### Question: BaseRegisterActivity extends SecuredNativeSmartRegisterActivity implements BaseRegisterContract.View { @Override public void showProgressDialog(int titleIdentifier) { progressDialog = new ProgressDialog(this); progressDialog.setCancelable(false); progressDialog.setTitle(titleIdentifier); progressDialog.se...
### Question: BaseRegisterActivity extends SecuredNativeSmartRegisterActivity implements BaseRegisterContract.View { @Override public void hideProgressDialog() { if (progressDialog != null) { progressDialog.dismiss(); } } @Override boolean onCreateOptionsMenu(Menu menu); @Override void onBackPressed(); @Override void ...
### Question: BaseRegisterActivity extends SecuredNativeSmartRegisterActivity implements BaseRegisterContract.View { @Override protected void onStop() { super.onStop(); presenter.unregisterViewConfiguration(getViewIdentifiers()); } @Override boolean onCreateOptionsMenu(Menu menu); @Override void onBackPressed(); @Over...
### Question: BaseRegisterActivity extends SecuredNativeSmartRegisterActivity implements BaseRegisterContract.View { @Override public Context getContext() { return this; } @Override boolean onCreateOptionsMenu(Menu menu); @Override void onBackPressed(); @Override void displaySyncNotification(); @Override void displayT...
### Question: BaseRegisterActivity extends SecuredNativeSmartRegisterActivity implements BaseRegisterContract.View { @Override public void updateInitialsText(String initials) { this.userInitials = initials; } @Override boolean onCreateOptionsMenu(Menu menu); @Override void onBackPressed(); @Override void displaySyncNo...
### Question: BaseRegisterActivity extends SecuredNativeSmartRegisterActivity implements BaseRegisterContract.View { public void setSearchTerm(String searchTerm) { mBaseFragment.setSearchTerm(searchTerm); } @Override boolean onCreateOptionsMenu(Menu menu); @Override void onBackPressed(); @Override void displaySyncNoti...
### Question: BaseLoginActivity extends MultiLanguageActivity implements BaseLoginContract.View, TextView.OnEditorActionListener, View.OnClickListener { @Override public void enableLoginButton(boolean isClickable) { loginButton.setClickable(isClickable); } @Override boolean onCreateOptionsMenu(Menu menu); @Override bo...
### Question: BaseLoginActivity extends MultiLanguageActivity implements BaseLoginContract.View, TextView.OnEditorActionListener, View.OnClickListener { @Override public boolean onCreateOptionsMenu(Menu menu) { menu.add("Settings"); return true; } @Override boolean onCreateOptionsMenu(Menu menu); @Override boolean onO...
### Question: BaseLoginActivity extends MultiLanguageActivity implements BaseLoginContract.View, TextView.OnEditorActionListener, View.OnClickListener { @Override public boolean onOptionsItemSelected(MenuItem item) { if (item.getTitle().toString().equalsIgnoreCase("Settings")) { startActivity(new Intent(this, SettingsA...
### Question: BaseLoginActivity extends MultiLanguageActivity implements BaseLoginContract.View, TextView.OnEditorActionListener, View.OnClickListener { @Override public void onDestroy() { super.onDestroy(); mLoginPresenter.onDestroy(isChangingConfigurations()); } @Override boolean onCreateOptionsMenu(Menu menu); @Ove...
### Question: BaseLoginActivity extends MultiLanguageActivity implements BaseLoginContract.View, TextView.OnEditorActionListener, View.OnClickListener { @Override public boolean isAppVersionAllowed() { boolean isAppVersionAllowed = true; try { isAppVersionAllowed = syncUtils.isAppVersionAllowed(); } catch (PackageManag...
### Question: BaseLoginActivity extends MultiLanguageActivity implements BaseLoginContract.View, TextView.OnEditorActionListener, View.OnClickListener { public void showProgress(final boolean show) { if (!isFinishing()) { if (show) { progressDialog.show(); } else { progressDialog.dismiss(); } } } @Override boolean onC...
### Question: BaseLoginActivity extends MultiLanguageActivity implements BaseLoginContract.View, TextView.OnEditorActionListener, View.OnClickListener { @Override public void updateProgressMessage(String message) { if (!isFinishing()) { progressDialog.setTitle(message); } } @Override boolean onCreateOptionsMenu(Menu m...
### Question: SecuredActivity extends MultiLanguageActivity implements P2pProcessingStatusBroadcastReceiver.StatusUpdate { protected abstract void onCreation(); @Override boolean onOptionsItemSelected(MenuItem item); @Override boolean onCreateOptionsMenu(Menu menu); void startFormActivity(String formName, String entit...
### Question: SecuredActivity extends MultiLanguageActivity implements P2pProcessingStatusBroadcastReceiver.StatusUpdate { @Override public boolean onOptionsItemSelected(MenuItem item) { int i = item.getItemId(); if (i == R.id.switchLanguageMenuItem) { String newLanguagePreference = context().userService().switchLangua...
### Question: SecuredActivity extends MultiLanguageActivity implements P2pProcessingStatusBroadcastReceiver.StatusUpdate { public void removeProcessingInProgressSnackbar() { if (processingInProgressSnackbar != null && processingInProgressSnackbar.isShown()) { processingInProgressSnackbar.dismiss(); } } @Override boole...
### Question: BarcodeScanActivity extends Activity implements Detector.Processor<Barcode> { public void closeBarcodeActivity(SparseArray<Barcode> sparseArray) { Intent intent = new Intent(); if (sparseArray != null) { intent.putExtra(AllConstants.BARCODE.BARCODE_KEY, sparseArray.valueAt(0)); } setResult(RESULT_OK, inte...
### Question: BarcodeScanActivity extends Activity implements Detector.Processor<Barcode> { @Override public void receiveDetections(Detector.Detections<Barcode> detections) { final SparseArray<Barcode> barcodeSparseArray = detections.getDetectedItems(); if (barcodeSparseArray.size() > 0) { Vibrator vibrator = (Vibrator...
### Question: DrishtiApplication extends Application { public static OpenSRPImageLoader getCachedImageLoaderInstance() { if (cachedImageLoader == null) { cachedImageLoader = new OpenSRPImageLoader( DrishtiApplication.getInstance().getApplicationContext(), R.drawable.woman_placeholder).setFadeInImage((Build.VERSION.SDK_...
### Question: DrishtiApplication extends Application { public Repository getRepository() { ArrayList<DrishtiRepository> drishtiRepositoryList = CoreLibrary.getInstance().context().sharedRepositories(); DrishtiRepository[] drishtiRepositoryArray = drishtiRepositoryList.toArray(new DrishtiRepository[drishtiRepositoryList...
### Question: DrishtiApplication extends Application { public final byte[] getPassword() { if (password == null) { password = credentialsProvider().getCredentials(getUsername(), CredentialsHelper.CREDENTIALS_TYPE.DB_AUTH); } return password; } static synchronized X getInstance(); @Nullable P2PClassifier<JSONObject> ge...
### Question: PregnancyDetails { public boolean isLastMonthOfPregnancy() { return isLastMonthOfPregnancy; } PregnancyDetails(String monthsPregnantArg, String eddArg, int daysPastEddArg); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); boolean isLastMonthOfPregnancy(); }### An...
### Question: SmartRegisterClients extends ArrayList<SmartRegisterClient> { public SmartRegisterClients applyFilterWithFP(final ServiceModeOption serviceModeOption, SortOption sortOption, final FilterOption... filterOptions) { SmartRegisterClients results = new SmartRegisterClients(); Iterables.addAll(results, Iterable...
### Question: AbstractDao { public static SimpleDateFormat getDobDateFormat() { if (DOB_DATE_FORMAT == null) DOB_DATE_FORMAT = new SimpleDateFormat("yyyy-MM-dd", Locale.ENGLISH); return DOB_DATE_FORMAT; } static SimpleDateFormat getDobDateFormat(); static SimpleDateFormat getNativeFormsDateFormat(); static @Nullable L...
### Question: AbstractDao { public static SimpleDateFormat getNativeFormsDateFormat() { if (NATIVE_FORMS_DATE_FORMAT == null) NATIVE_FORMS_DATE_FORMAT = new SimpleDateFormat("dd-MM-yyyy", Locale.ENGLISH); return NATIVE_FORMS_DATE_FORMAT; } static SimpleDateFormat getDobDateFormat(); static SimpleDateFormat getNativeFo...
### Question: AbstractDao { protected static void setRepository(Repository repository) { AbstractDao.repository = repository; } static SimpleDateFormat getDobDateFormat(); static SimpleDateFormat getNativeFormsDateFormat(); static @Nullable List<Map<String, Object>> readData(String query, String[] selectionArgs); }##...
### Question: AbstractDao { protected static void updateDB(String sql) { try { SQLiteDatabase db = getRepository().getWritableDatabase(); db.rawExecSQL(sql); } catch (Exception e) { Timber.e(e); } } static SimpleDateFormat getDobDateFormat(); static SimpleDateFormat getNativeFormsDateFormat(); static @Nullable List<Ma...
### Question: SmartRegisterPaginatedAdapter extends BaseAdapter { public int pageCount() { return pageCount; } SmartRegisterPaginatedAdapter(SmartRegisterClientsProvider listItemProvider); SmartRegisterPaginatedAdapter(int clientsPerPage, SmartRegisterClientsProvider listItemProvider); void refreshClients(...
### Question: SmartRegisterPaginatedAdapter extends BaseAdapter { @Override public Object getItem(int i) { return filteredClients.get(i); } SmartRegisterPaginatedAdapter(SmartRegisterClientsProvider listItemProvider); SmartRegisterPaginatedAdapter(int clientsPerPage, SmartRegisterClientsProvider listItemPr...
### Question: SmartRegisterPaginatedAdapter extends BaseAdapter { @Override public View getView(int i, View parentView, ViewGroup viewGroup) { return listItemProvider .getView((SmartRegisterClient) getItem(actualPosition(i)), parentView, viewGroup); } SmartRegisterPaginatedAdapter(SmartRegisterClientsProvider listItemP...
### Question: ServiceLocationsAdapter extends BaseAdapter { @Override public int getCount() { return locationNames.size(); } ServiceLocationsAdapter(Context context, List<String> locationNames); @Override int getCount(); @Override Object getItem(int position); @Override long getItemId(int position); @Override View getV...
### Question: ServiceLocationsAdapter extends BaseAdapter { @Override public long getItemId(int position) { return position + 2321; } ServiceLocationsAdapter(Context context, List<String> locationNames); @Override int getCount(); @Override Object getItem(int position); @Override long getItemId(int position); @Override ...
### Question: ServiceLocationsAdapter extends BaseAdapter { public String getLocationAt(int position) { return locationNames.get(position); } ServiceLocationsAdapter(Context context, List<String> locationNames); @Override int getCount(); @Override Object getItem(int position); @Override long getItemId(int position); @O...
### Question: ServiceLocationsAdapter extends BaseAdapter { public List<String> getLocationNames() { return locationNames; } ServiceLocationsAdapter(Context context, List<String> locationNames); @Override int getCount(); @Override Object getItem(int position); @Override long getItemId(int position); @Override View getV...
### Question: IntegerUtil { public static int compare(int lhs, int rhs) { return lhs < rhs ? -1 : (lhs == rhs ? 0 : 1); } static Integer tryParse(String value, int defaultValue); static String tryParse(String value, String defaultValue); static int compare(int lhs, int rhs); }### Answer: @Test public void assertInteg...
### Question: SyncTaskServiceJob extends BaseJob { @NonNull @Override protected Result onRunJob(@NonNull Params params) { Intent intent = new Intent(getApplicationContext(), serviceClass); getApplicationContext().startService(intent); return params != null && params.getExtras().getBoolean(AllConstants.INTENT_KEY.TO_RES...
### Question: ValidateSyncDataServiceJob extends BaseJob { @NonNull @Override protected Result onRunJob(@NonNull Params params) { Intent intent = new Intent(getApplicationContext(), ValidateIntentService.class); getApplicationContext().startService(intent); return params != null && params.getExtras().getBoolean(AllCons...
### Question: CampaignServiceJob extends BaseJob { @NonNull @Override protected Result onRunJob(@NonNull Params params) { Intent intent = new Intent(getApplicationContext(), CampaignIntentService.class); getApplicationContext().startService(intent); return params != null && params.getExtras().getBoolean(AllConstants.IN...
### Question: PullUniqueIdsServiceJob extends BaseJob { @NonNull @Override protected Result onRunJob(@NonNull Params params) { Intent intent = new Intent(getApplicationContext(), PullUniqueIdsIntentService.class); getApplicationContext().startService(intent); return params != null && params.getExtras().getBoolean(AllCo...
### Question: ExtendedSyncServiceJob extends BaseJob { @NonNull @Override protected Result onRunJob(@NonNull Params params) { Intent intent = new Intent(getApplicationContext(), ExtendedSyncIntentService.class); getApplicationContext().startService(intent); return params != null && params.getExtras().getBoolean(AllCons...
### Question: SyncLocationsByLevelAndTagsServiceJob extends BaseJob { @NonNull @Override protected Result onRunJob(@NonNull Params params) { Intent intent = new Intent(getApplicationContext(), SyncLocationsByLevelAndTagsIntentService.class); getApplicationContext().startService(intent); return params != null && params....
### Question: DocumentConfigurationServiceJob extends BaseJob { @NonNull @Override protected Result onRunJob(@NonNull Params params) { Intent intent = new Intent(getApplicationContext(), serviceClass); getApplicationContext().startService(intent); return params != null && params.getExtras().getBoolean(AllConstants.INTE...
### Question: SyncServiceJob extends BaseJob { @NonNull @Override protected Result onRunJob(@NonNull Params params) { Intent intent = new Intent(getApplicationContext(), serviceClass); getApplicationContext().startService(intent); return params != null && params.getExtras().getBoolean(AllConstants.INTENT_KEY.TO_RESCHED...
### Question: SyncLocationsByTeamIdsJob extends BaseJob { @NonNull @Override protected Result onRunJob(@NonNull Params params) { Intent intent = new Intent(getApplicationContext(), SyncLocationsByTeamIdsIntentService.class); getApplicationContext().startService(intent); return params != null && params.getExtras().getBo...
### Question: SyncAllLocationsServiceJob extends BaseJob { @NonNull @Override protected Result onRunJob(@NonNull Params params) { Intent intent = new Intent(getApplicationContext(), SyncAllLocationsIntentService.class); getApplicationContext().startService(intent); return params != null && params.getExtras().getBoolean...
### Question: Campaign { public String getTitle() { return title; } String getIdentifier(); void setIdentifier(String identifier); String getTitle(); void setTitle(String title); String getDescription(); void setDescription(String description); TaskStatus getStatus(); void setStatus(TaskStatus status); ExecutionPeriod...
### Question: DateUtil { public static boolean checkIfDateThreeMonthsOlder(Date date) { Calendar cal = Calendar.getInstance(); cal.setTime(cal.getTime()); cal.add(Calendar.DATE, -90); Date dateBefore90Days = cal.getTime(); return date.before(dateBefore90Days); } static void fakeIt(LocalDate fakeDayAsToday); static voi...
### Question: DateUtil { public static boolean isValidDate(String dateString) { if (dateString == null || dateString.length() != "yyyy-MM-dd".length()) { return false; } return dateString.matches("\\d{4}-\\d{2}-\\d{2}"); } static void fakeIt(LocalDate fakeDayAsToday); static void setDefaultDateFormat(String defaultDat...
### Question: ClientProcessor { public static ClientProcessor getInstance(Context context) { if (instance == null) { instance = new ClientProcessor(context); } return instance; } ClientProcessor(Context context); static ClientProcessor getInstance(Context context); synchronized void processClient(); synchronized void p...
### Question: P2pProcessRecordsService extends BaseSyncIntentService { @Override public void onDestroy() { if (CoreLibrary.getInstance().isPeerToPeerProcessing()) { CoreLibrary.getInstance().setPeerToPeerProcessing(false); } super.onDestroy(); } P2pProcessRecordsService(String name); P2pProcessRecordsService(); @Overr...
### Question: SyncIntentService extends BaseSyncIntentService { protected void init(@NonNull Context context) { this.context = context; httpAgent = CoreLibrary.getInstance().context().getHttpAgent(); syncUtils = new SyncUtils(getBaseContext()); validateAssignmentHelper = new ValidateAssignmentHelper(syncUtils); } SyncI...
### Question: SyncIntentService extends BaseSyncIntentService { protected void handleSync() { sendSyncStatusBroadcastMessage(FetchStatus.fetchStarted); doSync(); } SyncIntentService(); SyncIntentService(String name); @Override int onStartCommand(Intent intent, int flags, int startId); void fetchFailed(int count); int ...
### Question: DateUtil { public static int weekDifference(LocalDate startDate, LocalDate endDate) { try { return Math.abs(Weeks.weeksBetween(startDate, endDate).getWeeks()); } catch (Exception e) { return 0; } } static void fakeIt(LocalDate fakeDayAsToday); static void setDefaultDateFormat(String defaultDateFormat); s...
### Question: SyncIntentService extends BaseSyncIntentService { public void fetchFailed(int count) { if (count < CoreLibrary.getInstance().getSyncConfiguration().getSyncMaxRetries()) { int newCount = count + 1; fetchRetry(newCount, false); } else { complete(FetchStatus.fetchedFailed); } } SyncIntentService(); SyncInte...
### Question: DocumentConfigurationIntentService extends BaseSyncIntentService { @Override public int onStartCommand(Intent intent, int flags, int startId) { httpAgent = CoreLibrary.getInstance().context().getHttpAgent(); manifestRepository = CoreLibrary.getInstance().context().getManifestRepository(); clientFormReposi...
### Question: DateUtil { public static String formatDate(String unformattedDate) { return formatDate(unformattedDate, DEFAULT_DATE_FORMAT); } static void fakeIt(LocalDate fakeDayAsToday); static void setDefaultDateFormat(String defaultDateFormat); static LocalDate today(); static String formatDateForTimelineEvent(Stri...
### Question: SettingsSyncIntentService extends BaseSyncIntentService { protected boolean processSettings(Intent intent) { Timber.d("In Settings Sync Intent Service..."); boolean isSuccessfulSync = true; if (intent != null) { try { super.onHandleIntent(intent); int count = syncSettingsServiceHelper.processIntent(); if ...
### Question: SettingsSyncIntentService extends BaseSyncIntentService { @Override public void onCreate() { super.onCreate(); Context context = CoreLibrary.getInstance().context(); syncSettingsServiceHelper = new SyncSettingsServiceHelper(context.configuration().dristhiBaseURL(), context.getHttpAgent()); } SettingsSyncI...
### Question: TaskServiceHelper extends BaseHelper { public List<Task> syncTasks() { syncCreatedTaskToServer(); syncTaskStatusToServer(); return fetchTasksFromServer(); } @VisibleForTesting TaskServiceHelper(TaskRepository taskRepository); void setSyncByGroupIdentifier(boolean syncByGroupIdentifier); boolean isSyncByG...
### Question: PlanIntentServiceHelper extends BaseHelper { public void syncPlans() { syncProgress = new SyncProgress(); syncProgress.setSyncEntity(SyncEntity.PLANS); syncProgress.setTotalRecords(totalRecords); int batchFetchCount = batchFetchPlansFromServer(true); syncProgress.setPercentageSynced(Utils.calculatePercent...
### Question: DateUtil { public static LocalDate getLocalDate(String date) { try { SimpleDateFormat format = new SimpleDateFormat(DEFAULT_DATE_FORMAT, Utils.getDefaultLocale()); Date formattedDate = format.parse(date); return new LocalDate(formattedDate); } catch (Exception e) { return null; } } static void fakeIt(Loc...
### Question: ECSyncHelper { public boolean saveAllClientsAndEvents(JSONObject jsonObject) { try { if (jsonObject == null) { return false; } JSONArray events = jsonObject.has("events") ? jsonObject.getJSONArray("events") : new JSONArray(); JSONArray clients = jsonObject.has("clients") ? jsonObject.getJSONArray("clients...
### Question: FileUtilities { public void write(String fileName, String data) { File root = Environment.getExternalStorageDirectory(); File outDir = new File(root.getAbsolutePath() + File.separator + "EZ_time_tracker"); if (!outDir.isDirectory()) { outDir.mkdir(); } try { if (!outDir.isDirectory()) { throw new IOExcept...
### Question: LocationServiceHelper extends BaseHelper { public List<Location> fetchLocationsStructures() { syncLocationsStructures(true); List<Location> locations = syncLocationsStructures(false); syncCreatedStructureToServer(); syncUpdatedLocationsToServer(); return locations; } LocationServiceHelper(LocationReposito...
### Question: FileUtilities { public static String getFileExtension(String fileName) { String extension = ""; if (fileName != null && !fileName.isEmpty()) { int i = fileName.lastIndexOf('.'); if (i > 0) { extension = fileName.substring(i + 1); } } return extension; } FileUtilities(); static Bitmap retrieveStaticImageFr...
### Question: GZIPCompression implements ICompression { @Override public byte[] compress(String rawString) { try { ByteArrayOutputStream os = new ByteArrayOutputStream(); GZIPOutputStream gos = new GZIPOutputStream(os); gos.write(rawString.getBytes(CharEncoding.UTF_8)); gos.close(); byte[] compressed = os.toByteArray()...
### Question: DisplayUtils { public static int getDisplayWidth(Activity activity) { DisplayMetrics displayMetrics = new DisplayMetrics(); activity.getWindowManager().getDefaultDisplay().getMetrics(displayMetrics); return displayMetrics.widthPixels; } static ScreenDpi getScreenDpi(Context context); static int getDispla...
### Question: DisplayUtils { public static int getDisplayHeight(Activity activity) { DisplayMetrics displayMetrics = new DisplayMetrics(); activity.getWindowManager().getDefaultDisplay().getMetrics(displayMetrics); return displayMetrics.heightPixels; } static ScreenDpi getScreenDpi(Context context); static int getDisp...
### Question: DisplayUtils { public static double getScreenSize(Activity activity) { DisplayMetrics dm = new DisplayMetrics(); activity.getWindowManager().getDefaultDisplay().getMetrics(dm); int width = dm.widthPixels; int height = dm.heightPixels; double wi = (double) width / (double) dm.xdpi; double hi = (double) hei...
### Question: CredentialsHelper { public static boolean shouldMigrate() { return CoreLibrary.getInstance().context().allSharedPreferences().getDBEncryptionVersion() == 0 || (CoreLibrary.getInstance().context().allSharedPreferences().getDBEncryptionVersion() > 0 && BuildConfig.DB_ENCRYPTION_VERSION > CoreLibrary.getInst...
### Question: ClientFormResponse { public ClientFormDTO getClientForm() { return clientForm; } ClientFormResponse(ClientFormDTO clientForm, ClientFormMetadataDTO clientFormMetadata); ClientFormDTO getClientForm(); void setClientForm(ClientFormDTO clientForm); ClientFormMetadataDTO getClientFormMetadata(); void setClien...
### Question: AllCommonsRepository { public long count() { return personRepository.count(); } AllCommonsRepository(CommonRepository personRepository, AlertRepository alertRepository, TimelineEventRepository timelineEventRepository); List<CommonPersonObject> all(); CommonPersonObject findByCaseID(String case...
### Question: CredentialsHelper { public byte[] getCredentials(String username, String type) { if (CREDENTIALS_TYPE.DB_AUTH.equals(type)) { return context.userService().getDecryptedPassphraseValue(username); } else if (CREDENTIALS_TYPE.LOCAL_AUTH.equals(type)) { return context.userService().getDecryptedAccountValue(use...
### Question: AllCommonsRepository { public List<CommonPersonObject> all() { return personRepository.allcommon(); } AllCommonsRepository(CommonRepository personRepository, AlertRepository alertRepository, TimelineEventRepository timelineEventRepository); List<CommonPersonObject> all(); CommonPersonObject fi...
### Question: AllCommonsRepository { public CommonPersonObject findByCaseID(String caseId) { return personRepository.findByCaseID(caseId); } AllCommonsRepository(CommonRepository personRepository, AlertRepository alertRepository, TimelineEventRepository timelineEventRepository); List<CommonPersonObject> all...
### Question: AllCommonsRepository { public CommonPersonObject findHHByGOBHHID(String gobhhid) { return personRepository.findHHByGOBHHID(gobhhid); } AllCommonsRepository(CommonRepository personRepository, AlertRepository alertRepository, TimelineEventRepository timelineEventRepository); List<CommonPersonObj...
### Question: AllCommonsRepository { public List<CommonPersonObject> findByCaseIDs(List<String> caseIds) { return personRepository.findByCaseIDs(caseIds.toArray(new String[caseIds.size()])); } AllCommonsRepository(CommonRepository personRepository, AlertRepository alertRepository, TimelineEventRepository ti...
### Question: AllCommonsRepository { public List<CommonPersonObject> findByRelationalIDs(List<String> RelationalID) { return personRepository .findByRelationalIDs(RelationalID.toArray(new String[RelationalID.size()])); } AllCommonsRepository(CommonRepository personRepository, AlertRepository alertRepository...
### Question: AllCommonsRepository { public List<CommonPersonObject> findByRelational_IDs(List<String> RelationalID) { return personRepository .findByRelational_IDs(RelationalID.toArray(new String[RelationalID.size()])); } AllCommonsRepository(CommonRepository personRepository, AlertRepository alertReposito...
### Question: AllCommonsRepository { public void close(String entityId) { alertRepository.deleteAllAlertsForEntity(entityId); timelineEventRepository.deleteAllTimelineEventsForEntity(entityId); personRepository.close(entityId); } AllCommonsRepository(CommonRepository personRepository, AlertRepository alertR...
### Question: AllCommonsRepository { public void mergeDetails(String entityId, Map<String, String> details) { personRepository.mergeDetails(entityId, details); } AllCommonsRepository(CommonRepository personRepository, AlertRepository alertRepository, TimelineEventRepository timelineEventRepository); List<Co...
### Question: AllCommonsRepository { public void update(String tableName, ContentValues contentValues, String caseId) { personRepository.updateColumn(tableName, contentValues, caseId); } AllCommonsRepository(CommonRepository personRepository, AlertRepository alertRepository, TimelineEventRepository timeline...
### Question: AllCommonsRepository { public List<CommonPersonObject> customQuery(String sql, String[] selections, String tableName) { return personRepository.customQuery(sql, selections, tableName); } AllCommonsRepository(CommonRepository personRepository, AlertRepository alertRepository, TimelineEventRepos...
### Question: AllCommonsRepository { public List<CommonPersonObject> customQueryForCompleteRow(String sql, String[] selections, String tableName) { return personRepository.customQueryForCompleteRow(sql, selections, tableName); } AllCommonsRepository(CommonRepository personRepository, AlertRepository alertRe...
### Question: AllCommonsRepository { public boolean deleteSearchRecord(String caseId) { if (StringUtils.isBlank(caseId)) { return false; } return personRepository.deleteSearchRecord(caseId); } AllCommonsRepository(CommonRepository personRepository, AlertRepository alertRepository, TimelineEventRepository ti...
### Question: CommonFtsObject { public static String searchTableName(String table) { return table + "_search"; } CommonFtsObject(String[] tables); static String searchTableName(String table); void updateSearchFields(String table, String[] searchFields); void updateSortFields(String table, String[] sortFields); void upd...
### Question: CommonFtsObject { public boolean containsTable(String table) { if (tables == null || StringUtils.isBlank(table)) { return false; } List<String> tableList = Arrays.asList(tables); return tableList.contains(table); } CommonFtsObject(String[] tables); static String searchTableName(String table); void updateS...
### Question: CommonFtsObject { public String[] getTables() { if (tables == null) { tables = ArrayUtils.EMPTY_STRING_ARRAY; } return tables; } CommonFtsObject(String[] tables); static String searchTableName(String table); void updateSearchFields(String table, String[] searchFields); void updateSortFields(String table, ...
### Question: CommonObjectFilterOption implements FilterOption { @Override public boolean filter(SmartRegisterClient client) { switch (byColumnAndByDetails) { case byColumn: return ((CommonPersonObjectClient) client).getColumnmaps().get(fieldname). contains(criteria); case byDetails: return (((CommonPersonObjectClient)...
### Question: CredentialsHelper { public PasswordHash generateLocalAuthCredentials(char[] password) throws InvalidKeySpecException, NoSuchAlgorithmException { if (password == null) return null; return SecurityHelper.getPasswordHash(password); } CredentialsHelper(Context context); static boolean shouldMigrate(); byte[] ...
### Question: CommonObjectFilterOption implements FilterOption { @Override public String name() { return filterOptionName; } CommonObjectFilterOption(String criteriaArg, String fieldnameArg, ByColumnAndByDetails byColumnAndByDetailsArg, String filteroptionnameArg); @Override String name(); @Override boolean...
### Question: AccountHelper { public static Account getOauthAccountByNameAndType(String accountName, String accountType) { Account[] accounts = accountManager.getAccountsByType(accountType); return accounts.length > 0 ? selectAccount(accounts, accountName) : null; } static Account getOauthAccountByNameAndType(String a...
### Question: AccountHelper { public static String getAccountManagerValue(String key, String accountName, String accountType) { Account account = AccountHelper.getOauthAccountByNameAndType(accountName, accountType); if (account != null) { return accountManager.getUserData(account, key); } return null; } static Account...
### Question: AccountHelper { public static String getOAuthToken(String accountName, String accountType, String authTokenType) { Account account = getOauthAccountByNameAndType(accountName, accountType); try { return accountManager.blockingGetAuthToken(account, authTokenType, true); } catch (Exception ex) { Timber.e(ex,...
### Question: AccountHelper { public static void invalidateAuthToken(String accountType, String authToken) { if (authToken != null) accountManager.invalidateAuthToken(accountType, authToken); } static Account getOauthAccountByNameAndType(String accountName, String accountType); static Account selectAccount(Account[] a...
### Question: AccountHelper { public static String getCachedOAuthToken(String accountName, String accountType, String authTokenType) { Account account = getOauthAccountByNameAndType(accountName, accountType); return account != null ? accountManager.peekAuthToken(account, authTokenType) : null; } static Account getOaut...