/** * @return <code>true</code> if the given theme is equal to 'default'. Note that this is <b>not</b> the same as * checking for equality to {@link #getConfiguredTheme()}! */ public boolean isDefaultTheme(String theme) { return ObjectUtility.equals(theme, UiThemeProperty.DEFAULT_THEME); } }
protected boolean isIdenticalEvent(T event1, T event2) { return ObjectUtility.equals(event1, event2); }
@Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } HttpCacheKey other = (HttpCacheKey) obj; return ObjectUtility.equals(m_resourcePath, other.m_resourcePath) && ObjectUtility.equals(m_attributes, other.m_attributes); }
public boolean containsNode(ITreeNode nodeToFind) { if (CollectionUtility.isEmpty(m_nodes)) { return false; } for (ITreeNode node : m_nodes) { if (ObjectUtility.equals(node, nodeToFind)) { return true; } } return false; }
@Override public String filter(String name, String value) { return StringUtility.equalsIgnoreCase(m_name, name) && ObjectUtility.equals(m_value, value) ? m_replacement : value; }
/** * Returns true if the given value matches the given lookup-row. The default impl. checks if the key of the lookup-row * matches. Override this method to implement another behavior. */ protected boolean lookupRowMatchesValue(ILookupRow<VALUE> lookupRow, VALUE value) { return ObjectUtility.equals(getValueFromLookupRow(lookupRow), value); }
protected boolean isCurrentSession(String userId) { IClientSession currentSession = (IClientSession) IClientSession.CURRENT.get(); return currentSession != null && ObjectUtility.equals(currentSession.getUserId(), userId); }
protected IGroup getGroupById(Object groupId) { return getGroups().stream() .filter(group -> ObjectUtility.equals(groupId, group.getGroupId())) .findFirst() .orElse(null); }
/** * Note: when converting the response to JSON, events on adapters that are also part of this response are ignored, see * also {@link #doAddEvent(JsonEvent)} */ public JsonEvent replaceActionEvent(String eventTarget, String eventType, JSONObject eventData) { assertWritable(); // Same target and same type --> remove existing event m_eventList.removeIf(event -> ObjectUtility.equals(event.getTarget(), eventTarget) && ObjectUtility.equals(event.getType(), eventType)); return addActionEvent(eventTarget, eventType, eventData); }
@Override public List<ITableRow> findRows(VALUE value) { List<ITableRow> foundRows = new ArrayList<>(); for (int i = 0; i < m_table.getRowCount(); i++) { ITableRow row = m_table.getRow(i); if (ObjectUtility.equals(value, getValue(row))) { foundRows.add(row); } } return foundRows; }
/** * @return the enum value with the given <code>identifier</code>, or <code>null</code> if the identifier is unknown. */ public static IResolveMethod parse(String identifier) { for (ResolveMethod value : values()) { if (ObjectUtility.equals(identifier, value.getIdentifier())) { return value; } } return null; } }
/** * Removes a class (all occurrences) from a given class string. */ public String removeCssClass(String cssClasses, String cssClass) { String[] classes = StringUtility.split(cssClasses, " "); for (int i = 0; i < classes.length; i++) { if (ObjectUtility.equals(classes[i], cssClass)) { classes[i] = null; } } return StringUtility.join(" ", classes); }
@Override public IRadioButton<T> getButtonFor(T value) { for (IRadioButton<T> b : getButtons()) { T radioValue = b.getRadioValue(); if (ObjectUtility.equals(radioValue, value)) { return b; } } return null; }
@Override public void setOverviewIconId(String overviewIconId) { if (ObjectUtility.equals(getOverviewIconId(), overviewIconId)) { return; // no change } m_overviewIconId = overviewIconId; firePageChanged(); }
@Override public ITableRow findRow(VALUE value) { for (int i = 0, ni = m_table.getRowCount(); i < ni; i++) { ITableRow row = m_table.getRow(i); if (ObjectUtility.equals(value, getValue(row))) { return row; } } return null; }
@Override public boolean contains(VALUE value) { for (int i = 0, ni = m_table.getRowCount(); i < ni; i++) { ITableRow row = m_table.getRow(i); if (ObjectUtility.equals(value, getValue(row))) { return true; } } return false; }
@Override public boolean test(final IFuture<?> future) { JobInput jobInput = future.getJobInput(); return jobInput != null && ObjectUtility.equals(future.getJobInput().getName(), ITileGrid.PROP_ASYNC_LOAD_JOBNAME_PREFIX) && !jobInput.getExecutionHints().contains(ITileGrid.PROP_ASYNC_LOAD_IDENTIFIER_PREFIX + m_asyncLoadIdentifierName) && jobInput.getExecutionHints().contains(ITileGrid.PROP_WINDOW_IDENTIFIER_PREFIX + m_windowIdentifier); } }
protected boolean checkIfEventOnParent(IForm form, DesktopEvent event) { if (ObjectUtility.equals(event.getForm(), form)) { return true; } else if (form.getDisplayParent() instanceof IForm) { return checkIfEventOnParent((IForm) form.getDisplayParent(), event); } return false; } }
private void throwNumberTooLarge() { if (getMinValue() == null || ObjectUtility.equals(getMinValue(), getMinPossibleValue())) { throw new VetoException(TEXTS.get("NumberTooLargeMessageX", formatValueInternal(getMaxValue()))); } else { throw new VetoException(TEXTS.get("NumberTooLargeMessageXY", formatValueInternal(getMinValue()), formatValueInternal(getMaxValue()))); } }
private void throwNumberTooSmall() { if (getMaxValue() == null || ObjectUtility.equals(getMaxValue(), getMaxPossibleValue())) { throw new VetoException(TEXTS.get("NumberTooSmallMessageX", formatValueInternal(getMinValue()))); } else { throw new VetoException(TEXTS.get("NumberTooSmallMessageXY", formatValueInternal(getMinValue()), formatValueInternal(getMaxValue()))); } }