class XConnectConfig extends Config<ApplicationId> {

    public Set<PortNumber> getPorts(XConnectStoreKey xconnect) {
        ImmutableSet.Builder<PortNumber> builder = ImmutableSet.builder();
        object.get(xconnect.deviceId().toString()).forEach(vlanPortsPair -> {
            if (xconnect.vlanId().toShort() == vlanPortsPair.get(VLAN).asInt()) {
                int portCount = vlanPortsPair.get(PORTS).size();
                checkArgument(portCount == 2,
                        "Expect 2 ports but found " + portCount + " on " + xconnect);
                vlanPortsPair.get(PORTS).forEach(portNode -> {
                    builder.add(PortNumber.portNumber(portNode.asInt()));
                });
            }
        });
        return builder.build();
    }

}