package io.quarkus.runtime;

/**
 * Represents a proxyable object that can be returned from a bytecode recorder,
 * and passed between recorders.
 *
 */
public class RuntimeValue<T> {

    private final T value;

    public RuntimeValue(T value) {
        this.value = value;
    }

    public RuntimeValue() {
        this.value = null;
    }

    public T getValue() {
        if (value == null) {
            throw new IllegalStateException("Cannot call getValue() at deployment time");
        }
        return value;
    }
}

@@ -22,16 +22,43 @@
 ntime;%0A%0A
+import java.util.Objects;%0A%0A
 /**%0A * R
@@ -264,24 +264,63 @@
 (T value) %7B%0A
+        Objects.requireNonNull(value);%0A
         this

Throw an error if a null RuntimeValue is created