code formatting

This commit is contained in:
Peter Hormanns 2013-01-21 13:32:11 +01:00
parent 83968cf292
commit 21ae1802e3

View File

@ -24,11 +24,13 @@ public abstract class AbstractEntity {
* @return
*/
public static String trimToNull(String field) {
if (field == null)
if (field == null) {
return field;
}
field = field.trim();
if (field.length() == 0)
if (field.isEmpty()) {
return null;
}
return field;
}
@ -38,8 +40,9 @@ public abstract class AbstractEntity {
* @return
*/
public static String trimToEmpty(String field) {
if (field == null)
if (field == null) {
return "";
}
field = field.trim();
return field;
}