[New] new DBC.PRE.assertNull() method

This commit is contained in:
Robert von Burg 2014-01-15 22:02:21 +01:00
parent 4b179f8bb4
commit adc9e3598c
1 changed files with 13 additions and 0 deletions

View File

@ -41,11 +41,24 @@ public enum DBC {
throw new DbcException(ex);
}
}
@Override
public void assertNull(String msg, Object value) {
if (value != null) {
String ex = "Illegal situation as value is not null: {0}"; //$NON-NLS-1$
ex = MessageFormat.format(ex, msg);
throw new DbcException(ex);
}
}
};
public abstract void assertNotEmpty(String msg, String value);
public abstract void assertNotNull(String msg, Object value);
public abstract void assertNull(String msg, Object value);
public class DbcException extends RuntimeException {
private static final long serialVersionUID = 1L;