// Path: dragonite-proxy/src/main/java/com/vecsight/dragonite/proxy/acl/ACLItemMethod.java
// public enum ACLItemMethod {
//     DIRECT,
//     PROXY,
//     REJECT
// }
// 
// Path: dragonite-proxy/src/main/java/com/vecsight/dragonite/proxy/acl/ACLItemType.java
// public enum ACLItemType {
//     DOMAIN,
//     DOMAIN_SUFFIX,
//     IPv4,
//     IPv4_CIDR,
//     IPv6,
//     IPv6_CIDR
// }
// 
// Path: dragonite-proxy/src/main/java/com/vecsight/dragonite/proxy/exception/InvalidAddressException.java
// public class InvalidAddressException extends Exception {
// 
//     public InvalidAddressException(final String msg) {
//         super(msg);
//     }
// 
// }


import com.vecsight.dragonite.proxy.acl.ACLItemMethod;
import com.vecsight.dragonite.proxy.acl.ACLItemType;
import com.vecsight.dragonite.proxy.exception.InvalidAddressException;
import java.net.InetAddress;
import java.net.UnknownHostException;
import java.util.Arrays;
/*
 * The Dragonite Project
 * -------------------------
 * See the LICENSE file in the root directory for license information.
 */


package com.vecsight.dragonite.proxy.acl.item;



public class IPv6ACLItem implements ACLItem {

    private final byte[] bytes;

    private final ACLItemMethod method;

    public IPv6ACLItem(final String string, final ACLItemMethod method) throws InvalidAddressException {
        this.method = method;
        try {
            bytes = InetAddress.getByName(string).getAddress();
            if (bytes.length != 16) throw new InvalidAddressException(string + " is not a valid IPv6 address");
        } catch (final UnknownHostException e) {
            throw new InvalidAddressException(string + " is not a valid IPv6 address");
        }
    }

    public IPv6ACLItem(final byte[] bytes, final ACLItemMethod method) {
        this.method = method;
        this.bytes = bytes;
    }

    @Override
// Path: dragonite-proxy/src/main/java/com/vecsight/dragonite/proxy/acl/ACLItemMethod.java
// public enum ACLItemMethod {
//     DIRECT,
//     PROXY,
//     REJECT
// }
// 
// Path: dragonite-proxy/src/main/java/com/vecsight/dragonite/proxy/acl/ACLItemType.java
// public enum ACLItemType {
//     DOMAIN,
//     DOMAIN_SUFFIX,
//     IPv4,
//     IPv4_CIDR,
//     IPv6,
//     IPv6_CIDR
// }
// 
// Path: dragonite-proxy/src/main/java/com/vecsight/dragonite/proxy/exception/InvalidAddressException.java
// public class InvalidAddressException extends Exception {
// 
//     public InvalidAddressException(final String msg) {
//         super(msg);
//     }
// 
// }


// Path: dragonite-proxy/src/main/java/com/vecsight/dragonite/proxy/acl/item/IPv6ACLItem.java
import com.vecsight.dragonite.proxy.acl.ACLItemMethod;
import com.vecsight.dragonite.proxy.acl.ACLItemType;
import com.vecsight.dragonite.proxy.exception.InvalidAddressException;
import java.net.InetAddress;
import java.net.UnknownHostException;
import java.util.Arrays;

/*
 * The Dragonite Project
 * -------------------------
 * See the LICENSE file in the root directory for license information.
 */


package com.vecsight.dragonite.proxy.acl.item;



public class IPv6ACLItem implements ACLItem {

    private final byte[] bytes;

    private final ACLItemMethod method;

    public IPv6ACLItem(final String string, final ACLItemMethod method) throws InvalidAddressException {
        this.method = method;
        try {
            bytes = InetAddress.getByName(string).getAddress();
            if (bytes.length != 16) throw new InvalidAddressException(string + " is not a valid IPv6 address");
        } catch (final UnknownHostException e) {
            throw new InvalidAddressException(string + " is not a valid IPv6 address");
        }
    }

    public IPv6ACLItem(final byte[] bytes, final ACLItemMethod method) {
        this.method = method;
        this.bytes = bytes;
    }

    @Override
    public ACLItemType getType() {