class VrfValidation {

    protected void aaiAggregateRouteValidation(org.onap.aai.domain.yang.L3Network aaiLocalNetwork)
            throws VrfBondingServiceException {
        if (aaiLocalNetwork.getAggregateRoutes() == null
                || aaiLocalNetwork.getAggregateRoutes().getAggregateRoute() == null) {
            return;
        }
        if (aaiLocalNetwork.getAggregateRoutes().getAggregateRoute().size() == 1 && !aaiLocalNetwork
                .getAggregateRoutes().getAggregateRoute().get(0).getIpVersion().equalsIgnoreCase("4")) {
            throw new VrfBondingServiceException("LocalNetwork: " + aaiLocalNetwork.getNetworkId()
                    + " has 1 aggregate route but the Ip version of aggregate route is : "
                    + aaiLocalNetwork.getAggregateRoutes().getAggregateRoute().get(0).getIpVersion() + " and is not 4");
        } else if (aaiLocalNetwork.getAggregateRoutes().getAggregateRoute().size() == 2
                && !ipVersionValidation(aaiLocalNetwork.getAggregateRoutes().getAggregateRoute().get(0).getIpVersion(),
                        aaiLocalNetwork.getAggregateRoutes().getAggregateRoute().get(1).getIpVersion())) {
            throw new VrfBondingServiceException("LocalNetwork: " + aaiLocalNetwork.getNetworkId()
                    + " has 2 aggregate routes but the combination of the Ip versions for the aggregate routes did not match the ip version of one of them to be 4 and one to be 6");
        } else if (aaiLocalNetwork.getAggregateRoutes().getAggregateRoute().size() > 2) {
            throw new VrfBondingServiceException(
                    "LocalNetwork: " + aaiLocalNetwork.getNetworkId() + " either has more than 2 aggregate routes");
        }
    }

}