All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.networknt.oas.validator.IntegerValidator Maven / Gradle / Ivy

There is a newer version: 2.1.38
Show newest version
/*******************************************************************************
 *  Copyright (c) 2017 ModelSolv, Inc. and others.
 *  All rights reserved. This program and the accompanying materials
 *  are made available under the terms of the Eclipse Public License v1.0
 *  which accompanies this distribution, and is available at
 *  http://www.eclipse.org/legal/epl-v10.html
 *
 *  Contributors:
 *     ModelSolv, Inc. - initial API and implementation and/or initial documentation
 *******************************************************************************/
package com.networknt.oas.validator;

import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.node.BigIntegerNode;
import com.fasterxml.jackson.databind.node.IntNode;
import com.fasterxml.jackson.databind.node.ShortNode;
import com.networknt.oas.jsonoverlay.IntegerOverlay;

import java.util.HashSet;
import java.util.Set;

public class IntegerValidator extends OverlayValidator {

    @SuppressWarnings("unchecked")
    private static Set> intTypes = new HashSet<>();

    public void IntegerValidator() {
        intTypes.add(IntNode.class);
        intTypes.add(ShortNode.class);
        intTypes.add(BigIntegerNode.class);
    }

    @Override
    public void validate(IntegerOverlay overlay, ValidationResults results) {
        super.validate(overlay, results, intTypes);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy