// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.resourcemanager.managednetworkfabric.models;

import com.azure.core.annotation.Fluent;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;

/** staticRouteConfiguration model. */
@Fluent
public final class StaticRouteConfiguration {
    /*
     * BFD configuration properties
     */
    @JsonProperty(value = "bfdConfiguration")
    private BfdConfiguration bfdConfiguration;

    /*
     * List with object IPv4Routes.
     */
    @JsonProperty(value = "ipv4Routes")
    private List<StaticRouteProperties> ipv4Routes;

    /*
     * List with object IPv6Routes.
     */
    @JsonProperty(value = "ipv6Routes")
    private List<StaticRouteProperties> ipv6Routes;

    /** Creates an instance of StaticRouteConfiguration class. */
    public StaticRouteConfiguration() {
    }

    /**
     * Get the bfdConfiguration property: BFD configuration properties.
     *
     * @return the bfdConfiguration value.
     */
    public BfdConfiguration bfdConfiguration() {
        return this.bfdConfiguration;
    }

    /**
     * Set the bfdConfiguration property: BFD configuration properties.
     *
     * @param bfdConfiguration the bfdConfiguration value to set.
     * @return the StaticRouteConfiguration object itself.
     */
    public StaticRouteConfiguration withBfdConfiguration(BfdConfiguration bfdConfiguration) {
        this.bfdConfiguration = bfdConfiguration;
        return this;
    }

    /**
     * Get the ipv4Routes property: List with object IPv4Routes.
     *
     * @return the ipv4Routes value.
     */
    public List<StaticRouteProperties> ipv4Routes() {
        return this.ipv4Routes;
    }

    /**
     * Set the ipv4Routes property: List with object IPv4Routes.
     *
     * @param ipv4Routes the ipv4Routes value to set.
     * @return the StaticRouteConfiguration object itself.
     */
    public StaticRouteConfiguration withIpv4Routes(List<StaticRouteProperties> ipv4Routes) {
        this.ipv4Routes = ipv4Routes;
        return this;
    }

    /**
     * Get the ipv6Routes property: List with object IPv6Routes.
     *
     * @return the ipv6Routes value.
     */
    public List<StaticRouteProperties> ipv6Routes() {
        return this.ipv6Routes;
    }

    /**
     * Set the ipv6Routes property: List with object IPv6Routes.
     *
     * @param ipv6Routes the ipv6Routes value to set.
     * @return the StaticRouteConfiguration object itself.
     */
    public StaticRouteConfiguration withIpv6Routes(List<StaticRouteProperties> ipv6Routes) {
        this.ipv6Routes = ipv6Routes;
        return this;
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
        if (bfdConfiguration() != null) {
            bfdConfiguration().validate();
        }
        if (ipv4Routes() != null) {
            ipv4Routes().forEach(e -> e.validate());
        }
        if (ipv6Routes() != null) {
            ipv6Routes().forEach(e -> e.validate());
        }
    }
}
