Created
May 13, 2018 18:17
-
-
Save ntakouris/05d59ce73543718c62001451d6303dd7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class BooleanContradictableType implements ContradictableType { | |
boolean value; | |
public BooleanContradictableType(boolean value) { | |
this.value = value; | |
} | |
public boolean getValue() { | |
return value; | |
} | |
@Override | |
public boolean equivalentTo(ContradictableType other) { | |
if (other == null || !(other instanceof BooleanContradictableType)) { | |
return false; | |
} | |
return value == ((BooleanContradictableType) other).value; | |
} | |
@Override | |
public boolean cancelsOutWith(ContradictableType other) { | |
if (other == null || !(other instanceof BooleanContradictableType)) { | |
return false; | |
} | |
return value != ((BooleanContradictableType) other).value; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment