You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
439 B
Java
19 lines
439 B
Java
package io.n0x.android.java_mot_testing.helper;
|
|
|
|
import androidx.databinding.InverseMethod;
|
|
|
|
public class Converter {
|
|
@InverseMethod("toInt")
|
|
public static String toString(int val){
|
|
if(val == 0){
|
|
return null;
|
|
}
|
|
return String.valueOf(val);
|
|
}
|
|
public static int toInt(String val){
|
|
if(val == null || val.isEmpty())
|
|
return 0;
|
|
return Integer.parseInt(val);
|
|
}
|
|
}
|