com.azure.resourcemanager.network.models.Parameter Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of azure-resourcemanager-network Show documentation
Show all versions of azure-resourcemanager-network Show documentation
This package contains Microsoft Azure Network Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt
The newest version!
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.
package com.azure.resourcemanager.network.models;
import com.azure.core.annotation.Fluent;
import com.azure.json.JsonReader;
import com.azure.json.JsonSerializable;
import com.azure.json.JsonToken;
import com.azure.json.JsonWriter;
import java.io.IOException;
import java.util.List;
/**
* Parameters for an Action.
*/
@Fluent
public final class Parameter implements JsonSerializable {
/*
* List of route prefixes.
*/
private List routePrefix;
/*
* List of BGP communities.
*/
private List community;
/*
* List of AS paths.
*/
private List asPath;
/**
* Creates an instance of Parameter class.
*/
public Parameter() {
}
/**
* Get the routePrefix property: List of route prefixes.
*
* @return the routePrefix value.
*/
public List routePrefix() {
return this.routePrefix;
}
/**
* Set the routePrefix property: List of route prefixes.
*
* @param routePrefix the routePrefix value to set.
* @return the Parameter object itself.
*/
public Parameter withRoutePrefix(List routePrefix) {
this.routePrefix = routePrefix;
return this;
}
/**
* Get the community property: List of BGP communities.
*
* @return the community value.
*/
public List community() {
return this.community;
}
/**
* Set the community property: List of BGP communities.
*
* @param community the community value to set.
* @return the Parameter object itself.
*/
public Parameter withCommunity(List community) {
this.community = community;
return this;
}
/**
* Get the asPath property: List of AS paths.
*
* @return the asPath value.
*/
public List asPath() {
return this.asPath;
}
/**
* Set the asPath property: List of AS paths.
*
* @param asPath the asPath value to set.
* @return the Parameter object itself.
*/
public Parameter withAsPath(List asPath) {
this.asPath = asPath;
return this;
}
/**
* Validates the instance.
*
* @throws IllegalArgumentException thrown if the instance is not valid.
*/
public void validate() {
}
/**
* {@inheritDoc}
*/
@Override
public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
jsonWriter.writeStartObject();
jsonWriter.writeArrayField("routePrefix", this.routePrefix, (writer, element) -> writer.writeString(element));
jsonWriter.writeArrayField("community", this.community, (writer, element) -> writer.writeString(element));
jsonWriter.writeArrayField("asPath", this.asPath, (writer, element) -> writer.writeString(element));
return jsonWriter.writeEndObject();
}
/**
* Reads an instance of Parameter from the JsonReader.
*
* @param jsonReader The JsonReader being read.
* @return An instance of Parameter if the JsonReader was pointing to an instance of it, or null if it was pointing
* to JSON null.
* @throws IOException If an error occurs while reading the Parameter.
*/
public static Parameter fromJson(JsonReader jsonReader) throws IOException {
return jsonReader.readObject(reader -> {
Parameter deserializedParameter = new Parameter();
while (reader.nextToken() != JsonToken.END_OBJECT) {
String fieldName = reader.getFieldName();
reader.nextToken();
if ("routePrefix".equals(fieldName)) {
List routePrefix = reader.readArray(reader1 -> reader1.getString());
deserializedParameter.routePrefix = routePrefix;
} else if ("community".equals(fieldName)) {
List community = reader.readArray(reader1 -> reader1.getString());
deserializedParameter.community = community;
} else if ("asPath".equals(fieldName)) {
List asPath = reader.readArray(reader1 -> reader1.getString());
deserializedParameter.asPath = asPath;
} else {
reader.skipChildren();
}
}
return deserializedParameter;
});
}
}