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

com.bmuschko.gradle.docker.tasks.network.DockerExistingNetwork.groovy Maven / Gradle / Ivy

There is a newer version: 6.7.0
Show newest version
package com.bmuschko.gradle.docker.tasks.network

import com.bmuschko.gradle.docker.tasks.AbstractDockerRemoteApiTask
import groovy.transform.CompileStatic
import org.gradle.api.provider.Property
import org.gradle.api.provider.Provider
import org.gradle.api.tasks.Input

import java.util.concurrent.Callable

@CompileStatic
abstract class DockerExistingNetwork extends AbstractDockerRemoteApiTask {
    /**
     * The ID or name of the network to perform the operation on. The network for the provided ID has to be created first.
     */
    @Input
    final Property networkId = project.objects.property(String)

    /**
     * Sets the target network ID or name.
     *
     * @param networkId Network ID or name
     * @see #targetNetworkId(Callable)
     * @see #targetNetworkId(Provider)
     */
    void targetNetworkId(String networkId) {
        this.networkId.set(networkId)
    }

    /**
     * Sets the target network ID or name.
     *
     * @param networkId Network ID or name as Callable
     * @see #targetNetworkId(String)
     * @see #targetNetworkId(Provider)
     */
    void targetNetworkId(Callable networkId) {
        targetNetworkId(project.provider(networkId))
    }

    /**
     * Sets the target network ID or name.
     *
     * @param networkId Network ID or name as Provider
     * @see #targetNetworkId(String)
     * @see #targetNetworkId(Callable)
     */
    void targetNetworkId(Provider networkId) {
        this.networkId.set(networkId)
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy