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 * @return
*/ */
public static String trimToNull(String field) { public static String trimToNull(String field) {
if (field == null) if (field == null) {
return field; return field;
}
field = field.trim(); field = field.trim();
if (field.length() == 0) if (field.isEmpty()) {
return null; return null;
}
return field; return field;
} }
@ -38,8 +40,9 @@ public abstract class AbstractEntity {
* @return * @return
*/ */
public static String trimToEmpty(String field) { public static String trimToEmpty(String field) {
if (field == null) if (field == null) {
return ""; return "";
}
field = field.trim(); field = field.trim();
return field; return field;
} }