jclouds-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ignasi Barrera <notificati...@github.com>
Subject Re: [jclouds/jclouds-labs] JCLOUDS-1342 : Azure-ARM Virtual Machine Scale Set Support (#412)
Date Fri, 03 Nov 2017 11:22:35 GMT
nacx commented on this pull request.



> +   /**
+    * The private IP address version of the Virtual Machine Scale Set Ip Configuration Properties
+    */
+   @Nullable
+   public abstract String privateIPAddressVersion();
+
+   /**
+    * The load balancer backend address pools of the Virtual Machine Scale Set Ip Configuration
Properties
+    */
+   @Nullable
+   public abstract List<IdReference> loadBalancerBackendAddressPools();
+
+   /**
+    * The load balancer inbound nat pools of the Virtual Machine Scale Set Ip Configuration
Properties
+    */
+   @Nullable

Oh, I see. Then I'd recommend changing the builder to properly enforce an present value and
default to an empty list. You could use the pattern used in this diff:
```diff
diff --git a/azurecompute-arm/src/main/java/org/jclouds/azurecompute/arm/domain/VirtualMachineScaleSetIpConfigurationProperties.java
b/azurecompute-arm/src/main/java/org/jclouds/azurecompute/arm/domain/VirtualMachineScaleSetIpConfigurationProperties.java
index 528594063..8fc0e72c6 100644
--- a/azurecompute-arm/src/main/java/org/jclouds/azurecompute/arm/domain/VirtualMachineScaleSetIpConfigurationProperties.java
+++ b/azurecompute-arm/src/main/java/org/jclouds/azurecompute/arm/domain/VirtualMachineScaleSetIpConfigurationProperties.java
@@ -46,13 +46,11 @@ public abstract class VirtualMachineScaleSetIpConfigurationProperties
{
    /**
     * The load balancer backend address pools of the Virtual Machine Scale Set Ip Configuration
Properties
     */
-   @Nullable
    public abstract List<IdReference> loadBalancerBackendAddressPools();

    /**
     * The load balancer inbound nat pools of the Virtual Machine Scale Set Ip Configuration
Properties
     */
-   @Nullable
    public abstract List<IdReference> loadBalancerInboundNatPools();

    /**
@@ -72,13 +70,12 @@ public abstract class VirtualMachineScaleSetIpConfigurationProperties
{
       final String applicationGatewayBackendAddressPools)

    {
-
       return builder()
          .publicIPAddressConfiguration(publicIPAddressConfiguration)
          .subnet(subnet)
          .privateIPAddressVersion(privateIPAddressVersion)
-         .loadBalancerBackendAddressPools(loadBalancerBackendAddressPools)
-         .loadBalancerInboundNatPools(loadBalancerInboundNatPools)
+         .lbBackendAddressPoolsA(loadBalancerBackendAddressPools)
+         .lbInboundNatPoolsA(loadBalancerInboundNatPools)
          .applicationGatewayBackendAddressPools(applicationGatewayBackendAddressPools)
          .build();
    }
@@ -86,7 +83,7 @@ public abstract class VirtualMachineScaleSetIpConfigurationProperties {
    public abstract Builder toBuilder();

    public static Builder builder() {
-      return new AutoValue_VirtualMachineScaleSetIpConfigurationProperties.Builder();
+      return new AutoValue_VirtualMachineScaleSetIpConfigurationProperties.Builder().lbBackendAddressPoolsA(null).lbInboundNatPoolsA(null);
    }

    @AutoValue.Builder
@@ -97,25 +94,23 @@ public abstract class VirtualMachineScaleSetIpConfigurationProperties
{

       public abstract Builder privateIPAddressVersion(String privateIPAddressVersion);

-      public abstract Builder loadBalancerBackendAddressPools(List<IdReference> loadBalancerBackendAddressPools);
-
-      public abstract Builder loadBalancerInboundNatPools(List<IdReference> loadBalancerInboundNatPools);
-
       public abstract Builder applicationGatewayBackendAddressPools(String applicationGatewayBackendAddressPools);
+
+      public Builder lbBackendAddressPoolsA(List<IdReference> loadBalancerBackendAddressPools)
{
+         return loadBalancerBackendAddressPools(loadBalancerBackendAddressPools != null ?
ImmutableList
+            .copyOf(loadBalancerBackendAddressPools) : ImmutableList.<IdReference>of());
+      }

-      abstract List<IdReference> loadBalancerBackendAddressPools();
-
-      abstract List<IdReference> loadBalancerInboundNatPools();
-
-      abstract VirtualMachineScaleSetIpConfigurationProperties autoBuild();
-
-      public VirtualMachineScaleSetIpConfigurationProperties build() {
-         loadBalancerBackendAddressPools(loadBalancerBackendAddressPools() != null ? ImmutableList
-            .copyOf(loadBalancerBackendAddressPools()) : ImmutableList.<IdReference>of());
-         loadBalancerInboundNatPools(loadBalancerInboundNatPools() != null ? ImmutableList
-            .copyOf(loadBalancerInboundNatPools()) : ImmutableList.<IdReference>of());
-         return autoBuild();
+      public Builder lbInboundNatPoolsA(List<IdReference> loadBalancerInboundNatPools)
{
+         return loadBalancerInboundNatPools(loadBalancerInboundNatPools != null ? ImmutableList
+               .copyOf(loadBalancerInboundNatPools) : ImmutableList.<IdReference> of());
       }
+
+      abstract Builder loadBalancerBackendAddressPools(List<IdReference> loadBalancerBackendAddressPools);
+
+      abstract Builder loadBalancerInboundNatPools(List<IdReference> loadBalancerInboundNatPools);
+
+      public abstract VirtualMachineScaleSetIpConfigurationProperties build();
    }
 }
```

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/412#discussion_r148758211
Mime
View raw message