blob: 937ad53f38aa2dffac5ee440c9cf383276ac0e92 [file] [log] [blame]
// Copyright 2015 The Vanadium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package io.v.rx.syncbase;
import io.v.v23.verror.VException;
import rx.Observable;
public abstract class RxEntity<T, P> {
public abstract String getName();
public abstract Observable<T> getObservable();
public abstract T mapFrom(P parent) throws VException;
/**
* This is a shortcut for {@code getObservable().first()}, to reduce the likelihood of
* forgetting to filter by {@code first}. Most commands should be run in this way.
*/
public Observable<T> once() {
return getObservable().first();
}
}