Home / Function/ isValidIpV4AddressOld() — netty Function Reference

isValidIpV4AddressOld() — netty Function Reference

Architecture documentation for the isValidIpV4AddressOld() function in IsValidIpV4Benchmark.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  da6dff0f_872c_87bd_44ec_6f3d60def47e["isValidIpV4AddressOld()"]
  03a72f97_be98_f809_61f6_bc171ba876a8["IsValidIpV4Benchmark"]
  da6dff0f_872c_87bd_44ec_6f3d60def47e -->|defined in| 03a72f97_be98_f809_61f6_bc171ba876a8
  style da6dff0f_872c_87bd_44ec_6f3d60def47e fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

microbench/src/main/java/io/netty/microbenchmark/common/IsValidIpV4Benchmark.java lines 38–78

    public static boolean isValidIpV4AddressOld(String value) {

        int periods = 0;
        int i;
        int length = value.length();

        if (length > 15) {
            return false;
        }
        char c;
        StringBuilder word = new StringBuilder();
        for (i = 0; i < length; i++) {
            c = value.charAt(i);
            if (c == '.') {
                periods++;
                if (periods > 3) {
                    return false;
                }
                if (word.length() == 0) {
                    return false;
                }
                if (Integer.parseInt(word.toString()) > 255) {
                    return false;
                }
                word.delete(0, word.length());
            } else if (!Character.isDigit(c)) {
                return false;
            } else {
                if (word.length() > 2) {
                    return false;
                }
                word.append(c);
            }
        }

        if (word.length() == 0 || Integer.parseInt(word.toString()) > 255) {
            return false;
        }

        return periods == 3;
    }

Domain

Subdomains

Frequently Asked Questions

What does isValidIpV4AddressOld() do?
isValidIpV4AddressOld() is a function in the netty codebase, defined in microbench/src/main/java/io/netty/microbenchmark/common/IsValidIpV4Benchmark.java.
Where is isValidIpV4AddressOld() defined?
isValidIpV4AddressOld() is defined in microbench/src/main/java/io/netty/microbenchmark/common/IsValidIpV4Benchmark.java at line 38.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free