Skip to content
This repository has been archived by the owner on Oct 22, 2020. It is now read-only.

Commit

Permalink
[#164] feat : empty 체크 로직을 추가한다.
Browse files Browse the repository at this point in the history
  • Loading branch information
TheDevLuffy committed May 30, 2020
1 parent a7e736b commit 3e532b7
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import com.querydsl.core.types.dsl.BooleanExpression;
import com.woowacourse.tecobrary.domain.wishbook.entity.WishBookStatus;
import lombok.Builder;
import org.apache.commons.lang3.StringUtils;

import java.util.*;

Expand Down Expand Up @@ -33,12 +34,14 @@ Predicate[] where(Predicate... predicates) {

private BooleanExpression getRequestUserExpression() {
return Optional.ofNullable(requestUser)
.filter(StringUtils::isNotBlank)
.map(wishBook.user.name::eq)
.orElse(null);
}

private BooleanExpression getStatusExpression() {
return Optional.ofNullable(status)
.filter(obj -> false)
.map(wishBook.status::eq)
.orElse(null);
}
Expand Down

0 comments on commit 3e532b7

Please sign in to comment.