AutoRefactored boolean conditions
| | |
| | | TableBuilder nbuilder = new TableBuilder(); |
| | | Map<String, MenuCallback<T>> callbacks = new HashMap<String, MenuCallback<T>>(); |
| | | |
| | | // Determine whether multiple columns should be used for numeric |
| | | // options. |
| | | boolean useMultipleColumns = false; |
| | | if (threshold >= 0 && numericCallbacks.size() >= threshold) { |
| | | useMultipleColumns = true; |
| | | } |
| | | // Determine whether multiple columns should be used for numeric options |
| | | boolean useMultipleColumns = threshold >= 0 && numericCallbacks.size() >= threshold; |
| | | |
| | | // Create optional column headers. |
| | | if (!columnHeadings.isEmpty()) { |
| | |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isModified() { |
| | | if (activeValues.size() == pendingValues.size() && activeValues.containsAll(pendingValues)) { |
| | | return false; |
| | | } |
| | | return true; |
| | | return activeValues.size() != pendingValues.size() |
| | | || !activeValues.containsAll(pendingValues); |
| | | } |
| | | |
| | | /** |
| | |
| | | // Create an option for editing/viewing each property. |
| | | for (PropertyDefinition<?> pd : c) { |
| | | // Determine whether this property should be modifiable. |
| | | boolean isReadOnly = false; |
| | | |
| | | if (pd.hasOption(PropertyOption.MONITORING)) { |
| | | isReadOnly = true; |
| | | } |
| | | |
| | | boolean isReadOnly = pd.hasOption(PropertyOption.MONITORING); |
| | | if (!isCreate && pd.hasOption(PropertyOption.READ_ONLY)) { |
| | | isReadOnly = true; |
| | | } |
| | |
| | | * @return Returns <code>true</code> if the user requested record-mode. |
| | | */ |
| | | protected final boolean isRecordMode() { |
| | | if (recordModeArgument != null) { |
| | | return recordModeArgument.isPresent(); |
| | | } |
| | | return false; |
| | | return recordModeArgument != null && recordModeArgument.isPresent(); |
| | | } |
| | | |
| | | /** |
| | |
| | | && !needFirstLengthByteState(false)) { |
| | | return false; |
| | | } |
| | | |
| | | return peekLength <= reader.remaining(); |
| | | } |
| | | |
| | |
| | | && !needAdditionalLengthBytesState(false, false)) { |
| | | return false; |
| | | } |
| | | |
| | | return peekLength <= in.available(); |
| | | } |
| | | |
| | |
| | | final MatchingRule rule = attributeType.getEqualityMatchingRule(); |
| | | if (rule != null) { |
| | | final Comparator<ByteSequence> comparator = rule.comparator(); |
| | | return comparator.compare(normalizedValue, otherNormalizedValue) != 0 ? false |
| | | : true; |
| | | return comparator.compare(normalizedValue, otherNormalizedValue) == 0; |
| | | } else { |
| | | return normalizedValue.equals(otherNormalizedValue); |
| | | } |
| | |
| | | if (attribute == object) { |
| | | return true; |
| | | } |
| | | |
| | | if (!(object instanceof Attribute)) { |
| | | return false; |
| | | } |
| | | |
| | | final Attribute other = (Attribute) object; |
| | | if (!attribute.getAttributeDescription().equals(other.getAttributeDescription())) { |
| | | return false; |
| | | } |
| | | |
| | | // Attribute description is the same, compare values. |
| | | if (attribute.size() != other.size()) { |
| | | return false; |
| | | } |
| | | |
| | | return attribute.containsAll(other); |
| | | return attribute.getAttributeDescription().equals(other.getAttributeDescription()) |
| | | && attribute.size() == other.size() |
| | | && attribute.containsAll(other); |
| | | } |
| | | |
| | | /** |
| | |
| | | } |
| | | } |
| | | } else { |
| | | final RequestContextImpl<R, ResultHandler<R>> requestContext; |
| | | if (request.getOID().equals(StartTLSExtendedRequest.OID)) { |
| | | // StartTLS requests cannot be cancelled. |
| | | requestContext = |
| | | new RequestContextImpl<R, ResultHandler<R>>(this, resultHandler, |
| | | messageID, false); |
| | | } else { |
| | | requestContext = |
| | | new RequestContextImpl<R, ResultHandler<R>>(this, resultHandler, |
| | | messageID, true); |
| | | } |
| | | // StartTLS requests cannot be cancelled. |
| | | boolean isCancelSupported = !request.getOID().equals(StartTLSExtendedRequest.OID); |
| | | final RequestContextImpl<R, ResultHandler<R>> requestContext = |
| | | new RequestContextImpl<R, ResultHandler<R>>(this, resultHandler, messageID, isCancelSupported); |
| | | |
| | | if (addPendingRequest(requestContext)) { |
| | | requestHandler.handleExtendedRequest(requestContext, request, |
| | |
| | | * {@code false} if this control is using a target assertion. |
| | | */ |
| | | public boolean hasTargetOffset() { |
| | | return assertionValue != null ? false : true; |
| | | return assertionValue == null; |
| | | } |
| | | |
| | | /** {@inheritDoc} */ |
| | |
| | | return false; |
| | | } |
| | | |
| | | // The closing curly brace must not be the last character of the |
| | | // password. |
| | | if (closingBracePos == value.length() - 1) { |
| | | return false; |
| | | } |
| | | |
| | | // If we've gotten here, then it looks to be encoded. |
| | | return true; |
| | | // The closing curly brace must not be the last character of the password |
| | | return closingBracePos != value.length() - 1; |
| | | } |
| | | |
| | | @Override |
| | |
| | | * @return True if the control is supported. |
| | | */ |
| | | static boolean isSupported(final String control) { |
| | | if (controls != null && !controls.isEmpty()) { |
| | | return controls.contains(control); |
| | | } |
| | | return false; |
| | | return controls != null && controls.contains(control); |
| | | } |
| | | // --- JCite check support --- |
| | | |
| | |
| | | * @return True if the control is supported. |
| | | */ |
| | | static boolean isSupported(final String extendedOperation) { |
| | | if (extendedOperations != null && !extendedOperations.isEmpty()) { |
| | | return extendedOperations.contains(extendedOperation); |
| | | } |
| | | return false; |
| | | return extendedOperations != null && extendedOperations.contains(extendedOperation); |
| | | } |
| | | // --- JCite check support --- |
| | | |
| | |
| | | |
| | | boolean isMatchingRead(final SearchRequest request) { |
| | | // Cached reads are always base object. |
| | | if (!request.getScope().equals(SearchScope.BASE_OBJECT)) { |
| | | return false; |
| | | } |
| | | |
| | | // Filters must match. |
| | | if (!request.getFilter().toString().equals(cachedFilterString)) { |
| | | return false; |
| | | } |
| | | |
| | | // List of requested attributes must match. |
| | | if (!request.getAttributes().equals(cachedRequest.getAttributes())) { |
| | | return false; |
| | | } |
| | | |
| | | // Don't need to check anything else. |
| | | return true; |
| | | return request.getScope().equals(SearchScope.BASE_OBJECT) |
| | | // Filters must match. |
| | | && request.getFilter().toString().equals(cachedFilterString) |
| | | // List of requested attributes must match. |
| | | && request.getAttributes().equals(cachedRequest.getAttributes()); |
| | | } |
| | | |
| | | void setPromise(final LdapPromise<Result> promise) { |