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

com.github.houbb.valid.jsr.constraint.DigitsLongConstraint Maven / Gradle / Ivy

package com.github.houbb.valid.jsr.constraint;

import com.github.houbb.heaven.annotation.ThreadSafe;

/**
 * {@link javax.validation.constraints.Digits} 约束注解实现
 * @author binbin.hou
 * @since 0.0.3
 * @see Integer
 * @see Byte
 * @see Short
 * @see Long
 */
@ThreadSafe
class DigitsLongConstraint extends AbstractDigitsConstraint {

    public DigitsLongConstraint(int integer, int fraction) {
        super(integer, fraction);
    }

    public DigitsLongConstraint(int integer) {
        super(integer);
    }

    @Override
    protected int getIntegerDigits(Long value) {
        String longStr = value.toString();
        return longStr.length();
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy