org.gradle.api.internal.TestNamedProvider.groovy Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of gradle-test-kit Show documentation
Show all versions of gradle-test-kit Show documentation
Gradle 6.2.1 API redistribution.
/*
* Copyright 2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.gradle.api.internal
import org.gradle.api.Named
import org.gradle.api.Transformer
import org.gradle.api.internal.provider.ProviderInternal
import org.gradle.api.internal.provider.ValueSanitizer
import org.gradle.api.internal.tasks.TaskDependencyResolveContext
import org.gradle.api.provider.Provider
import org.gradle.api.specs.Spec
import org.gradle.internal.DisplayName
import java.util.function.BiFunction
class TestNamedProvider implements ProviderInternal, Named {
private final String name
private final T t
TestNamedProvider(String name, T t) {
this.name = name
this.t = t
}
@Override
String getName() {
return name
}
@Override
T get() {
return T
}
@Override
T getOrNull() {
return t
}
@Override
T getOrElse(T defaultValue) {
return t == null ? t : defaultValue
}
@Override
boolean isPresent() {
return t != null
}
@Override
Provider orElse(T t) {
throw new UnsupportedOperationException()
}
@Override
Provider orElse(Provider extends T> provider) {
throw new UnsupportedOperationException()
}
@Override
Provider forUseAtConfigurationTime() {
throw new UnsupportedOperationException()
}
@Override
Provider zip(Provider right, BiFunction super T, ? super U, ? extends R> combiner) {
throw new UnsupportedOperationException()
}
@Override
ValueProducer getProducer() {
throw new UnsupportedOperationException()
}
@Override
boolean calculatePresence(ValueConsumer consumer) {
throw new UnsupportedOperationException()
}
@Override
void visitDependencies(TaskDependencyResolveContext context) {
throw new UnsupportedOperationException()
}
@Override
Class getType() {
return t.class
}
@Override
ProviderInternal map(Transformer extends S, ? super T> transformer) {
throw new UnsupportedOperationException()
}
@Override
Value extends T> calculateValue(ValueConsumer consumer) {
Value.ofNullable(t)
}
@Override
ProviderInternal asSupplier(DisplayName owner, Class super T> targetType, ValueSanitizer super T> sanitizer) {
throw new UnsupportedOperationException()
}
@Override
ProviderInternal withFinalValue(ValueConsumer consumer) {
throw new UnsupportedOperationException()
}
@Override
ExecutionTimeValue extends T> calculateExecutionTimeValue() {
throw new UnsupportedOperationException()
}
@Override
Provider filter(Spec super T> spec) {
throw new UnsupportedOperationException()
}
@Override
Provider flatMap(Transformer extends Provider extends S>, ? super T> transformer) {
throw new UnsupportedOperationException()
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy