mardi 10 avril 2018

Create Chain of Responsibility with Java 8

I have a test task. I have to create Chain of Responsibility for searching files in file system. For example one unit must check file for name and other one check file for size range.

If I use java8 Predicate like that:

  1. define factory methods for unit of chain which return predicate.
  2. combine predicates with 'and'
  3. start chain.

In this case, can I say that it is a Chain of Responsibility?

Aucun commentaire:

Enregistrer un commentaire