ActionWithResult interface, ActionWithBooleanResult.

This commit is contained in:
magenoxx 2012-01-26 00:38:45 +04:00
parent b0a1c07067
commit 039d9663f0
2 changed files with 38 additions and 0 deletions

View file

@ -0,0 +1,25 @@
package mage.interfaces;
/**
* /**
* Light weight action interface
* For executing actions without any context.
*
* @param <T> Type to return as a result of execution.
*
* @author noxx
*/
public interface ActionWithResult<T> {
/**
* Executes and returns result.
* @return
*/
public T execute();
/**
* Returns negative result specific for type <T>.
* @return
*/
public T negativeResult();
}

View file

@ -0,0 +1,13 @@
package mage.utils;
import mage.interfaces.ActionWithResult;
/**
* @author noxx
*/
public abstract class ActionWithBooleanResult implements ActionWithResult<Boolean> {
@Override
public Boolean negativeResult() {
return false;
}
}