dimanche 31 décembre 2017

About AbstractDocumentPattern

Hi I'm junior Java developer and I am studying design pattern.

In AbstractDocumentPattern, Document interface has 3 methods like below.

public interface Document {    
  Void put(String key, Object value);    
  Object get(String key);    
  <T> Stream<T> children(String key, Function<Map<String, Object>, T> constructor);
}

My question is that why children method needed?

Just Can't I add implementation like HasT?

I know AbstractDocumentPattern can have all type properties like String, number even subDocument. so I guess, children is specific method for subDocuments property. is it right?

Aucun commentaire:

Enregistrer un commentaire