jackrabbit-oak-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Dürig <mdue...@apache.org>
Subject Re: svn commit: r1511233 - in /jackrabbit/oak/trunk/oak-core/src: main/java/org/apache/jackrabbit/oak/api/ main/java/org/apache/jackrabbit/oak/kernel/ main/java/org/apache/jackrabbit/oak/plugins/commit/ main/java/org/apache/jackrabbit/oak/plugins/nodetype/...
Date Fri, 09 Aug 2013 13:50:17 GMT


On 7.8.13 12:05, chetanm@apache.org wrote:
> Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/Tree.java
> URL:http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/Tree.java?rev=1511233&r1=1511232&r2=1511233&view=diff
> ==============================================================================
> --- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/Tree.java
(original)
> +++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/Tree.java
Wed Aug  7 10:05:37 2013
> @@ -18,6 +18,8 @@
>    */
>   package org.apache.jackrabbit.oak.api;
>
> +import com.google.common.base.Function;
> +
>   import javax.annotation.CheckForNull;
>   import javax.annotation.Nonnull;
>   import javax.annotation.Nullable;
> @@ -330,4 +332,19 @@ public interface Tree {
>        */
>       void removeProperty(@Nonnull String name);
>
> +    /**
> +     * Mapping from a Tree instance to its name.
> +     */
> +    Function<Tree, String> GET_NAME =
> +            new Function<Tree, String>() {
> +                @Override @Nullable
> +                public String apply(@Nullable Tree input) {
> +                    if (input != null) {
> +                        return input.getName();
> +                    } else {
> +                        return null;
> +                    }
> +                }
> +            };
> +
>   }

I'd rather not make this part of the Tree API. Shouldn't this better got 
into TreeUtil?

Michael

Mime
View raw message