Skip to content

Commit cbd1b14

Browse files
committed
ADD: metho to get a string even if null
1 parent 557c0a7 commit cbd1b14

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

src/main/java/com/odoojava/api/Row.java

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,19 @@ public int getID(){
6767
Object idValue = get("id");
6868
return Integer.parseInt(idValue.toString());
6969
}
70-
70+
71+
/**
72+
* Returns the database string field of the object/row.
73+
* @return string
74+
*/
75+
public String getString(String fieldName){
76+
String res=null;
77+
if ( get(fieldName).toString()!= null){
78+
res = get(fieldName).toString();
79+
}
80+
return res;
81+
}
82+
7183
/**
7284
* Add a listener to be notified when a row is being changed
7385
* @param listener

0 commit comments

Comments
 (0)