Minor. Add isComputing to DeferredType
This commit is contained in:
@@ -77,6 +77,10 @@ public class DeferredType extends DelegatingType implements LazyType {
|
||||
this.lazyValue = lazyValue;
|
||||
}
|
||||
|
||||
public boolean isComputing() {
|
||||
return lazyValue.isComputing();
|
||||
}
|
||||
|
||||
public boolean isComputed() {
|
||||
return lazyValue.isComputed();
|
||||
}
|
||||
|
||||
@@ -286,6 +286,11 @@ public class LockBasedStorageManager implements StorageManager {
|
||||
return value != NotValue.NOT_COMPUTED && value != NotValue.COMPUTING;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isComputing() {
|
||||
return value == NotValue.COMPUTING;
|
||||
}
|
||||
|
||||
@Override
|
||||
public T invoke() {
|
||||
Object _value = value;
|
||||
|
||||
@@ -28,10 +28,12 @@ public interface MemoizedFunctionToNullable<P, R : Any> : Function1<P, R?> {
|
||||
|
||||
public interface NotNullLazyValue<T : Any> : Function0<T> {
|
||||
public fun isComputed(): Boolean
|
||||
public fun isComputing(): Boolean
|
||||
}
|
||||
|
||||
public interface NullableLazyValue<T : Any> : Function0<T?> {
|
||||
public fun isComputed(): Boolean
|
||||
public fun isComputing(): Boolean
|
||||
}
|
||||
|
||||
public operator fun <T : Any> NotNullLazyValue<T>.getValue(_this: Any?, p: KProperty<*>): T = invoke()
|
||||
|
||||
Reference in New Issue
Block a user