org.pitest.sequence.EmptyContext Maven / Gradle / Ivy
package org.pitest.sequence;
import java.util.Optional;
/**
* Specialisation of context with no data
*/
enum EmptyContext implements Context {
WITHOUT_DEBUG(false),
WITH_DEBUG(true);
private final boolean debug;
EmptyContext(boolean debug) {
this.debug = debug;
}
@Override
public boolean debug() {
return debug;
}
@Override
public Context store(SlotWrite slot, S value) {
return new Context1(slot.slot(), value, debug);
}
@SuppressWarnings("unchecked")
@Override
public Optional retrieve(SlotRead slot) {
return Optional.empty();
}
}