I am trying check 2 of the below fields apr and aprType , if they are non empty. Below is the method:
> public WfccApplicationEntity constructApplicationEntity(
UpdateWfccApplicationDecisionRequest request,
WfccApplicationEntity entity) {
return entity.toBuilder()
> .statusCode(request.getStatusCode())
> .caseNumber(request.getCaseNumber())
> .updatedBy(request.getUpdatedBy())
> .apr(request.getApr())
> .aprType(request.getAprType())
> .statusCodeUpdatedDate(now())
> .customerId(request.getCustomerId())
> .statusCodeUpdatedDate(now())
> .build();
> }
I want to use org.apache.commons.lang3.StringUtils.isNotBlank() to check the fields
I am not able to use if statement in the return statement
Include Apache Commons Lang library (
org.apache.commons.lang3.StringUtils) in your build configuration.If you are using Gradle, you can add the Apache Commons Lang dependency to your project's
build.gradlefile as follows:Save the
build.gradlefile after adding the dependency. Gradle will automatically download the Apache Commons Lang library and include it in your project. Sync your project with the latest gradle file.Then you can try to use
StringUtils.isNotBlank()method.Here's a sample code: