Java Code Examples for org.apache.commons.lang3.BooleanUtils#isNotFalse()

The following examples show how to use org.apache.commons.lang3.BooleanUtils#isNotFalse() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
private Collection<VendorPermission> allowedByTypeStrategy(TCString vendorConsent,
                                                           Purpose purpose,
                                                           Collection<VendorPermissionWithGvl> vendorPermissions) {
    final Collection<VendorPermissionWithGvl> excludedVendors = excludedVendors(vendorPermissions, purpose);
    final Collection<VendorPermissionWithGvl> vendorForPurpose = vendorPermissions.stream()
            .filter(vendorPermission -> !excludedVendors.contains(vendorPermission))
            .collect(Collectors.toList());
    final boolean isEnforceVendors = BooleanUtils.isNotFalse(purpose.getEnforceVendors());

    final EnforcePurpose purposeType = purpose.getEnforcePurpose();
    if (Objects.equals(purposeType, EnforcePurpose.basic)) {
        return allowedByBasicTypeStrategy(vendorConsent, isEnforceVendors, vendorForPurpose, excludedVendors);
    }

    if (Objects.equals(purposeType, EnforcePurpose.no)) {
        return allowedByNoTypeStrategy(vendorConsent, isEnforceVendors, vendorForPurpose, excludedVendors);
    }

    // Full by default
    if (purposeType == null || Objects.equals(purposeType, EnforcePurpose.full)) {
        return allowedByFullTypeStrategy(vendorConsent, isEnforceVendors, vendorForPurpose, excludedVendors);
    }

    throw new IllegalArgumentException(
            String.format("Invalid type strategy provided. no/base/full != %s", purposeType));
}
 
Example 2
public TcfDefinerService(GdprConfig gdprConfig,
                         Set<String> eeaCountries,
                         GdprService gdprService,
                         Tcf2Service tcf2Service,
                         GeoLocationService geoLocationService,
                         BidderCatalog bidderCatalog,
                         Metrics metrics) {

    this.gdprEnabled = gdprConfig != null && BooleanUtils.isNotFalse(gdprConfig.getEnabled());
    this.gdprDefaultValue = gdprConfig != null ? gdprConfig.getDefaultValue() : null;
    this.consentStringMeansInScope = gdprConfig != null
            && BooleanUtils.isTrue(gdprConfig.getConsentStringMeansInScope());
    this.gdprService = Objects.requireNonNull(gdprService);
    this.tcf2Service = Objects.requireNonNull(tcf2Service);
    this.eeaCountries = Objects.requireNonNull(eeaCountries);
    this.geoLocationService = geoLocationService;
    this.bidderCatalog = Objects.requireNonNull(bidderCatalog);
    this.metrics = Objects.requireNonNull(metrics);
}
 
Example 3
Source Project: cuba   File: FieldGroupLoader.java    License: Apache License 2.0 6 votes vote down vote up
protected void loadVisible(FieldGroup resultComponent, FieldGroup.FieldConfig field) {
    Element element = field.getXmlDescriptor();
    if (element != null) {
        String visible = element.attributeValue("visible");
        if (StringUtils.isNotEmpty(visible)) {
            field.setVisible(Boolean.parseBoolean(visible));
        }
    }

    if (!field.isCustom() && BooleanUtils.isNotFalse(field.isVisible())) {
        MetaClass metaClass = getMetaClass(resultComponent, field);
        MetaPropertyPath propertyPath = getMetadataTools().resolveMetaPropertyPath(metaClass, field.getProperty());

        checkNotNullArgument(propertyPath, "Could not resolve property path '%s' in '%s'", field.getId(), metaClass);

        if (!getSecurity().isEntityAttrReadPermitted(metaClass, propertyPath.toString())) {
            field.setVisible(false);
        }
    }
}
 
Example 4
Source Project: cuba   File: DesktopWindow.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public Boolean getCloseable() {
    DialogWindow dialogWindow = asDialogWindow();
    if (dialogWindow != null) {
        return BooleanUtils.isNotFalse(super.getCloseable());
    }

    return super.getCloseable();
}
 
Example 5
Source Project: cuba   File: FieldGroupLoader.java    License: Apache License 2.0 5 votes vote down vote up
protected void loadEditable(FieldGroup resultComponent, FieldGroup.FieldConfig field) {
    Element element = field.getXmlDescriptor();
    if (element != null) {
        String editable = element.attributeValue("editable");
        if (StringUtils.isNotEmpty(editable)) {
            field.setEditable(Boolean.parseBoolean(editable));
        }
    }

    if (!field.isCustom() && BooleanUtils.isNotFalse(field.isEditable())) {
        MetaClass metaClass = getMetaClass(resultComponent, field);
        MetaPropertyPath propertyPath = getMetadataTools().resolveMetaPropertyPath(metaClass, field.getProperty());

        checkNotNullArgument(propertyPath, "Could not resolve property path '%s' in '%s'", field.getId(), metaClass);

        boolean permittedIfEmbedded = true;
        if (getMetadataTools().isEmbeddable(metaClass)) {
            MetaClass parentMetaClass = getParentEntityMetaClass(resultComponent);
            MetaProperty embeddedProperty = ((EmbeddedDatasource) field.getTargetDatasource()).getProperty();
            permittedIfEmbedded = getSecurity().isEntityOpPermitted(parentMetaClass, EntityOp.UPDATE)
                    && getSecurity().isEntityAttrPermitted(parentMetaClass, embeddedProperty.getName(), EntityAttrAccess.MODIFY);
            if (permittedIfEmbedded && propertyPath.length() > 1) {
                for (MetaProperty property : propertyPath.getMetaProperties()) {
                    if (getSecurity().isEntityAttrUpdatePermitted(property.getDomain(), property.getName())) {
                        permittedIfEmbedded = false;
                        break;
                    }
                }
            }
        }
        if (!getSecurity().isEntityAttrUpdatePermitted(metaClass, propertyPath.toString()) || !permittedIfEmbedded) {
            field.setEditable(false);
        }
    }
}
 
Example 6
public boolean isNotFalse() {
    return BooleanUtils.isNotFalse(getValue());
}
 
Example 7
Source Project: ambari-logsearch   File: InputFile.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public boolean isEnabled() {
  return BooleanUtils.isNotFalse(getInputDescriptor().isEnabled());
}
 
Example 8
public Boolean getStatEnable() {
	return BooleanUtils.isNotFalse(this.statEnable);
}
 
Example 9
public Boolean getStatEnable() {
	return BooleanUtils.isNotFalse(this.statEnable);
}
 
Example 10
public Boolean getRedistribute() {
	return BooleanUtils.isNotFalse(this.redistribute);
}
 
Example 11
/** 默认为true */
public Boolean getExceptionInvalidStorage() {
	return BooleanUtils.isNotFalse(this.exceptionInvalidStorage);
}
 
Example 12
public Boolean getStatEnable() {
	return BooleanUtils.isNotFalse(statEnable);
}
 
Example 13
public Boolean getStatEnable() {
	return BooleanUtils.isNotFalse(statEnable);
}
 
Example 14
public Boolean getStatEnable() {
	return BooleanUtils.isNotFalse(statEnable);
}
 
Example 15
Source Project: o2oa   File: Node.java    License: GNU Affero General Public License v3.0 4 votes vote down vote up
public Boolean getEraseContentEnable() {
	return BooleanUtils.isNotFalse(eraseContentEnable);
}
 
Example 16
Source Project: o2oa   File: Node.java    License: GNU Affero General Public License v3.0 4 votes vote down vote up
public Boolean autoStart() {
	return BooleanUtils.isNotFalse(autoStart);
}
 
Example 17
Source Project: o2oa   File: Node.java    License: GNU Affero General Public License v3.0 4 votes vote down vote up
public Boolean nodeAgentEncrypt() {
	return BooleanUtils.isNotFalse(this.nodeAgentEncrypt);
}
 
Example 18
public Boolean getJoinInquire() {
	return BooleanUtils.isNotFalse(this.joinInquire);
}
 
Example 19
public Boolean getLatest() {
	return BooleanUtils.isNotFalse(this.latest);
}
 
Example 20
Source Project: herd   File: S3DaoImpl.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public void validateGlacierS3FilesRestored(S3FileTransferRequestParamsDto params) throws RuntimeException
{
    LOGGER.info("Checking for already restored Glacier or DeepArchive storage class objects... s3KeyPrefix=\"{}\" s3BucketName=\"{}\" s3KeyCount={}",
        params.getS3KeyPrefix(), params.getS3BucketName(), params.getFiles().size());

    if (!CollectionUtils.isEmpty(params.getFiles()))
    {
        // Initialize a key value pair for the error message in the catch block.
        String key = params.getFiles().get(0).getPath().replaceAll("\\\\", "/");

        try
        {
            // Create an S3 client.
            AmazonS3Client s3Client = getAmazonS3(params);

            try
            {
                for (File file : params.getFiles())
                {
                    key = file.getPath().replaceAll("\\\\", "/");
                    ObjectMetadata objectMetadata = s3Operations.getObjectMetadata(params.getS3BucketName(), key, s3Client);

                    // Fail if a not already restored object is detected.
                    if (BooleanUtils.isNotFalse(objectMetadata.getOngoingRestore()))
                    {
                        throw new IllegalArgumentException(String
                            .format("Archived S3 file \"%s\" is not restored. StorageClass {%s}, OngoingRestore flag {%s}, S3 bucket name {%s}",
                                key, objectMetadata.getStorageClass(), objectMetadata.getOngoingRestore(), params.getS3BucketName()));
                    }
                }
            }
            finally
            {
                s3Client.shutdown();
            }
        }
        catch (AmazonServiceException e)
        {
            throw new IllegalStateException(
                String.format("Fail to check restore status for \"%s\" key in \"%s\" bucket. Reason: %s", key, params.getS3BucketName(), e.getMessage()),
                e);
        }
    }
}