/** * Returns if any storage in collection of storages does contain given label. * * @param label * Label to search for. * @param labelsInStorages * Storages to check. * @return True if label exists in one of given storages. */ private boolean isLabelExistsInStorage(AbstractStorageLabel<?> label, Set<AbstractStorageLabel<?>> labelsInStorages) { for (AbstractStorageLabel<?> labelInStorage : labelsInStorages) { if (ObjectUtils.equals(label, labelInStorage)) { return true; } } return false; }
/** * {@inheritDoc} */ @Override public int compareTo(ParameterContentData other) { return ObjectUtils.compare(name, other.name); }
/** * {@inheritDoc} */ @Override public IWizardPage getPreviousPage(IWizardPage page) { if (ObjectUtils.equals(page, defineNewStorageWizzardPage) || ObjectUtils.equals(page, selectExistingStorageWizardPage)) { return newOrExistsingStorageWizardPage; } else if (ObjectUtils.equals(page, defineDataProcessorsWizardPage)) { if (newOrExistsingStorageWizardPage.useNewStorage()) { return defineNewStorageWizzardPage; } else { return selectExistingStorageWizardPage; } } else { return super.getPreviousPage(page); } }
int listSize2 = list2.size(); while ((i < listSize1) && (i < listSize2)) { int result = ObjectUtils.compare(list1.get(i), list2.get(i)); if (0 != result) { return result;
/** * {@inheritDoc} */ @Override public IWizardPage getPreviousPage(IWizardPage page) { if (ObjectUtils.equals(page, defineNewStorageWizzardPage) || ObjectUtils.equals(page, selectExistingStorageWizardPage)) { return newOrExistsingStorageWizardPage; } else if (ObjectUtils.equals(page, selectAgentsPage)) { if (newOrExistsingStorageWizardPage.useNewStorage()) { return defineNewStorageWizzardPage; } else { return selectExistingStorageWizardPage; } } else { return super.getPreviousPage(page); } }
/** * The comparison is based on the elements' timestamps. * <p> * {@inheritDoc} * */ @Override public int compareTo(InvocationTreeElement o) { return ObjectUtils.compare(getTimeStamp(), o.getTimeStamp()); }
/** * {@inheritDoc} */ @Override public IWizardPage getPreviousPage(IWizardPage page) { if (ObjectUtils.equals(page, defineNewStorageWizzardPage) || ObjectUtils.equals(page, selectStorageWizardPage)) { return newOrExistsingStorageWizardPage; } else if (ObjectUtils.equals(page, selectAgentsWizardPage)) { if (newOrExistsingStorageWizardPage.useNewStorage()) { return defineNewStorageWizzardPage; } else { return selectStorageWizardPage; } } else { return super.getPreviousPage(page); } }
/** * {@inheritDoc} */ @Override public int compare(ExceptionSensorData o1, ExceptionSensorData o2) { switch (this) { case FQN: return ObjectUtils.compare(o1.getThrowableType(), o2.getThrowableType()); case ERROR_MESSAGE: return ObjectUtils.compare(o1.getErrorMessage(), o2.getErrorMessage()); default: return 0; } }
/** * {@inheritDoc} */ @Override public void repositoryAgentDeleted(CmrRepositoryDefinition cmrRepositoryDefinition, PlatformIdent agent) { if (ObjectUtils.equals(cmrRepositoryDefinition, displayedRepositoryDefinition)) { availableAgents.remove(agent); if (ObjectUtils.equals(agent, displayedAgent)) { selectAgentForDisplay(null); } performUpdate(); } }
/** * {@inheritDoc} */ @Override public int compare(MethodIdent methodIdent1, MethodIdent methodIdent2) { switch (this) { case PACKAGE: return ObjectUtils.compare(methodIdent1.getPackageName(), methodIdent2.getPackageName()); case CLASS: return ObjectUtils.compare(methodIdent1.getClassName(), methodIdent2.getClassName()); case METHOD: int result = ObjectUtils.compare(methodIdent1.getMethodName(), methodIdent2.getMethodName()); if (0 != result) { return result; } else { List<String> parameterList1 = methodIdent1.getParameters(); List<String> parameterList2 = methodIdent2.getParameters(); return ObjectUtils.compare(parameterList1, parameterList2); } default: return 0; } }
/** * {@inheritDoc} */ @Override public void repositoryDataUpdated(CmrRepositoryDefinition cmrRepositoryDefinition) { if (ObjectUtils.equals(cmrRepositoryDefinition, displayedRepositoryDefinition)) { SafeExecutor.asyncExec(new Runnable() { @Override public void run() { mainForm.setBusy(true); updateFormTitle(); mainForm.setBusy(false); } }, mainForm); } }
/** * {@inheritDoc} */ @Override public int compare(AbstractSpan o1, AbstractSpan o2, ICachedDataService cachedDataService) { switch (this) { case PROPAGATION_TYPE: return ObjectUtils.compare(o1.getPropagationType(), o2.getPropagationType()); case DURATION: return Double.compare(o1.getDuration(), o2.getDuration()); default: return 0; } }
/** * Returns if any storage in collection of storages does contain at least one label that is of * the given label type. * * @param labelType * Label type to search for. * @param labelsInStorages * Storages to check. * @return True if at least one label of given type exists in one of given storages. */ private boolean isLabelTypeExistsInStorage(AbstractStorageLabelType<?> labelType, Set<AbstractStorageLabel<?>> labelsInStorages) { for (AbstractStorageLabel<?> label : labelsInStorages) { if (ObjectUtils.equals(label.getStorageLabelType(), labelType)) { return true; } } return false; }
return Boolean.valueOf(o1.isPreparedStatement()).compareTo(Boolean.valueOf(o2.isPreparedStatement())); case SQL: return ObjectUtils.compare(o1.getSql(), o2.getSql()); case DATABASE_NAME: return ObjectUtils.compare(o1.getDatabaseProductName(), o2.getDatabaseProductName()); case DATABASE_VERSION: return ObjectUtils.compare(o1.getDatabaseProductVersion(), o2.getDatabaseProductVersion()); case DATABASE_URL: return ObjectUtils.compare(o1.getDatabaseUrl(), o2.getDatabaseUrl()); case PARAMETERS: List<String> parameterList1 = o1.getParameterValues(); List<String> parameterList2 = o2.getParameterValues(); return ObjectUtils.compare(parameterList1, parameterList2); case SQL_AND_PARAMETERS: int result = SQL.compare(o1, o2);
/** * Returns the {@link IPropertyUpdate} for the given property logical name if such update is * existing in the configuration. * * @param propertyLogicalName * Logical name of property. * @return {@link AbstractPropertyUpdate} or <code>null</code>. */ public IPropertyUpdate<?> forLogicalName(String propertyLogicalName) { if (CollectionUtils.isNotEmpty(propertyUpdates)) { for (IPropertyUpdate<?> propertyUpdate : propertyUpdates) { if (ObjectUtils.equals(propertyLogicalName, propertyUpdate.getPropertyLogicalName())) { return propertyUpdate; } } } return null; }
/** * {@inheritDoc} */ @Override public int compare(HttpTimerData o1, HttpTimerData o2) { switch (this) { case URI: return ObjectUtils.compare(o1.getHttpInfo().getUri(), o2.getHttpInfo().getUri()); case HTTP_METHOD: return ObjectUtils.compare(o1.getHttpInfo().getRequestMethod(), o2.getHttpInfo().getRequestMethod()); case TAG_VALUE: return ObjectUtils.compare(o1.getHttpInfo().getInspectItTaggingHeaderValue(), o2.getHttpInfo().getInspectItTaggingHeaderValue()); default: return 0; } }
/** * Removes mounted storages that are bounded to the given {@link CmrRepositoryDefinition} to * "available" map. * * @param cmrRepositoryDefinition * {@link CmrRepositoryDefinition}. */ private void removeMountedStorages(CmrRepositoryDefinition cmrRepositoryDefinition) { List<LocalStorageData> removeList = new ArrayList<>(); for (Map.Entry<LocalStorageData, CmrRepositoryDefinition> entry : mountedAvailableStorages.entrySet()) { if (!entry.getKey().isFullyDownloaded()) { if (ObjectUtils.equals(entry.getValue(), cmrRepositoryDefinition)) { removeList.add(entry.getKey()); } } } if (!removeList.isEmpty()) { mountedAvailableStorages.keySet().removeAll(removeList); mountedNotAvailableStorages.addAll(removeList); } }
/** * {@inheritDoc} */ @Override public int compare(DefaultData o1, DefaultData o2) { switch (this) { case TIMESTAMP: return ObjectUtils.compare(o1.getTimeStamp(), o2.getTimeStamp()); case ID: return Longs.compare(o1.getId(), o2.getId()); default: return 0; } } }
/** * Is input in textual boxes valid. * * @return Is input in textual boxes valid. */ private boolean isInputValid() { this.setMessage(dialogMessage, IMessageProvider.INFORMATION); if (ObjectUtils.equals(oldName, nameBox.getText().trim()) && ObjectUtils.equals(oldDescription, descriptionBox.getText().trim())) { this.setMessage("Fields have not been modified!", IMessageProvider.ERROR); return false; } if (nameBox.getText().isEmpty()) { this.setMessage("No value for the name entered", IMessageProvider.ERROR); return false; } if (null != existingNames) { for (String existingName : existingNames) { if (ObjectUtils.equals(existingName, oldName)) { continue; } if (ObjectUtils.equals(existingName, nameBox.getText().trim())) { this.setMessage("This name already exists!", IMessageProvider.ERROR); return false; } } } return true; } }
String uri1 = ((HttpTimerData) o1.getTimerData()).getHttpInfo().getUrl(); String uri2 = ((HttpTimerData) o2.getTimerData()).getHttpInfo().getUrl(); return ObjectUtils.compare(uri1, uri2); } else if (InvocationSequenceDataHelper.hasHttpTimerData(o1)) { return 1; int status1 = ((HttpTimerData) o1.getTimerData()).getHttpResponseStatus(); int status2 = ((HttpTimerData) o2.getTimerData()).getHttpResponseStatus(); return ObjectUtils.compare(status1, status2); } else if (InvocationSequenceDataHelper.hasHttpTimerData(o1)) { return 1; String appName1 = null != appData1 ? appData1.getName().toLowerCase() : StringUtils.EMPTY; String appName2 = null != appData2 ? appData2.getName().toLowerCase() : StringUtils.EMPTY; return ObjectUtils.compare(appName1, appName2); case BUSINESS_TRANSACTION: BusinessTransactionData btData1 = cachedDataService.getBusinessTransactionForId(o1.getApplicationId(), o1.getBusinessTransactionId()); String btName1 = null != btData1 ? btData1.getName().toLowerCase() : StringUtils.EMPTY; String btName2 = null != btData2 ? btData2.getName().toLowerCase() : StringUtils.EMPTY; return ObjectUtils.compare(btName1, btName2); case USE_CASE: if (InvocationSequenceDataHelper.hasHttpTimerData(o1) && InvocationSequenceDataHelper.hasHttpTimerData(o2)) { String useCase1 = ((HttpTimerData) o1.getTimerData()).getHttpInfo().getInspectItTaggingHeaderValue(); String useCase2 = ((HttpTimerData) o2.getTimerData()).getHttpInfo().getInspectItTaggingHeaderValue(); return ObjectUtils.compare(useCase1, useCase2); } else if (InvocationSequenceDataHelper.hasHttpTimerData(o1)) { return 1;