(Object property)
| 157 | } |
| 158 | |
| 159 | private static int coerce(Object property) { |
| 160 | if (property instanceof Number) { |
| 161 | return ((Number) property).intValue(); |
| 162 | } |
| 163 | if (property instanceof Character) { |
| 164 | return ((Character) property).charValue(); |
| 165 | } |
| 166 | if (property instanceof Boolean) { |
| 167 | return ((Boolean) property).booleanValue() ? 1 : 0; |
| 168 | } |
| 169 | if (property instanceof String) { |
| 170 | return Integer.parseInt((String) property); |
| 171 | } |
| 172 | throw new IllegalArgumentException(property != null ? property.toString() : "null"); |
| 173 | } |
| 174 | |
| 175 | } |
no test coverage detected