All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.jclouds.azurecompute.arm.domain.loadbalancer.LoadBalancerProperties Maven / Gradle / Ivy

The newest version!
/*
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.jclouds.azurecompute.arm.domain.loadbalancer;

import java.util.List;

import org.jclouds.azurecompute.arm.domain.BackendAddressPool;
import org.jclouds.azurecompute.arm.domain.FrontendIPConfigurations;
import org.jclouds.azurecompute.arm.domain.InboundNatRule;
import org.jclouds.azurecompute.arm.domain.Probe;
import org.jclouds.azurecompute.arm.domain.Provisionable;
import org.jclouds.javax.annotation.Nullable;
import org.jclouds.json.SerializedNames;

import com.google.auto.value.AutoValue;
import shaded.com.google.common.collect.ImmutableList;

@AutoValue
public abstract class LoadBalancerProperties implements Provisionable {

   @Nullable
   public abstract List frontendIPConfigurations();

   @Nullable
   public abstract List backendAddressPools();

   @Nullable
   public abstract List loadBalancingRules();

   @Nullable
   public abstract List probes();

   @Nullable
   public abstract List inboundNatRules();

   @Nullable
   public abstract String resourceGuid();

   @Nullable
   public abstract String provisioningState();

   @SerializedNames({ "frontendIPConfigurations", "backendAddressPools", "loadBalancingRules", "probes",
         "inboundNatRules", "resourceGuid", "provisioningState" })
   public static LoadBalancerProperties create(final List frontendIPConfigurations,
         final List backendAddressPools, final List loadBalancingRules,
         final List probes, final List inboundNatRules, final String resourceGuid,
         final String provisioningState) {
      return builder().frontendIPConfigurations(frontendIPConfigurations)
            .backendAddressPools(backendAddressPools == null ? null : ImmutableList.copyOf(backendAddressPools))
            .loadBalancingRules(loadBalancingRules == null ? null : ImmutableList.copyOf(loadBalancingRules))
            .probes(probes == null ? null : ImmutableList.copyOf(probes))
            .inboundNatRules(inboundNatRules == null ? null : ImmutableList.copyOf(inboundNatRules))
            .resourceGuid(resourceGuid).provisioningState(provisioningState).build();
   }

   public abstract Builder toBuilder();

   public static Builder builder() {
      return new AutoValue_LoadBalancerProperties.Builder();
   }

   @AutoValue.Builder
   public abstract static class Builder {
      public abstract Builder frontendIPConfigurations(List frontendIPConfigurations);

      public abstract Builder backendAddressPools(List backendAddressPools);

      public abstract Builder loadBalancingRules(List networkInterfaces);

      public abstract Builder probes(List probes);

      public abstract Builder inboundNatRules(List inboundNatRules);

      public abstract Builder resourceGuid(String resourceGuid);

      public abstract Builder provisioningState(String provisioningState);

      abstract List frontendIPConfigurations();

      abstract List backendAddressPools();

      abstract List loadBalancingRules();

      abstract List probes();

      abstract List inboundNatRules();

      abstract LoadBalancerProperties autoBuild();

      public LoadBalancerProperties build() {
         frontendIPConfigurations(frontendIPConfigurations() != null ? ImmutableList.copyOf(frontendIPConfigurations())
               : null);
         backendAddressPools(backendAddressPools() != null ? ImmutableList.copyOf(backendAddressPools()) : null);
         loadBalancingRules(loadBalancingRules() != null ? ImmutableList.copyOf(loadBalancingRules()) : null);
         probes(probes() != null ? ImmutableList.copyOf(probes()) : null);
         inboundNatRules(inboundNatRules() != null ? ImmutableList.copyOf(inboundNatRules()) : null);
         return autoBuild();
      }
   }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy