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
Source File: PurposeStrategy.java    From prebid-server-java with Apache License 2.0 6 votes vote down vote up
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
Source File: TcfDefinerService.java    From prebid-server-java with Apache License 2.0 6 votes vote down vote up
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 File: FieldGroupLoader.java    From cuba with 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 File: FieldGroupLoader.java    From cuba with 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 5
Source File: DesktopWindow.java    From cuba with 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 6
Source File: ApplicationServer.java    From o2oa with GNU Affero General Public License v3.0 4 votes vote down vote up
public Boolean getStatEnable() {
	return BooleanUtils.isNotFalse(statEnable);
}
 
Example 7
Source File: S3DaoImpl.java    From herd with 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);
        }
    }
}
 
Example 8
Source File: TaskCompleted.java    From o2oa with GNU Affero General Public License v3.0 4 votes vote down vote up
public Boolean getLatest() {
	return BooleanUtils.isNotFalse(this.latest);
}
 
Example 9
Source File: TaskCompleted.java    From o2oa with GNU Affero General Public License v3.0 4 votes vote down vote up
public Boolean getJoinInquire() {
	return BooleanUtils.isNotFalse(this.joinInquire);
}
 
Example 10
Source File: Node.java    From o2oa with GNU Affero General Public License v3.0 4 votes vote down vote up
public Boolean nodeAgentEncrypt() {
	return BooleanUtils.isNotFalse(this.nodeAgentEncrypt);
}
 
Example 11
Source File: Node.java    From o2oa with GNU Affero General Public License v3.0 4 votes vote down vote up
public Boolean autoStart() {
	return BooleanUtils.isNotFalse(autoStart);
}
 
Example 12
Source File: Node.java    From o2oa with GNU Affero General Public License v3.0 4 votes vote down vote up
public Boolean getEraseContentEnable() {
	return BooleanUtils.isNotFalse(eraseContentEnable);
}
 
Example 13
Source File: BooleanWebStorageEntry.java    From openemm with GNU Affero General Public License v3.0 4 votes vote down vote up
public boolean isNotFalse() {
    return BooleanUtils.isNotFalse(getValue());
}
 
Example 14
Source File: WebServer.java    From o2oa with GNU Affero General Public License v3.0 4 votes vote down vote up
public Boolean getStatEnable() {
	return BooleanUtils.isNotFalse(statEnable);
}
 
Example 15
Source File: CenterServer.java    From o2oa with GNU Affero General Public License v3.0 4 votes vote down vote up
public Boolean getStatEnable() {
	return BooleanUtils.isNotFalse(statEnable);
}
 
Example 16
Source File: DumpRestoreStorage.java    From o2oa with GNU Affero General Public License v3.0 4 votes vote down vote up
/** 默认为true */
public Boolean getExceptionInvalidStorage() {
	return BooleanUtils.isNotFalse(this.exceptionInvalidStorage);
}
 
Example 17
Source File: DumpRestoreStorage.java    From o2oa with GNU Affero General Public License v3.0 4 votes vote down vote up
public Boolean getRedistribute() {
	return BooleanUtils.isNotFalse(this.redistribute);
}
 
Example 18
Source File: ExternalDataSource.java    From o2oa with GNU Affero General Public License v3.0 4 votes vote down vote up
public Boolean getStatEnable() {
	return BooleanUtils.isNotFalse(this.statEnable);
}
 
Example 19
Source File: DataServer.java    From o2oa with GNU Affero General Public License v3.0 4 votes vote down vote up
public Boolean getStatEnable() {
	return BooleanUtils.isNotFalse(this.statEnable);
}
 
Example 20
Source File: InputFile.java    From ambari-logsearch with Apache License 2.0 4 votes vote down vote up
@Override
public boolean isEnabled() {
  return BooleanUtils.isNotFalse(getInputDescriptor().isEnabled());
}