quark.PromiseFactory Maven / Gradle / Ivy
/* Quark 1.0.452 run at 2016-11-11 16:09:46.008093 */
package quark;
/**
* Create Promises and input their initial value. Should typically only be used by Quark standard library.
*/
public class PromiseFactory implements io.datawire.quark.runtime.QObject {
public static quark.reflect.Class quark_PromiseFactory_ref = datawire_mdk_md.Root.quark_PromiseFactory_md;
public Promise promise = null;
public PromiseFactory() {
(this).promise = new Promise();
}
/**
* Set the attached Promise's initial value.
*/
public void resolve(Object result) {
((this).promise)._resolve(result);
}
/**
* Set the attached Promise's initial value to an Error.
*/
public void reject(quark.error.Error err) {
((this).promise)._reject(err);
}
public String _getClass() {
return "quark.PromiseFactory";
}
public Object _getField(String name) {
if ((name)==("promise") || ((Object)(name) != null && ((Object) (name)).equals("promise"))) {
return (this).promise;
}
return null;
}
public void _setField(String name, Object value) {
if ((name)==("promise") || ((Object)(name) != null && ((Object) (name)).equals("promise"))) {
(this).promise = (Promise) (value);
}
}
}