[New] new DBC.PRE.assertNull() method
This commit is contained in:
parent
4b179f8bb4
commit
adc9e3598c
|
@ -41,11 +41,24 @@ public enum DBC {
|
||||||
throw new DbcException(ex);
|
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 assertNotEmpty(String msg, String value);
|
||||||
|
|
||||||
public abstract void assertNotNull(String msg, Object value);
|
public abstract void assertNotNull(String msg, Object value);
|
||||||
|
|
||||||
|
public abstract void assertNull(String msg, Object value);
|
||||||
|
|
||||||
public class DbcException extends RuntimeException {
|
public class DbcException extends RuntimeException {
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue