use of com.microsoft.azure.management.network.DhcpOptions in project azure-sdk-for-java by Azure.
the class NetworksImpl method wrapModel.
// Fluent model create helpers
@Override
protected NetworkImpl wrapModel(String name) {
VirtualNetworkInner inner = new VirtualNetworkInner();
// Initialize address space
AddressSpace addressSpace = inner.addressSpace();
if (addressSpace == null) {
addressSpace = new AddressSpace();
inner.withAddressSpace(addressSpace);
}
if (addressSpace.addressPrefixes() == null) {
addressSpace.withAddressPrefixes(new ArrayList<String>());
}
// Initialize subnets
if (inner.subnets() == null) {
inner.withSubnets(new ArrayList<SubnetInner>());
}
// Initialize DHCP options (DNS servers)
DhcpOptions dhcp = inner.dhcpOptions();
if (dhcp == null) {
dhcp = new DhcpOptions();
inner.withDhcpOptions(dhcp);
}
if (dhcp.dnsServers() == null) {
dhcp.withDnsServers(new ArrayList<String>());
}
return new NetworkImpl(name, inner, super.manager());
}
Aggregations