
com.azure.resourcemanager.datafactory.models.MapperConnectionReference 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;
/**
* Source or target connection reference details.
*/
@Fluent
public final class MapperConnectionReference implements JsonSerializable {
/*
* Name of the connection
*/
private String connectionName;
/*
* Type of connection via linked service or dataset.
*/
private ConnectionType type;
/**
* Creates an instance of MapperConnectionReference class.
*/
public MapperConnectionReference() {
}
/**
* Get the connectionName property: Name of the connection.
*
* @return the connectionName value.
*/
public String connectionName() {
return this.connectionName;
}
/**
* Set the connectionName property: Name of the connection.
*
* @param connectionName the connectionName value to set.
* @return the MapperConnectionReference object itself.
*/
public MapperConnectionReference withConnectionName(String connectionName) {
this.connectionName = connectionName;
return this;
}
/**
* Get the type property: Type of connection via linked service or dataset.
*
* @return the type value.
*/
public ConnectionType type() {
return this.type;
}
/**
* Set the type property: Type of connection via linked service or dataset.
*
* @param type the type value to set.
* @return the MapperConnectionReference object itself.
*/
public MapperConnectionReference withType(ConnectionType type) {
this.type = type;
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("connectionName", this.connectionName);
jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString());
return jsonWriter.writeEndObject();
}
/**
* Reads an instance of MapperConnectionReference from the JsonReader.
*
* @param jsonReader The JsonReader being read.
* @return An instance of MapperConnectionReference 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 MapperConnectionReference.
*/
public static MapperConnectionReference fromJson(JsonReader jsonReader) throws IOException {
return jsonReader.readObject(reader -> {
MapperConnectionReference deserializedMapperConnectionReference = new MapperConnectionReference();
while (reader.nextToken() != JsonToken.END_OBJECT) {
String fieldName = reader.getFieldName();
reader.nextToken();
if ("connectionName".equals(fieldName)) {
deserializedMapperConnectionReference.connectionName = reader.getString();
} else if ("type".equals(fieldName)) {
deserializedMapperConnectionReference.type = ConnectionType.fromString(reader.getString());
} else {
reader.skipChildren();
}
}
return deserializedMapperConnectionReference;
});
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy