AlexZezekalo
AlexZezekalo
Reputation Top 5%
Alex Zezekalo
1 Snippet  (351st place)
Published
1 Channel
Created
2 Channels
Following
May 8, 2017
Last Visit
Apr 12, 2017
Registered
51 points  (583rd place)
Reputation
Junior Code Generator
Junior Publisher
Junior Topic Hub
Junior Trend Maker
Junior Judge
Junior Popular Coder
Junior Autobiographer
Senior Autobiographer

Recent Snippets See all snippets by AlexZezekalo

public by AlexZezekalo created May 8, 2017  740  0  4  0

Potential NPE

//@Override
//public boolean isSatisfiedBy(T candidate) {
//return left.isSatisfiedBy(candidate) && right.isSatisfiedBy(candidate);
//потенциальный NPE   

//Nonnull as solvation?


public class AndSpecification<T> extends CompositeSpecification<T> {

    @Nonnull
    private final Specification<T> left;

    @Nonnull
    private final Specification<T> right;

    public AndSpecification(@Nonnull Specification<T> left, @Nonnull Specification<T> right) {
        this.left = left;
        this.right = right;
    }

    @Override
    public boolean isSatisfiedBy(T candidate) {
        return left.isSatisfiedBy(candidate) && right.isSatisfiedBy(candidate);
    }

}
;