code: public void setAuthorizedPatternArray(String[] patterns) {
          Matcher matcher;
  
          patterns: for (String pattern: patterns) {
              if ((matcher = IPv4_ADDRESS_PATTERN.matcher(pattern)).matches()) {
                  short[] address = new short[4];
                  for (int i = 0; i < address.length; ++i) {
                      String p = matcher.group(i+1);
                      try {
                          address[i] = Short.parseShort(p);
                          if (address[i] > 255) {
                              _logger.warning("Invalid pattern ignored: " + pattern);
                              continue patterns;
                          }
                      } catch (Exception x) {
                          if ("*".equals(p)) {
                              address[i] = 256;
                          } else {
                              _logger.warning("Invalid pattern ignored: " + pattern);
                              continue patterns;
                          }
                      }
                  }
                  _logger.fine("normalized ipv4 address pattern = " + Strings.join(address, '.'));
                  _ipv4patterns.add(address);
              } else if ((matcher = IPv6_ADDRESS_PATTERN.matcher(pattern)).matches()) {
                  short[] address = new short[16];
                  for (int i = 0; i < address.length; i += 2) {
                      String p = matcher.group(i/2+1);
                      try {
                          int v = Integer.parseInt(p, 16);
                          address[i] = (short)(v >> 8);
                          address[i+1] = (short)(v & 0x00ff);
                      } catch (Exception x) {
                          if ("*".equals(p)) {
                              address[i] = 256;
                              address[i+1] = 256;
                          } else {
                              _logger.warning("Invalid pattern ignored: " + pattern);
                              continue patterns;
                          }
                      }
                  }
                  _logger.fine("normalized ipv6 address pattern = " + Strings.join(address, '.'));
                  _ipv6patterns.add(address);
              } else {
                  _logger.warning("Invalid pattern ignored: " + pattern);
              }
          }
      }
docs: Adds authorized address patterns as a String array.