Package com.bazaarvoice.commons.data.model.json.schema.types

Examples of com.bazaarvoice.commons.data.model.json.schema.types.JSONSchemaNumberType


                    public Integer apply(@Nullable Object input) {
                        return input instanceof Number ? ((Number) input).intValue() : null;
                    }
                }), Predicates.notNull()));
            } else if (type instanceof JSONSchemaNumberType) {
                JSONSchemaNumberType numberType = (JSONSchemaNumberType) type;
                if (defaultValue instanceof Number) {
                    numberType.setDefaultValue((Number) defaultValue);
                }

                if (minimum instanceof Number) {
                    numberType.setMinimum(minimum);
                }

                if (minimumExclusive instanceof Boolean) {
                    numberType.setMinimumExclusive(minimumExclusive);
                }

                if (maximum instanceof Number) {
                    numberType.setMaximum(maximum);
                }

                if (maximumExclusive instanceof Boolean) {
                    numberType.setMaximumExclusive(maximumExclusive);
                }

                if (divisibleBy instanceof Number) {
                    numberType.setDivisibleBy(divisibleBy);
                }

                numberType.setEnumValues(Collections2.filter(Lists.transform(enums, new Function<Object, Number>() {
                    @Override
                    public Number apply(@Nullable Object input) {
                        return input instanceof Number ? (Number) input : null;
                    }
                }), Predicates.notNull()));
View Full Code Here


    public static JSONSchema newStringFormatSchema(JSONSchemaTextFormat format) {
        return newSimpleSchema(new JSONSchemaStringType().format(format));
    }

    public static JSONSchema newNumberSchema() {
        return newSimpleSchema(new JSONSchemaNumberType());
    }
View Full Code Here

    public static JSONSchemaIntegerType newPositiveInteger() {
        return new JSONSchemaIntegerType().minimum(0).minimumExclusive();
    }

    public static JSONSchemaNumberType newNonNegativeNumber() {
        return new JSONSchemaNumberType().minimum(0);
    }
View Full Code Here

    public static JSONSchemaNumberType newNonNegativeNumber() {
        return new JSONSchemaNumberType().minimum(0);
    }

    public static JSONSchemaNumberType newPositiveNumber() {
        return new JSONSchemaNumberType().minimum(0).minimumExclusive();
    }
View Full Code Here

                    public Integer apply(@Nullable Object input) {
                        return input instanceof Number ? ((Number) input).intValue() : null;
                    }
                }), Predicates.notNull()));
            } else if (type instanceof JSONSchemaNumberType) {
                JSONSchemaNumberType numberType = (JSONSchemaNumberType) type;
                if (defaultValue instanceof Number) {
                    numberType.setDefaultValue((Number) defaultValue);
                }

                if (minimum instanceof Number) {
                    numberType.setMinimum(minimum);
                }

                if (minimumExclusive instanceof Boolean) {
                    numberType.setMinimumExclusive(minimumExclusive);
                }

                if (maximum instanceof Number) {
                    numberType.setMaximum(maximum);
                }

                if (maximumExclusive instanceof Boolean) {
                    numberType.setMaximumExclusive(maximumExclusive);
                }

                if (divisibleBy instanceof Number) {
                    numberType.setDivisibleBy(divisibleBy);
                }

                numberType.setEnumValues(Collections2.filter(Lists.transform(enums, new Function<Object, Number>() {
                    @Override
                    public Number apply(@Nullable Object input) {
                        return input instanceof Number ? (Number) input : null;
                    }
                }), Predicates.notNull()));
View Full Code Here

TOP

Related Classes of com.bazaarvoice.commons.data.model.json.schema.types.JSONSchemaNumberType

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.