
com.azure.resourcemanager.datafactory.models.MapperTableSchema 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;
/**
* Schema of a CDC table in terms of column names and their corresponding data types.
*/
@Fluent
public final class MapperTableSchema implements JsonSerializable {
/*
* Name of the column.
*/
private String name;
/*
* Data type of the column.
*/
private String dataType;
/**
* Creates an instance of MapperTableSchema class.
*/
public MapperTableSchema() {
}
/**
* Get the name property: Name of the column.
*
* @return the name value.
*/
public String name() {
return this.name;
}
/**
* Set the name property: Name of the column.
*
* @param name the name value to set.
* @return the MapperTableSchema object itself.
*/
public MapperTableSchema withName(String name) {
this.name = name;
return this;
}
/**
* Get the dataType property: Data type of the column.
*
* @return the dataType value.
*/
public String dataType() {
return this.dataType;
}
/**
* Set the dataType property: Data type of the column.
*
* @param dataType the dataType value to set.
* @return the MapperTableSchema object itself.
*/
public MapperTableSchema withDataType(String dataType) {
this.dataType = dataType;
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.writeStringField("name", this.name);
jsonWriter.writeStringField("dataType", this.dataType);
return jsonWriter.writeEndObject();
}
/**
* Reads an instance of MapperTableSchema from the JsonReader.
*
* @param jsonReader The JsonReader being read.
* @return An instance of MapperTableSchema 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 MapperTableSchema.
*/
public static MapperTableSchema fromJson(JsonReader jsonReader) throws IOException {
return jsonReader.readObject(reader -> {
MapperTableSchema deserializedMapperTableSchema = new MapperTableSchema();
while (reader.nextToken() != JsonToken.END_OBJECT) {
String fieldName = reader.getFieldName();
reader.nextToken();
if ("name".equals(fieldName)) {
deserializedMapperTableSchema.name = reader.getString();
} else if ("dataType".equals(fieldName)) {
deserializedMapperTableSchema.dataType = reader.getString();
} else {
reader.skipChildren();
}
}
return deserializedMapperTableSchema;
});
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy