Skip to content

Instantly share code, notes, and snippets.

@ntakouris
Created May 13, 2018 18:17
Show Gist options
  • Save ntakouris/05d59ce73543718c62001451d6303dd7 to your computer and use it in GitHub Desktop.
Save ntakouris/05d59ce73543718c62001451d6303dd7 to your computer and use it in GitHub Desktop.
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