class Builder
    {
        private InetAddress  clientHost    = DEFAULT_BROADCAST_HOST_ADDRESS;
        private InetAddress  serverAddr    = DEFAULT_BROADCAST_ADDRESS;
        private int     port;
        private long    broadcastInterval  = DEFAULT_BROADCAST_INTERVAL;
        private byte[]  beacon;
        private boolean ignoreLocalAddress = true;
        private boolean blocking           = false;
        // Those arguments are not set using the constructor, so they are optional for backward compatibility
        private Listener listener          = null;
        private byte[]  prefix             = null;
        private Thread.UncaughtExceptionHandler clientExHandler = null;
        private Thread.UncaughtExceptionHandler serverExHandler = null;

        public Builder port(int port)
        {
            this.port = port;
            return this;
        }

        public Builder beacon(byte[] beacon)
        {
            this.beacon = beacon;
            return this;
        }

        @Deprecated
        public Builder client(String host)
        {
            try {
                this.clientHost = InetAddress.getByName(host);
            }
            catch (UnknownHostException e) {
                throw new IllegalArgumentException("Invalid server address", e);
            }
            return this;
        }

        public Builder client(InetAddress host)
        {
            this.clientHost = host;
            return this;
        }

        @Deprecated
        public Builder server(byte[] addr)
        {
            Utils.checkArgument(addr.length == 4 || addr.length == 16, "Server Address has to be 4 or 16 bytes long");
            try {
                this.serverAddr = InetAddress.getByAddress(addr);
            }
            catch (UnknownHostException e) {
                throw new IllegalArgumentException("Invalid server address", e);
            }
            return this;
        }

        public Builder server(InetAddress addr)
        {
            this.serverAddr = addr;
            return this;
        }

        public Builder ignoreLocalAddress(boolean ignoreLocalAddress)
        {
            this.ignoreLocalAddress = ignoreLocalAddress;
            return this;
        }

        /**
         * @deprecated ignored
         * @param blocking
         * @return
         */
        @Deprecated
        public Builder blocking(boolean blocking)
        {
            this.blocking = blocking;
            return this;
        }

        public Builder broadcastInterval(long broadcastInterval)
        {
            this.broadcastInterval = broadcastInterval;
            return this;
        }

        public Builder listener(Listener listener)
        {
            this.listener = listener;
            return this;
        }

        public Builder prefix(byte[] prefix)
        {
            this.prefix = Arrays.copyOf(prefix, prefix.length);
            return this;
        }

        public Builder setClientUncaughtExceptionHandlers(Thread.UncaughtExceptionHandler clientExHandler)
        {
            this.clientExHandler = clientExHandler;
            return this;
        }

        public Builder setServerUncaughtExceptionHandlers(Thread.UncaughtExceptionHandler serverExHandler)
        {
            this.serverExHandler = serverExHandler;
            return this;
        }

        public ZBeacon build()
        {<FILL_FUNCTION_BODY>}
    }

            ZBeacon zbeacon = new ZBeacon(clientHost, serverAddr, port, beacon, broadcastInterval, ignoreLocalAddress, blocking);
            if (listener != null) {
                zbeacon.setListener(listener);
            }
            if (prefix != null) {
                zbeacon.setPrefix(prefix);
            }
            if (this.serverExHandler != null) {
                zbeacon.serverExHandler.set(this.serverExHandler);
            }
            if (this.clientExHandler != null) {
                zbeacon.clientExHandler.set(this.clientExHandler);
            }
            return zbeacon;
        
<no_super_class>