JSONSchemaBooleanType booleanType = (JSONSchemaBooleanType) type;
if (defaultValue instanceof Boolean) {
booleanType.setDefaultValue((Boolean) defaultValue);
}
} else if (type instanceof JSONSchemaIntegerType) {
JSONSchemaIntegerType intType = (JSONSchemaIntegerType) type;
if (defaultValue instanceof Number) {
intType.setDefaultValue(((Number) defaultValue).intValue());
}
if (minimum instanceof Number) {
intType.setMinimum(minimum.intValue());
}
if (minimumExclusive instanceof Boolean) {
intType.setMinimumExclusive(minimumExclusive);
}
if (maximum instanceof Number) {
intType.setMaximum(maximum.intValue());
}
if (maximumExclusive instanceof Boolean) {
intType.setMaximumExclusive(maximumExclusive);
}
if (divisibleBy instanceof Number) {
intType.setDivisibleBy(divisibleBy.intValue());
}
intType.setEnumValues(Collections2.filter(Lists.transform(enums, new Function<Object, Integer>() {
@Override
public Integer apply(@Nullable Object input) {
return input instanceof Number ? ((Number) input).intValue() : null;
}
}), Predicates.notNull()));