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

I followed the convention as used in
org.apache.jackrabbit.oak.api.PropertyState#GET_NAME. However I can
move it to TreeUtil also.

Chetan Mehrotra


On Fri, Aug 9, 2013 at 7:20 PM, Michael Dürig <mdue...@apache.org> wrote:
>
>
> On 7.8.13 12:05, chet...@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

Reply via email to