class AAIObjectMapper {

    public org.onap.aai.domain.yang.Subnets mapToAAISubNets(List<Subnet> subnetList) {
        org.onap.aai.domain.yang.Subnets subnets = null;

        if (!subnetList.isEmpty()) {
            subnets = new org.onap.aai.domain.yang.Subnets();
            org.onap.aai.domain.yang.Subnet subnet = null;
            for (Subnet subnetSource : subnetList) {
                subnet = new org.onap.aai.domain.yang.Subnet();
                subnet.setSubnetId(subnetSource.getSubnetId());
                subnet.setSubnetName(subnetSource.getSubnetName());
                subnet.setNeutronSubnetId(subnetSource.getNeutronSubnetId());
                subnet.setGatewayAddress(subnetSource.getGatewayAddress());
                subnet.setCidrMask(subnetSource.getCidrMask());
                subnet.setIpVersion(subnetSource.getIpVersion());
                subnet.setOrchestrationStatus(subnetSource.getOrchestrationStatus().toString());
                subnet.setCidrMask(subnetSource.getCidrMask());
                subnet.setDhcpEnabled(subnetSource.isDhcpEnabled());
                subnet.setDhcpStart(subnetSource.getDhcpStart());
                subnet.setDhcpEnd(subnetSource.getDhcpEnd());
                subnet.setSubnetRole(subnetSource.getSubnetRole());
                subnet.setIpAssignmentDirection(subnetSource.getIpAssignmentDirection());
                subnet.setSubnetSequence(subnetSource.getSubnetSequence());

                org.onap.aai.domain.yang.HostRoutes hostRoutes = new org.onap.aai.domain.yang.HostRoutes();
                org.onap.aai.domain.yang.HostRoute hostRoute = null;
                for (HostRoute hostRouteSource : subnetSource.getHostRoutes()) {
                    hostRoute = new org.onap.aai.domain.yang.HostRoute();
                    hostRoute.setHostRouteId(hostRouteSource.getHostRouteId());
                    hostRoute.setRoutePrefix(hostRouteSource.getRoutePrefix());
                    hostRoute.setNextHop(hostRouteSource.getNextHop());
                    hostRoute.setNextHopType(hostRouteSource.getNextHopType());
                    hostRoutes.getHostRoute().add(hostRoute);
                }
                subnet.setHostRoutes(hostRoutes);
                subnets.getSubnet().add(subnet);
            }
        }
        return subnets;
    }

}