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

com.azure.resourcemanager.eventhubs.implementation.NestedResourceImpl Maven / Gradle / Ivy

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

package com.azure.resourcemanager.eventhubs.implementation;

import com.azure.core.management.ProxyResource;
import com.azure.resourcemanager.eventhubs.EventHubsManager;
import com.azure.resourcemanager.resources.fluentcore.arm.models.HasManager;
import com.azure.resourcemanager.resources.fluentcore.model.Indexable;
import com.azure.resourcemanager.resources.fluentcore.model.implementation.CreatableUpdatableImpl;
import com.azure.resourcemanager.resources.fluentcore.model.implementation.IndexableRefreshableWrapperImpl;
import com.azure.resourcemanager.eventhubs.models.NestedResource;

/**
 *  The implementation for {@link NestedResource}.
 * (Internal use only)
 *
 * @param  the fluent model of the nested resource
 * @param  the inner model of the nested resource
 * @param  the fluent model implementation of the nested resource
 */
public abstract class NestedResourceImpl>
    extends CreatableUpdatableImpl
    implements HasManager, NestedResource {
    protected final EventHubsManager manager;

    NestedResourceImpl(final String name, final InnerModelT inner, EventHubsManager manager) {
        super(name, inner);
        this.manager = manager;
    }

    @Override
    public String id() {
        return this.innerModel().id();
    }

    @Override
    public String name() {
        if (this.innerModel().name() == null) {
            return super.name();
        } else {
            return this.innerModel().name();
        }
    }

    @Override
    public String type() {
        return this.innerModel().type();
    }

    @Override
    public boolean isInCreateMode() {
        return this.innerModel().id() == null;
    }

    @Override
    public EventHubsManager manager() {
        return this.manager;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy