AlexZezekalo
AlexZezekalo
Reputation Top 5%
Alex Zezekalo
1 Snippet  (642nd place)
Published
1 Channel
Created
2 Channels
Following
May 8, 2017
Last Visit
Apr 12, 2017
Registered
43 points  (488th place)
Reputation
Junior Code Generator
Junior Publisher
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  529  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);
    }

}
;