Skip to content

Add "nonNegative" checks and "requireNegative" validators #4

@kennedykori

Description

@kennedykori

Add checks for checking if a numeric value is non negative and validators than ensure that a numeric value is negative. The checkers should be preferably named nonNegative and the validators should be preferably named requireNegative.

Example usage of notNegative

public int someMethod(int value) {
    if (nonNegative(value))
        return value;
    else
        return 0;
}

Example usage of requireNegative

public void setSomeValue(int value) {
    this.someValue = requireNegative(value);
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions