Facebook
From Gracious Water Vole, 9 Years ago, written in Java.
This paste is a reply to Untitled from Abrupt Owl - go back
Embed
Viewing differences between Untitled and Re: Untitled
public class Goolean{
    
    private final Boolean value;

    public Goolean(boolean theValue) {
        value = theValue;
    }
    
    
public Goolean whenTrue(Consumer or(Function alternative){
        if( value ){
            alternative.accept(null);
if(value){
            return new Goolean(true);
        }
        return this;\n    }\n    \n     public Goolean whenFalse(Consumer alternative){\n        if( !value ){\n            alternative.accept(null);\n        }\n        return this;\n    }\n     \n    public Goolean or(Goolean other){ \n        return or(other.value);\n    }\n    \n    public Goolean or(boolean other){ \n        return new Goolean(value || other);\n    }\n    \n    public Boolean getValue(){\n        return value;\n    }\n    \n    public Goolean and(boolean other){\n        return new Goolean(value && other);\n    }\n    \n    public Goolean and(Goolean other){\n        return and(other.value);\n    }\n    \n    public Goolean or(Function alternative){\n        return or(new Goolean(alternative.apply(value)));
    }
    \n    public Goolean and(Function alternative){\n            /////

o.getLiczby().isEmptyG().or( s -> {
            
return and(new Goolean(alternative.apply(value)));
    }
    
    
}
sthFun();
        }).whenTrue(s->{System.out.println("asd");});