public PortScan setPorts(ArrayList<Integer> ports) {

        // Check all ports are valid
        for (Integer port : ports) {
            validatePort(port);
        }

        this.ports = ports;

        return this;
    }
Scan the ports to scan

@param ports - the ports to scan
@return this object to allow chaining
library/src/main/java/com/stealthcopter/networktools/PortScan.java