Code example for StringTokenizer

Methods: hasMoreTokensnextToken

0
            Thread.sleep(40000);
        } 
    } 
 
    static InetSocketAddress from(String endpoint) {
        StringTokenizer tokes = new StringTokenizer(endpoint, ":");
        if (tokes.hasMoreTokens()) {
            String host = tokes.nextToken();
            if (tokes.hasMoreTokens()) {
                int port = Integer.parseInt(tokes.nextToken());
                return new InetSocketAddress(host, port);
            } 
            throw new IllegalArgumentException("No port: " + endpoint);
        } 
        throw new IllegalArgumentException("Invalid host:port specification: "
                                           + endpoint);
    } 
 
    @Bean 
    public HeartbeatConfiguration heartbeatConfig() { 
Stop searching for code, let great code find you!  Add Codota to your java IDE