You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@james.apache.org by GitBox <gi...@apache.org> on 2021/02/11 07:42:08 UTC

[GitHub] [james-project] chibenwa commented on pull request #110: JAMES-2382: Change the method name "hasAnnotatedProperty".

chibenwa commented on pull request #110:
URL: https://github.com/apache/james-project/pull/110#issuecomment-777255182


   Hello @ShangwenWang !
   
   Thanks for your interest on this topic.
   
   This class had been deprecated and removed, support for OSGI dropped.
   
   To answer you, I disagree with `find` and `get` being semantically the same. The end result is the same (you get results out of a query), but I would associate `get` with something effortless, while `find` would be more computational heavy (I can not get it easily so I need to search for it).
   
   Scala maps (https://www.scala-lang.org/api/current/scala/collection/Map.html) do rely on such a semantic difference:
   
   ```
    def getOrElse[V1 >: V](key: K, default: => V1): V1
   
   Returns the value associated with a key, or a default value if the key is not contained in the map.
   ```
   
   and
   
   ```
   def find(p: ((K, V)) => Boolean): Option[(K, V)]
   
   Finds the first element of the map satisfying a predicate, if any.
   
   (iterates on all values)
   ```
   
   My 2 cents,
   
   Benoit


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org
For additional commands, e-mail: notifications-help@james.apache.org