protected boolean extractField(String field, NeutronL2gateway ans) {
switch (field) {
case "devices":
- List<NeutronL2gatewayDevice> devices = new ArrayList<NeutronL2gatewayDevice>();
+ List<NeutronL2gatewayDevice> devices = new ArrayList<>();
devices.addAll(this.getNeutronL2gatewayDevices());
ans.setNeutronL2gatewayDevices(devices);
break;
ans.setMacAddress(this.getMacAddress());
break;
case "fixed_ips":
- ans.setFixedIps(new ArrayList<NeutronIps>(this.getFixedIps()));
+ ans.setFixedIps(new ArrayList<>(this.getFixedIps()));
break;
case "device_id":
ans.setDeviceID(this.getDeviceID());
ans.setDeviceOwner(this.getDeviceOwner());
break;
case "security_groups":
- ans.setSecurityGroups(new ArrayList<NeutronSecurityGroup>(this.getSecurityGroups()));
+ ans.setSecurityGroups(new ArrayList<>(this.getSecurityGroups()));
break;
case "allowed_address_pairs":
ans.setAllowedAddressPairs(
- new ArrayList<NeutronPortAllowedAddressPairs>(this.getAllowedAddressPairs()));
+ new ArrayList<>(this.getAllowedAddressPairs()));
break;
case "binding:host_id":
ans.setBindinghostID(this.getBindinghostID());
ans.setBindingvifType(this.getBindingvifType());
break;
case "binding:vif_details":
- ans.setVIFDetails(new HashMap<String, String>(this.getVIFDetails()));
+ ans.setVIFDetails(new HashMap<>(this.getVIFDetails()));
break;
case "extra_dhcp_opts":
- ans.setExtraDHCPOptions(new ArrayList<NeutronPortExtraDHCPOption>(this.getExtraDHCPOptions()));
+ ans.setExtraDHCPOptions(new ArrayList<>(this.getExtraDHCPOptions()));
break;
case "port_security_enabled":
ans.setPortSecurityEnabled(this.getPortSecurityEnabled());
portSecurityEnabled = true;
}
if (fixedIps == null) {
- fixedIps = new ArrayList<NeutronIps>();
+ fixedIps = new ArrayList<>();
}
}
ans.setLogicalDestinationPortUUID(this.getLogicalDestinationPortUUID());
break;
case "l7_parameters":
- ans.setL7Parameters(new HashMap<String, String>(this.getL7Parameters()));
+ ans.setL7Parameters(new HashMap<>(this.getL7Parameters()));
break;
default:
return super.extractField(field, ans);
ans.setEgressPortUUID(this.getEgressPortUUID());
break;
case "service_function_parameters":
- ans.setServiceFunctionParameters(new HashMap<String, String>(this.getServiceFunctionParameters()));
+ ans.setServiceFunctionParameters(new HashMap<>(this.getServiceFunctionParameters()));
break;
default:
return super.extractField(field, ans);
ans.setGatewayIp(this.getGatewayIp());
break;
case "dns_nameservers":
- List<String> nsList = new ArrayList<String>();
+ List<String> nsList = new ArrayList<>();
nsList.addAll(this.getDnsNameservers());
ans.setDnsNameservers(nsList);
break;
case "allocation_pools":
- List<NeutronSubnetIpAllocationPool> pools = new ArrayList<NeutronSubnetIpAllocationPool>();
+ List<NeutronSubnetIpAllocationPool> pools = new ArrayList<>();
pools.addAll(this.getAllocationPools());
ans.setAllocationPools(pools);
break;
case "host_routes":
- List<NeutronRoute> hostRoutes = new ArrayList<NeutronRoute>();
+ List<NeutronRoute> hostRoutes = new ArrayList<>();
hostRoutes.addAll(this.getHostRoutes());
ans.setHostRoutes(hostRoutes);
break;
ipVersion = IPV4_VERSION;
}
if (dnsNameservers == null) {
- dnsNameservers = new ArrayList<String>();
+ dnsNameservers = new ArrayList<>();
}
if (hostRoutes == null) {
- hostRoutes = new ArrayList<NeutronRoute>();
+ hostRoutes = new ArrayList<>();
}
if (allocationPools == null) {
- allocationPools = new ArrayList<NeutronSubnetIpAllocationPool>();
+ allocationPools = new ArrayList<>();
if (ipVersion == IPV4_VERSION) {
try {
SubnetUtils util = new SubnetUtils(cidr);
Class cls = schemaObject.getClass();
Class[] types = new Class[1];
types[0] = cls;
- Map<String, String> namespacePrefixMapper = new HashMap<String, String>(3);
+ Map<String, String> namespacePrefixMapper = new HashMap<>(3);
namespacePrefixMapper.put("router", "router");
namespacePrefixMapper.put("provider", "provider");
namespacePrefixMapper.put("binding", "binding");
- Map<String, Object> jaxbProperties = new HashMap<String, Object>(2);
+ Map<String, Object> jaxbProperties = new HashMap<>(2);
jaxbProperties.put(JAXBContextProperties.MEDIA_TYPE, "application/json");
jaxbProperties.put(JAXBContextProperties.JSON_INCLUDE_ROOT, false);
jaxbProperties.put(JAXBContextProperties.JSON_NAMESPACE_SEPARATOR, ':');
NeutronID neutronId = new NeutronID();
neutronId.setID("2f245a7b-0000-4f26-9cf9-9e82d248fda7");
- List<NeutronID> loadBalancerHealthMonitorPool = new ArrayList<NeutronID>();
+ List<NeutronID> loadBalancerHealthMonitorPool = new ArrayList<>();
loadBalancerHealthMonitorPool.add(neutronId);
testObject.setLoadBalancerHealthMonitorPools(loadBalancerHealthMonitorPool);
Assert.assertEquals("NeutronLoadBalancerHealthMonitor JAXB Test 11: Testing Pools failed",
NeutronSubnetIpAllocationPool allocationPool = new NeutronSubnetIpAllocationPool();
allocationPool.setPoolStart("10.18.0.2");
allocationPool.setPoolEnd("10.18.0.6");
- List<NeutronSubnetIpAllocationPool> pools = new ArrayList<NeutronSubnetIpAllocationPool>();
+ List<NeutronSubnetIpAllocationPool> pools = new ArrayList<>();
pools.add(allocationPool);
objectUT.setAllocationPools(pools);
allocationPool = new NeutronSubnetIpAllocationPool();
allocationPool.setPoolStart("2015::2");
allocationPool.setPoolEnd("2015::6");
- pools = new ArrayList<NeutronSubnetIpAllocationPool>();
+ pools = new ArrayList<>();
pools.add(allocationPool);
objectUT.setAllocationPools(pools);
NeutronSubnetIpAllocationPool allocationPool = new NeutronSubnetIpAllocationPool();
allocationPool.setPoolStart("10.18.0.2");
allocationPool.setPoolEnd("10.18.0.6");
- List<NeutronSubnetIpAllocationPool> pools = new ArrayList<NeutronSubnetIpAllocationPool>();
+ List<NeutronSubnetIpAllocationPool> pools = new ArrayList<>();
pools.add(allocationPool);
allocationPool = new NeutronSubnetIpAllocationPool();
allocationPool.setPoolStart("10.18.0.10");
allocationPool = new NeutronSubnetIpAllocationPool();
allocationPool.setPoolStart("2015::2");
allocationPool.setPoolEnd("2015::6");
- pools = new ArrayList<NeutronSubnetIpAllocationPool>();
+ pools = new ArrayList<>();
pools.add(allocationPool);
allocationPool = new NeutronSubnetIpAllocationPool();
allocationPool.setPoolStart("2015::10");
@Override
public Set<Class<?>> getClasses() {
- Set<Class<?>> classes = new HashSet<Class<?>>();
+ Set<Class<?>> classes = new HashSet<>();
// northbound URIs
classes.add(NeutronNetworksNorthbound.class);
classes.add(NeutronSubnetsNorthbound.class);
moxyJsonProvider.setMarshalEmptyCollections(true);
moxyJsonProvider.setValueWrapper("$");
- Map<String, String> namespacePrefixMapper = new HashMap<String, String>(HASHMAP_SIZE);
+ Map<String, String> namespacePrefixMapper = new HashMap<>(HASHMAP_SIZE);
// FIXME: fill in next two with XSD
namespacePrefixMapper.put("router", "router");
namespacePrefixMapper.put("provider", "provider");
moxyJsonProvider.setNamespacePrefixMapper(namespacePrefixMapper);
moxyJsonProvider.setNamespaceSeparator(':');
- Set<Object> set = new HashSet<Object>(1);
+ Set<Object> set = new HashSet<>(1);
set.add(moxyJsonProvider);
return set;
}
links.add(previous);
}
- return new PaginationResults<T>(collection, links);
+ return new PaginationResults<>(collection, links);
}
}
private List<S> getAll(ReadTransaction tx) {
Preconditions.checkNotNull(tx);
- final Set<S> allNeutronObjects = new HashSet<S>();
+ final Set<S> allNeutronObjects = new HashSet<>();
final U dataObjects = readMd(createInstanceIdentifier(), tx);
if (dataObjects != null) {
for (final T dataObject : getDataObjectList(dataObjects)) {
}
}
LOGGER.debug("Exiting _getAll, Found {} OpenStackFirewall", allNeutronObjects.size());
- final List<S> ans = new ArrayList<S>();
+ final List<S> ans = new ArrayList<>();
ans.addAll(allNeutronObjects);
return ans;
}
result.setTechnique(bgpvpn.getTechnique());
}
if (bgpvpn.getRouteTargets() != null) {
- final List<String> routeTargets = new ArrayList<String>();
+ final List<String> routeTargets = new ArrayList<>();
for (final String routeTarget : bgpvpn.getRouteTargets()) {
routeTargets.add(routeTarget);
}
result.setRouteTargets(routeTargets);
}
if (bgpvpn.getImportTargets() != null) {
- final List<String> importTargets = new ArrayList<String>();
+ final List<String> importTargets = new ArrayList<>();
for (final String importTarget : bgpvpn.getImportTargets()) {
importTargets.add(importTarget);
}
result.setImportTargets(importTargets);
}
if (bgpvpn.getExportTargets() != null) {
- final List<String> exportTargets = new ArrayList<String>();
+ final List<String> exportTargets = new ArrayList<>();
for (final String exportTarget : bgpvpn.getExportTargets()) {
exportTargets.add(exportTarget);
}
result.setExportTargets(exportTargets);
}
if (bgpvpn.getRouteDistinguishers() != null) {
- final List<String> routeDistinguishers = new ArrayList<String>();
+ final List<String> routeDistinguishers = new ArrayList<>();
for (final String routeDistinguisher : bgpvpn.getRouteDistinguishers()) {
routeDistinguishers.add(routeDistinguisher);
}
result.setRouteDistinguishers(routeDistinguishers);
}
if (bgpvpn.getRouters() != null) {
- final List<String> routers = new ArrayList<String>();
+ final List<String> routers = new ArrayList<>();
for (final Uuid router : bgpvpn.getRouters()) {
routers.add(router.getValue());
}
result.setRouters(routers);
}
if (bgpvpn.getNetworks() != null) {
- final List<String> networks = new ArrayList<String>();
+ final List<String> networks = new ArrayList<>();
for (final Uuid network : bgpvpn.getNetworks()) {
networks.add(network.getValue());
}
bgpvpnBuilder.setTechnique(bgpvpn.getTechnique());
}
if (bgpvpn.getRouteTargets() != null) {
- final List<String> routeTargets = new ArrayList<String>();
+ final List<String> routeTargets = new ArrayList<>();
for (final String routeTarget : bgpvpn.getRouteTargets()) {
routeTargets.add(routeTarget);
}
bgpvpnBuilder.setRouteTargets(routeTargets);
}
if (bgpvpn.getImportTargets() != null) {
- final List<String> importTargets = new ArrayList<String>();
+ final List<String> importTargets = new ArrayList<>();
for (final String importTarget : bgpvpn.getImportTargets()) {
importTargets.add(importTarget);
}
bgpvpnBuilder.setImportTargets(importTargets);
}
if (bgpvpn.getExportTargets() != null) {
- final List<String> exportTargets = new ArrayList<String>();
+ final List<String> exportTargets = new ArrayList<>();
for (final String exportTarget : bgpvpn.getExportTargets()) {
exportTargets.add(exportTarget);
}
bgpvpnBuilder.setExportTargets(exportTargets);
}
if (bgpvpn.getRouteDistinguishers() != null) {
- final List<String> routeDistinguishers = new ArrayList<String>();
+ final List<String> routeDistinguishers = new ArrayList<>();
for (final String routeDistinguisher : bgpvpn.getRouteDistinguishers()) {
routeDistinguishers.add(routeDistinguisher);
}
bgpvpnBuilder.setRouteDistinguishers(routeDistinguishers);
}
if (bgpvpn.getRouters() != null) {
- final List<Uuid> routers = new ArrayList<Uuid>();
+ final List<Uuid> routers = new ArrayList<>();
for (final String router : bgpvpn.getRouters()) {
routers.add(toUuid(router));
}
bgpvpnBuilder.setRouters(routers);
}
if (bgpvpn.getNetworks() != null) {
- final List<Uuid> networks = new ArrayList<Uuid>();
+ final List<Uuid> networks = new ArrayList<>();
for (final String network : bgpvpn.getNetworks()) {
networks.add(toUuid(network));
}
@Override
protected NeutronL2gateway fromMd(L2gateway l2gateway) {
final NeutronL2gateway result = new NeutronL2gateway();
- final List<NeutronL2gatewayDevice> neutronL2gatewayDevices = new ArrayList<NeutronL2gatewayDevice>();
+ final List<NeutronL2gatewayDevice> neutronL2gatewayDevices = new ArrayList<>();
if (l2gateway.getUuid() != null) {
result.setID(l2gateway.getUuid().getValue());
if (l2gateway.getDevices() != null) {
for (final Devices device : l2gateway.getDevices()) {
final NeutronL2gatewayDevice neutronL2gatewayDevice = new NeutronL2gatewayDevice();
- final List<NeutronL2gatewayDeviceInterface> neutronL2gatewayDeviceInterfaces = new ArrayList<
- NeutronL2gatewayDeviceInterface>();
+ final List<NeutronL2gatewayDeviceInterface> neutronL2gatewayDeviceInterfaces = new ArrayList<>();
if (device.getDeviceName() != null) {
neutronL2gatewayDevice.setDeviceName(device.getDeviceName().toString());
}
final NeutronL2gatewayDeviceInterface neutronL2gatewayDeviceInterface =
new NeutronL2gatewayDeviceInterface();
String interfaceName = null;
- final List<Integer> segmentationIds = new ArrayList<Integer>();
+ final List<Integer> segmentationIds = new ArrayList<>();
if (deviceInterface.getInterfaceName() != null) {
interfaceName = deviceInterface.getInterfaceName().toString();
}
for (final NeutronL2gatewayDeviceInterface neutronL2gatewayDeviceInterface : neutronL2gatewayDevice
.getNeutronL2gatewayDeviceInterfaces()) {
final InterfacesBuilder interfacesBuilder = new InterfacesBuilder();
- final List<Integer> segmentIds = new ArrayList<Integer>();
+ final List<Integer> segmentIds = new ArrayList<>();
interfacesBuilder.setInterfaceName(neutronL2gatewayDeviceInterface.getInterfaceName());
if (neutronL2gatewayDeviceInterface.getSegmentationId() != null) {
for (final Integer segmentationId : neutronL2gatewayDeviceInterface.getSegmentationId()) {
healthmonitorBuilder.setMaxRetries(Integer.valueOf(healthMonitor.getLoadBalancerHealthMonitorMaxRetries()));
}
if (healthMonitor.getLoadBalancerHealthMonitorPools() != null) {
- final List<Uuid> listUuid = new ArrayList<Uuid>();
+ final List<Uuid> listUuid = new ArrayList<>();
for (final NeutronID neutronId : healthMonitor.getLoadBalancerHealthMonitorPools()) {
listUuid.add(toUuid(neutronId.getID()));
}
answer.setLoadBalancerHealthMonitorMaxRetries(Integer.valueOf(healthMonitor.getMaxRetries()));
}
if (healthMonitor.getPools() != null) {
- final List<NeutronID> list = new ArrayList<NeutronID>();
+ final List<NeutronID> list = new ArrayList<>();
for (final Uuid id : healthMonitor.getPools()) {
list.add(new NeutronID(id.getValue()));
}
listenerBuilder.setDefaultPoolId(toUuid(listener.getNeutronLoadBalancerListenerDefaultPoolID()));
}
if (listener.getNeutronLoadBalancerListenerLoadBalancerIDs() != null) {
- final List<Uuid> listLoadBalancers = new ArrayList<Uuid>();
+ final List<Uuid> listLoadBalancers = new ArrayList<>();
for (final NeutronID neutronId : listener.getNeutronLoadBalancerListenerLoadBalancerIDs()) {
listLoadBalancers.add(toUuid(neutronId.getID()));
}
answer.setNeutronLoadBalancerListenerDefaultPoolID(listener.getDefaultPoolId().getValue());
}
if (listener.getLoadbalancers() != null) {
- final List<NeutronID> list = new ArrayList<NeutronID>();
+ final List<NeutronID> list = new ArrayList<>();
for (final Uuid id : listener.getLoadbalancers()) {
list.add(new NeutronID(id.getValue()));
}
poolBuilder.setLbAlgorithm(pool.getLoadBalancerPoolLbAlgorithm());
}
if (pool.getLoadBalancerPoolListeners() != null) {
- final List<Uuid> listListener = new ArrayList<Uuid>();
+ final List<Uuid> listListener = new ArrayList<>();
for (final NeutronID neutronId : pool.getLoadBalancerPoolListeners()) {
listListener.add(toUuid(neutronId.getID()));
}
answer.setLoadBalancerPoolLbAlgorithm(pool.getLbAlgorithm());
}
if (pool.getListeners() != null) {
- final List<NeutronID> ids = new ArrayList<NeutronID>();
+ final List<NeutronID> ids = new ArrayList<>();
for (final Uuid id : pool.getListeners()) {
ids.add(new NeutronID(id.getValue()));
}
answer.setLoadBalancerPoolListeners(ids);
}
if (pool.getMembers() != null) {
- final List<NeutronLoadBalancerPoolMember> members = new ArrayList<NeutronLoadBalancerPoolMember>();
+ final List<NeutronLoadBalancerPoolMember> members = new ArrayList<>();
for (final Member member : pool.getMembers().getMember()) {
members.add(fromMemberMd(member));
}
}
public List<NeutronLoadBalancerPoolMember> getAllNeutronLoadBalancerPoolMembers(String poolUuid) {
- final Set<NeutronLoadBalancerPoolMember> allLoadBalancerPoolMembers = new HashSet<
- NeutronLoadBalancerPoolMember>();
+ final Set<NeutronLoadBalancerPoolMember> allLoadBalancerPoolMembers = new HashSet<>();
final Members members = readMd(createMembersInstanceIdentifier(toMd(poolUuid)));
if (members != null) {
for (final Member member : members.getMember()) {
}
LOGGER.debug("Exiting getLoadBalancerPoolMembers, Found {} OpenStackLoadBalancerPoolMember",
allLoadBalancerPoolMembers.size());
- final List<NeutronLoadBalancerPoolMember> ans = new ArrayList<NeutronLoadBalancerPoolMember>();
+ final List<NeutronLoadBalancerPoolMember> ans = new ArrayList<>();
ans.addAll(allLoadBalancerPoolMembers);
return ans;
}
result.setProviderPhysicalNetwork(providerExtension.getPhysicalNetwork());
result.setProviderSegmentationID(providerExtension.getSegmentationId());
result.setProviderNetworkType(NETWORK_MAP.get(providerExtension.getNetworkType()));
- final List<NeutronNetworkSegment> segments = new ArrayList<NeutronNetworkSegment>();
+ final List<NeutronNetworkSegment> segments = new ArrayList<>();
if (providerExtension.getSegments() != null) {
for (final Segments segment : providerExtension.getSegments()) {
final NeutronNetworkSegment neutronSegment = new NeutronNetworkSegment();
final NeutronPort result = new NeutronPort();
fromMdAdminAttributes(port, result);
if (port.getAllowedAddressPairs() != null) {
- final List<NeutronPortAllowedAddressPairs> pairs = new ArrayList<NeutronPortAllowedAddressPairs>();
+ final List<NeutronPortAllowedAddressPairs> pairs = new ArrayList<>();
for (final AllowedAddressPairs mdPair : port.getAllowedAddressPairs()) {
final NeutronPortAllowedAddressPairs pair = new NeutronPortAllowedAddressPairs();
pair.setIpAddress(String.valueOf(mdPair.getIpAddress().getValue()));
result.setDeviceID(port.getDeviceId());
result.setDeviceOwner(port.getDeviceOwner());
if (port.getExtraDhcpOpts() != null) {
- final List<NeutronPortExtraDHCPOption> options = new ArrayList<NeutronPortExtraDHCPOption>();
+ final List<NeutronPortExtraDHCPOption> options = new ArrayList<>();
for (final ExtraDhcpOpts opt : port.getExtraDhcpOpts()) {
final NeutronPortExtraDHCPOption arg = new NeutronPortExtraDHCPOption();
arg.setName(opt.getOptName());
result.setExtraDHCPOptions(options);
}
if (port.getFixedIps() != null) {
- final List<NeutronIps> ips = new ArrayList<NeutronIps>();
+ final List<NeutronIps> ips = new ArrayList<>();
for (final FixedIps mdIp : port.getFixedIps()) {
final NeutronIps ip = new NeutronIps();
ip.setIpAddress(String.valueOf(mdIp.getIpAddress().getValue()));
result.setMacAddress(port.getMacAddress().getValue());
result.setNetworkUUID(String.valueOf(port.getNetworkId().getValue()));
if (port.getSecurityGroups() != null) {
- final Set<NeutronSecurityGroup> allGroups = new HashSet<NeutronSecurityGroup>();
+ final Set<NeutronSecurityGroup> allGroups = new HashSet<>();
for (final Uuid sgUuid : port.getSecurityGroups()) {
final NeutronSecurityGroup sg = new NeutronSecurityGroup();
sg.setID(sgUuid.getValue());
allGroups.add(sg);
}
- final List<NeutronSecurityGroup> groups = new ArrayList<NeutronSecurityGroup>();
+ final List<NeutronSecurityGroup> groups = new ArrayList<>();
groups.addAll(allGroups);
result.setSecurityGroups(groups);
}
portBuilder.setNetworkId(toUuid(neutronPort.getNetworkUUID()));
}
if (neutronPort.getSecurityGroups() != null) {
- final List<Uuid> listSecurityGroups = new ArrayList<Uuid>();
+ final List<Uuid> listSecurityGroups = new ArrayList<>();
for (final NeutronSecurityGroup neutronSecurityGroup : neutronPort.getSecurityGroups()) {
listSecurityGroups.add(toUuid(neutronSecurityGroup.getID()));
}
}
if (router.getExternalGatewayInfo() != null) {
ExternalGatewayInfo externalGatewayInfo = null;
- final List<NeutronRouterNetworkReference> neutronRouterNetworkReferences = new ArrayList<
- NeutronRouterNetworkReference>();
+ final List<NeutronRouterNetworkReference> neutronRouterNetworkReferences = new ArrayList<>();
neutronRouterNetworkReferences.add(router.getExternalGatewayInfo());
for (final NeutronRouterNetworkReference externalGatewayInfos : neutronRouterNetworkReferences) {
final ExternalGatewayInfoBuilder builder = new ExternalGatewayInfoBuilder();
result.setGatewayPortId(String.valueOf(router.getGatewayPortId().getValue()));
}
if (router.getRoutes() != null) {
- final List<NeutronRoute> routes = new ArrayList<NeutronRoute>();
+ final List<NeutronRoute> routes = new ArrayList<>();
for (final Routes route : router.getRoutes()) {
final NeutronRoute routerRoute = new NeutronRoute();
routerRoute.setDestination(String.valueOf(route.getDestination().getValue()));
extGwInfo.setNetworkID(String.valueOf(router.getExternalGatewayInfo().getExternalNetworkId().getValue()));
extGwInfo.setEnableSNAT(router.getExternalGatewayInfo().isEnableSnat());
if (router.getExternalGatewayInfo().getExternalFixedIps() != null) {
- final List<NeutronIps> fixedIps = new ArrayList<NeutronIps>();
+ final List<NeutronIps> fixedIps = new ArrayList<>();
for (final ExternalFixedIps mdFixedIp : router.getExternalGatewayInfo().getExternalFixedIps()) {
final NeutronIps fixedIp = new NeutronIps();
fixedIp.setSubnetUUID(String.valueOf(mdFixedIp.getSubnetId().getValue()));
}
result.setEnableDHCP(subnet.isEnableDhcp());
if (subnet.getAllocationPools() != null) {
- final List<NeutronSubnetIpAllocationPool> allocationPools = new ArrayList<NeutronSubnetIpAllocationPool>();
+ final List<NeutronSubnetIpAllocationPool> allocationPools = new ArrayList<>();
for (final AllocationPools allocationPool : subnet.getAllocationPools()) {
final NeutronSubnetIpAllocationPool pool = new NeutronSubnetIpAllocationPool();
pool.setPoolStart(String.valueOf(allocationPool.getStart().getValue()));
result.setAllocationPools(allocationPools);
}
if (subnet.getDnsNameservers() != null) {
- final List<String> dnsNameServers = new ArrayList<String>();
+ final List<String> dnsNameServers = new ArrayList<>();
for (final IpAddress dnsNameServer : subnet.getDnsNameservers()) {
dnsNameServers.add(String.valueOf(dnsNameServer.getValue()));
}
result.setDnsNameservers(dnsNameServers);
}
if (subnet.getHostRoutes() != null) {
- final List<NeutronRoute> hostRoutes = new ArrayList<NeutronRoute>();
+ final List<NeutronRoute> hostRoutes = new ArrayList<>();
for (final HostRoutes hostRoute : subnet.getHostRoutes()) {
final NeutronRoute nsHostRoute = new NeutronRoute();
nsHostRoute.setDestination(String.valueOf(hostRoute.getDestination().getValue()));
subnetBuilder.setAllocationPools(allocationPools);
}
if (subnet.getDnsNameservers() != null) {
- final List<IpAddress> dnsNameServers = new ArrayList<IpAddress>();
+ final List<IpAddress> dnsNameServers = new ArrayList<>();
for (final String dnsNameServer : subnet.getDnsNameservers()) {
final IpAddress ipAddress = new IpAddress(dnsNameServer.toCharArray());
dnsNameServers.add(ipAddress);
answer.setPeerAddress(ipsecSiteConnection.getPeerAddress());
}
if (ipsecSiteConnection.getPeerCidrs() != null) {
- final List<String> peerCidrs = new ArrayList<String>();
+ final List<String> peerCidrs = new ArrayList<>();
for (final String peerCidr : ipsecSiteConnection.getPeerCidrs()) {
peerCidrs.add(peerCidr);
}
ipsecSiteConnectionBuilder.setPeerAddress(ipsecSiteConnection.getPeerAddress());
}
if (ipsecSiteConnection.getPeerCidrs() != null) {
- final List<String> peerCidrs = new ArrayList<String>();
+ final List<String> peerCidrs = new ArrayList<>();
for (final String peerCidr : ipsecSiteConnection.getPeerCidrs()) {
peerCidrs.add(peerCidr);
}