Parsing an HTML fragment as a body of new html document

In this post under Jsoup, I will explain with example how to parse a html fragment as a body of a new html document. Suppose you have a html fragment as shown below <a href=’wwww.google.com’/> Which you want as body of a new html document as shown below for your reference <html> <head></head> <body> <a…… Continue reading Parsing an HTML fragment as a body of new html document

Creating a Custom Cold Stateless Observable

In this post under RxJava, I will show with example how to create your own custom cold stateless Observable using “generate” method. The custom cold stateless Observable will not hold any state information that’s why I said stateless in the previous statement. Below is the syntax of generate method Syntax public static <T> @NonNull Observable<T>…… Continue reading Creating a Custom Cold Stateless Observable

Observable defer method

In this post under RxJava, I will show with example how to create an Observable instance with the help of Observable class’s static method “defer”. In all my previous post, we used to create an Observable instance immediately for example Observable<Long> observable = Observable.interval(500, TimeUnit.MILLISECONDS); When the above code snippet is executed, it creates an…… Continue reading Observable defer method

BiConsumer’s andThen Example

In this post under Java, we will explain with an example the andThen method under BiConsumer functional interface. BiConsumer’s andThen method is used to chain one BiConsumer interface implementation with one or more BiConsumer interface implementations. Lets consider an example. I have a list of TCS employees with the class structure as shown below TCSEmployee…… Continue reading BiConsumer’s andThen Example

Observable error and empty method

In this post under RxJava, I will introduce you to Observable class’s two static methods “error” and “empty” methods. The error method creates an Observable instance that will send the error thrown to the Observer/Subscriber. The empty method creates as Observable instance that will not send any item, it just generate completion event to the…… Continue reading Observable error and empty method