private void isEmpty() { Observable.just(1,2,3).isEmpty().subscribe(new Action1<Boolean>() { @Override public void call(Boolean aBoolean) { Log.d(TAG, "isEmpty:"+aBoolean); } }); }
@Override public void run() { Observable.empty().isEmpty().subscribe(new Action1<Boolean>() { @Override public void call(Boolean aBoolean) { log(aBoolean); } }); } });
@Override public Observable<Boolean> hasBucket(final String name) { return getBucket(name) .isEmpty() .map(new Func1<Boolean, Boolean>() { @Override public Boolean call(Boolean notFound) { return !notFound; } }); }
@Override public Observable<DesignDocument> publishDesignDocument(final String name, final boolean overwrite) { return getDesignDocument(name, false) .onErrorResumeNext(new Func1<Throwable, Observable<? extends DesignDocument>>() { @Override public Observable<? extends DesignDocument> call(Throwable throwable) { if (throwable instanceof DesignDocumentDoesNotExistException) { return Observable.empty(); } else { return Observable.error(throwable); } } }).isEmpty() .flatMap(new Func1<Boolean, Observable<DesignDocument>>() { @Override public Observable<DesignDocument> call(Boolean doesNotExist) { if (!doesNotExist && !overwrite) { return Observable.error(new DesignDocumentAlreadyExistsException("Document exists in " + "production and not overwriting.")); } return getDesignDocument(name, true); } }) .flatMap(new Func1<DesignDocument, Observable<DesignDocument>>() { @Override public Observable<DesignDocument> call(DesignDocument designDocument) { return upsertDesignDocument(designDocument); } }); }
@Override public Observable<DesignDocument> insertDesignDocument(final DesignDocument designDocument, final boolean development) { return getDesignDocument(designDocument.name(), development) .onErrorResumeNext(new Func1<Throwable, Observable<? extends DesignDocument>>() { @Override public Observable<? extends DesignDocument> call(Throwable throwable) { if (throwable instanceof DesignDocumentDoesNotExistException) { return Observable.empty(); } else { return Observable.error(throwable); } } }).isEmpty() .flatMap(new Func1<Boolean, Observable<DesignDocument>>() { @Override public Observable<DesignDocument> call(Boolean doesNotExist) { if (doesNotExist) { return upsertDesignDocument(designDocument, development); } else { return Observable.error(new DesignDocumentAlreadyExistsException()); } } }); }
log.debug("Trying to retrieve document from cache level {} : {} : ", i, cacheAdapter.getClass().getSimpleName(), cacheKey); result = cacheAdapter.get(cacheKey, options).cache(); if (!result.isEmpty().toBlocking().first()) { log.debug("Retrieved document from cache level {} : {} : {}", i, cacheAdapter.getClass().getSimpleName(), cacheKey); actualCacheAdapter = cacheAdapter;
@Override protected boolean isAllowed(final Position p) { return rtree.search(Geometries.point(p.getCoordinate(0), p.getCoordinate(1))).isEmpty().toBlocking().single(); }
observableResponse = preResponseObservable.isEmpty() .map( isEmptyResult -> handlePreResponse(
scheduledExecution.getJobDetails().getTrigger().getTriggerTime() > details.getTrigger().getTriggerTime()) .isEmpty() .map(isEmpty -> { if (isEmpty) {