All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.azure.resourcemanager.mongocluster.models.ConnectionString Maven / Gradle / Ivy

Go to download

This package contains Microsoft Azure SDK for Mongo Cluster Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. The Microsoft Azure management API provides create, read, update, and delete functionality for Azure Cosmos DB for MongoDB vCore resources including clusters and firewall rules.

The newest version!
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) TypeSpec Code Generator.

package com.azure.resourcemanager.mongocluster.models;

import com.azure.core.annotation.Immutable;
import com.azure.json.JsonReader;
import com.azure.json.JsonSerializable;
import com.azure.json.JsonToken;
import com.azure.json.JsonWriter;
import java.io.IOException;

/**
 * Connection string for the mongo cluster.
 */
@Immutable
public final class ConnectionString implements JsonSerializable {
    /*
     * Value of the connection string
     */
    private String connectionString;

    /*
     * Description of the connection string
     */
    private String description;

    /*
     * Name of the connection string.
     */
    private String name;

    /**
     * Creates an instance of ConnectionString class.
     */
    private ConnectionString() {
    }

    /**
     * Get the connectionString property: Value of the connection string.
     * 
     * @return the connectionString value.
     */
    public String connectionString() {
        return this.connectionString;
    }

    /**
     * Get the description property: Description of the connection string.
     * 
     * @return the description value.
     */
    public String description() {
        return this.description;
    }

    /**
     * Get the name property: Name of the connection string.
     * 
     * @return the name value.
     */
    public String name() {
        return this.name;
    }

    /**
     * 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();
        return jsonWriter.writeEndObject();
    }

    /**
     * Reads an instance of ConnectionString from the JsonReader.
     * 
     * @param jsonReader The JsonReader being read.
     * @return An instance of ConnectionString 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 ConnectionString.
     */
    public static ConnectionString fromJson(JsonReader jsonReader) throws IOException {
        return jsonReader.readObject(reader -> {
            ConnectionString deserializedConnectionString = new ConnectionString();
            while (reader.nextToken() != JsonToken.END_OBJECT) {
                String fieldName = reader.getFieldName();
                reader.nextToken();

                if ("connectionString".equals(fieldName)) {
                    deserializedConnectionString.connectionString = reader.getString();
                } else if ("description".equals(fieldName)) {
                    deserializedConnectionString.description = reader.getString();
                } else if ("name".equals(fieldName)) {
                    deserializedConnectionString.name = reader.getString();
                } else {
                    reader.skipChildren();
                }
            }

            return deserializedConnectionString;
        });
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy