
com.azure.resourcemanager.datafactory.models.MapperAttributeMappings Maven / Gradle / Ivy
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.
package com.azure.resourcemanager.datafactory.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;
/**
* Attribute mapping details.
*/
@Fluent
public final class MapperAttributeMappings implements JsonSerializable {
/*
* List of attribute mappings.
*/
private List attributeMappings;
/**
* Creates an instance of MapperAttributeMappings class.
*/
public MapperAttributeMappings() {
}
/**
* Get the attributeMappings property: List of attribute mappings.
*
* @return the attributeMappings value.
*/
public List attributeMappings() {
return this.attributeMappings;
}
/**
* Set the attributeMappings property: List of attribute mappings.
*
* @param attributeMappings the attributeMappings value to set.
* @return the MapperAttributeMappings object itself.
*/
public MapperAttributeMappings withAttributeMappings(List attributeMappings) {
this.attributeMappings = attributeMappings;
return this;
}
/**
* Validates the instance.
*
* @throws IllegalArgumentException thrown if the instance is not valid.
*/
public void validate() {
if (attributeMappings() != null) {
attributeMappings().forEach(e -> e.validate());
}
}
/**
* {@inheritDoc}
*/
@Override
public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
jsonWriter.writeStartObject();
jsonWriter.writeArrayField("attributeMappings", this.attributeMappings,
(writer, element) -> writer.writeJson(element));
return jsonWriter.writeEndObject();
}
/**
* Reads an instance of MapperAttributeMappings from the JsonReader.
*
* @param jsonReader The JsonReader being read.
* @return An instance of MapperAttributeMappings 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 MapperAttributeMappings.
*/
public static MapperAttributeMappings fromJson(JsonReader jsonReader) throws IOException {
return jsonReader.readObject(reader -> {
MapperAttributeMappings deserializedMapperAttributeMappings = new MapperAttributeMappings();
while (reader.nextToken() != JsonToken.END_OBJECT) {
String fieldName = reader.getFieldName();
reader.nextToken();
if ("attributeMappings".equals(fieldName)) {
List attributeMappings
= reader.readArray(reader1 -> MapperAttributeMapping.fromJson(reader1));
deserializedMapperAttributeMappings.attributeMappings = attributeMappings;
} else {
reader.skipChildren();
}
}
return deserializedMapperAttributeMappings;
});
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy