// 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.azure.core.util.logging.ClientLogger;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;

/** Static Route properties. */
@Fluent
public final class StaticRouteProperties {
    /*
     * IPv4 | IPv6 Prefix.
     */
    @JsonProperty(value = "prefix", required = true)
    private String prefix;

    /*
     * List of next hop IPv4 | IPv6 addresses.
     */
    @JsonProperty(value = "nextHop", required = true)
    private List<String> nextHop;

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

    /**
     * Get the prefix property: IPv4 | IPv6 Prefix.
     *
     * @return the prefix value.
     */
    public String prefix() {
        return this.prefix;
    }

    /**
     * Set the prefix property: IPv4 | IPv6 Prefix.
     *
     * @param prefix the prefix value to set.
     * @return the StaticRouteProperties object itself.
     */
    public StaticRouteProperties withPrefix(String prefix) {
        this.prefix = prefix;
        return this;
    }

    /**
     * Get the nextHop property: List of next hop IPv4 | IPv6 addresses.
     *
     * @return the nextHop value.
     */
    public List<String> nextHop() {
        return this.nextHop;
    }

    /**
     * Set the nextHop property: List of next hop IPv4 | IPv6 addresses.
     *
     * @param nextHop the nextHop value to set.
     * @return the StaticRouteProperties object itself.
     */
    public StaticRouteProperties withNextHop(List<String> nextHop) {
        this.nextHop = nextHop;
        return this;
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
        if (prefix() == null) {
            throw LOGGER
                .logExceptionAsError(
                    new IllegalArgumentException("Missing required property prefix in model StaticRouteProperties"));
        }
        if (nextHop() == null) {
            throw LOGGER
                .logExceptionAsError(
                    new IllegalArgumentException("Missing required property nextHop in model StaticRouteProperties"));
        }
    }

    private static final ClientLogger LOGGER = new ClientLogger(StaticRouteProperties.class);
}
