Introduction to Functional Interfaces – A concept recreated in Java 8
Any java developer around the world would have used at least one of the following interfaces: java.lang.Runnable, java.awt.event.ActionListener, java.util.Comparator, java.util.concurrent.Callable....
View ArticleFunction interface- A functional interface in the java.util.function package...
I had previously written about functional interfaces and their usage. If you are exploring the APIs to be part of Java 8 and especially those APIs which support lambda expressions you will find few...
View ArticlePredicate and Consumer Interface in java.util.function package in Java 8
In my previous post I wrote about Function interface which is part of java.util.package. I also mentioned about Predicate interface which is part of the same package and in this post I will show you...
View ArticleSupplier interface in java.util.function package in Java 8
In my previous posts I wrote about Predicate, Consumer and Function interfaces. In this post I will write about Supplier interface with which I will conclude the description of the interfaces in the...
View ArticleArrays.sort versus Arrays.parallelSort
We all have used Arrays.sort to sort objects and primitive arrays. This API used merge sort OR Tim Sort underneath to sort the contents as shown below: public static void sort(Object[] a) { if...
View ArticleBook review: Confessions of a Public Speaker
Who among us has never feared speaking in front of a crowd- no matter how large the crowd be? We all have felt the fear, few of us overcome the fear to emerge as great speakers and few of us under...
View ArticleFirst look at Learning Play! Framework 2
I have always wanted to learn and use Play Framework and there have been previous attempts which I have blogged before, but recently I have got an opportunity to review the latest book “Learning Play!...
View ArticleTemplate Method Pattern- Using Lambda Expressions, Default Methods
Template Method pattern is one of the 23 design patterns explained in the famous Design Patterns book by Erich Gamma, Richard Helm, Ralph Johnson and John Vlissides. The intent of this pattern is...
View ArticleA simple application of Lambda Expressions in Java 8
I have been trying to fit in lambda expressions in the code I write and this simple example is a consequence of the same. For those totally unaware of Lambda Expressions in Java, I would recommend them...
View ArticleConverting a List into comma separated value string in Java
We all have at least once in our coding life time done this: “Concatenate the elements of a List into a comma separated string”. And each time we have spent some time figuring out how to do it or...
View ArticleTrain Wreck Pattern – A much improved implementation in Java 8
Venkat Subramaniam at a talk today mentioned about Cascade Method pattern or Train Wreck pattern which looks something like: someObject.method1().method2().method3().finalResult() Few might associate...
View ArticleUnderstanding RowKeyIndex values in ADF TreeTable
For those working on ADF and using TreeTable or other Tabular components would have always wondered about this RowKey and lot of times many of the would have encountered the deadly NoSuchRowAvailable...
View ArticleRuntime Polymorphism in Java
Quite a long time back I had written about Overriding v/s Hiding. In this post I would like to explain in brief with examples about Runtime polymorphism in Java. This post should have been written...
View ArticleHow to show links in ADF Messages
In ADF we show popup/inline messages using af:messages tag or popup messages using af:document. The actual code which populates the message is: FacesMessage fMsg = new FacesMessage("Some Message");...
View ArticleBook review: The Object-Oriented Thought Process
If you were to ask me a book to understand the Object oriented concepts in a practical way- I will surely recommend “The Object Oriented Thought process”. These are some of the good things I found: the...
View ArticleHow to create ADF TreeTable programmatically?
Using ADF-BC to create ADF TreeTable is simple and straightforward, but doing the same without using ADF-BC involves a bit of work. Its not that its quite difficult but we would have to build the data...
View ArticleParsing XML using DOM, SAX and StAX Parser in Java
I happen to read through a chapter on XML parsing and building APIs in Java. And I tried out the different parser available on a sample XML. Then I thought of sharing it on my blog so that I can have a...
View ArticleParsing XML in Groovy using XmlSlurper
In my previous post I showed different ways in which we can parse XML document in Java. You must have noticed the code being too much verbose. Other JVM languages like Groovy, Scala provide much better...
View ArticleFactory Method pattern in Java
In my previous post about the Template Method pattern, I showed how one can leverage lambda expression and default methods. In this post I will explore about factory method pattern and see how one can...
View ArticleBook review: Core Java, Volume II–Advanced Features (9th Edition)
I always liked the approach Cay S. Horstmann takes in the examples in his Core Java books. He tries to follow good practices in all his examples which includes better naming convention, documentation...
View Article