@Test public void testCastBooleanFalse() { assertTrue(booleanType.cast(Boolean.FALSE) instanceof Boolean); }
@Override public Object cast(Object obj) { Boolean value = null; if (obj != null) { if (obj instanceof Boolean) { value = (Boolean) obj; } else if (obj instanceof Number) { value = ((Number) obj).intValue() != 0; } else if (obj instanceof String) { value = Boolean.valueOf((String) obj); } else { throw Error.get(NAME, MetadataConstants.ERR_INCOMPATIBLE_VALUE, obj.toString()); } } return value; }
BooleanType implements Type, Serializable { @Override public Object cast(Object obj) { Boolean value = null; if (obj != null) { if (obj instanceof Boolean) { value = (Boolean) obj; } else if (obj instanceof Number) { value = ((Number) obj).intValue() != 0; } else if (obj instanceof String) { value = Boolean.valueOf((String) obj); } else { throw Error.get(NAME, MetadataConstants.ERR_INCOMPATIBLE_VALUE, obj.toString()); } } return value; } }
BooleanType implements Type, Serializable { @Override public Object cast(Object obj) { Boolean value = null; if (obj != null) { if (obj instanceof Boolean) { value = (Boolean) obj; } else if (obj instanceof Number) { value = ((Number) obj).intValue() != 0; } else if (obj instanceof String) { value = Boolean.valueOf((String) obj); } else { throw Error.get(NAME, MetadataConstants.ERR_INCOMPATIBLE_VALUE, obj.toString()); } } return value; } private  BooleanType(); }
BooleanType implements Type, Serializable { @Override public Object cast(Object obj) { Boolean value = null; if (obj != null) { if (obj instanceof Boolean) { value = (Boolean) obj; } else if (obj instanceof Number) { value = ((Number) obj).intValue() != 0; } else if (obj instanceof String) { value = Boolean.valueOf((String) obj); } else { throw Error.get(NAME, MetadataConstants.ERR_INCOMPATIBLE_VALUE, obj.toString()); } } return value; } private  BooleanType(); @Override String getName(); @Override boolean supportsEq(); @Override boolean supportsOrdering(); @Override JsonNode toJson(JsonNodeFactory factory, Object obj); @Override Object fromJson(JsonNode node); @Override Object cast(Object obj); @SuppressWarnings({"rawtypes", "unchecked"}) @Override int compare(Object v1, Object v2); @Override boolean equals(Object obj); @Override int hashCode(); @Override String toString(); }
BooleanType implements Type, Serializable { @Override public Object cast(Object obj) { Boolean value = null; if (obj != null) { if (obj instanceof Boolean) { value = (Boolean) obj; } else if (obj instanceof Number) { value = ((Number) obj).intValue() != 0; } else if (obj instanceof String) { value = Boolean.valueOf((String) obj); } else { throw Error.get(NAME, MetadataConstants.ERR_INCOMPATIBLE_VALUE, obj.toString()); } } return value; } private  BooleanType(); @Override String getName(); @Override boolean supportsEq(); @Override boolean supportsOrdering(); @Override JsonNode toJson(JsonNodeFactory factory, Object obj); @Override Object fromJson(JsonNode node); @Override Object cast(Object obj); @SuppressWarnings({"rawtypes", "unchecked"}) @Override int compare(Object v1, Object v2); @Override boolean equals(Object obj); @Override int hashCode(); @Override String toString(); static final Type TYPE; static final String NAME; }