baku-toolkit/lib/src/main/java/io/v/baku/toolkit/bind/ScalarBindingBuilder.java
/**
     * Constructs a two-way, bidirectional binding between a `String` in Syncbase and the text
     * of a {@link TextView}.
     *
     * Defaults:
     *
     * * {@link #defaultValue(Object) defaultValue}: `""`
     * * {@link #deleteValue(Object) deleteValue}: `null`
     * * {@link #coordinators(Iterable) coordinators}: {@link DeferReadOnWriteCoordinator}, and
     *   ensures that there is a {@link SuppressWriteOnReadCoordinator} somewhere in the chain,
     *   injecting it right above the `TextView` if absent.
     *
     * The coordination policy must end its read pipeline on the Android main thread.
     * <!-- todo(rosswang): provide a Coordinator that coerces this. -->
     *
     * If {@link BindingBuilder#subscriptionParent(CompositeSubscription) subscriptionParent} is
     * set, this method adds the generated binding to it.
     * <!-- todo(rosswang): produce a ScalarBinding, and allow mutable bindings. -->
     */
Constructs a two-way, bidirectional binding between a `String` in Syncbase and the text
of a  TextView.





The coordination policy must end its read pipeline on the Android main thread.
<!-- todo(rosswang): provide a Coordinator that coerces this.

If  BindingBuilder#subscriptionParent(CompositeSubscription) subscriptionParent is
set, this method adds the generated binding to it.
<!-- todo(rosswang): produce a ScalarBinding, and allow mutable bindings.
Constructs a two - way bidirectional binding between a ` String ` in Syncbase and the text of a TextView . The coordination policy must end its read pipeline on the Android main thread . <! -- todo ( rosswang ) : provide a Coordinator that coerces this . If BindingBuilder#subscriptionParent ( CompositeSubscription ) subscriptionParent is set this method adds the generated binding to it . <! -- todo ( rosswang ) : produce a ScalarBinding and allow mutable bindings .
public ScalarBindingBuilder<T> bindTo(final TextView textView) {
        @SuppressWarnings("unchecked")
        final ScalarBindingBuilder<String> t = (ScalarBindingBuilder<String>) this;
        TwoWayBinding<String> core = SyncbaseBindingTermini.bind(mBase.mRxTable,
                getKey(textView.getId()), String.class, t.getDefaultValue(""),
                (String) mDeleteValue, mBase.mOnError);
        boolean hasSuppressWriteOnRead = false;
        for (final CoordinatorChain<String> c : t.mCoordinators) {
            core = c.apply(core);
            if (core instanceof SuppressWriteOnReadCoordinator) {
                hasSuppressWriteOnRead = true;
            }
        }
        if (mCoordinators.isEmpty()) {
            core = new DeferReadOnWriteCoordinator<>(core);
        }
        if (!hasSuppressWriteOnRead) {
            core = new SuppressWriteOnReadCoordinator<>(core);
        }
        mBase.subscribe(TextViewBindingTermini.bind(textView, core, mBase.mOnError));
        return this;
    }
public ScalarBindingBuilder < T > bindTo ( final TextView textView ) { @ SuppressWarnings ( "unchecked" ) final ScalarBindingBuilder < String > t = ( ScalarBindingBuilder < String > ) this ; TwoWayBinding < String > core = SyncbaseBindingTermini . bind ( mBase . mRxTable , getKey ( textView . getId ( ) ) , String . class , t . getDefaultValue ( "" ) , ( String ) mDeleteValue , mBase . mOnError ) ; boolean hasSuppressWriteOnRead = false ; for ( final CoordinatorChain < String > c : t . mCoordinators ) { core = c . apply ( core ) ; if ( core instanceof SuppressWriteOnReadCoordinator ) { hasSuppressWriteOnRead = true ; } } if ( mCoordinators . isEmpty ( ) ) { core = new DeferReadOnWriteCoordinator < > ( core ) ; } if ( ! hasSuppressWriteOnRead ) { core = new SuppressWriteOnReadCoordinator < > ( core ) ; } mBase . subscribe ( TextViewBindingTermini . bind ( textView , core , mBase . mOnError ) ) ; return this ; }
Constructs a two-way, bidirectional binding between a `String` in Syncbase and the text
 of a {@link TextView}.
Constructs a two - way bidirectional binding between a ` String ` in Syncbase and the text of a { @link TextView } .