jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r1334455 - in /jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak: api/Tree.java core/TreeImpl.java kernel/KernelNodeStateBuilder.java spi/state/NodeStateBuilder.java
Date Sat, 05 May 2012 17:28:57 GMT
Author: mduerig
Date: Sat May  5 17:28:57 2012
New Revision: 1334455

URL: http://svn.apache.org/viewvc?rev=1334455&view=rev
Log:
OAK-86: Make setProperty methods of NodeStateBuilder and Tree return the affected property

Modified:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/Tree.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/TreeImpl.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/KernelNodeStateBuilder.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/state/NodeStateBuilder.java

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=1334455&r1=1334454&r2=1334455&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 Sat
May  5 17:28:57 2012
@@ -182,16 +182,18 @@ public interface Tree {
      *
      * @param name The name of this property
      * @param value The value of this property
+     * @return the affected property state
      */
-    void setProperty(String name, CoreValue value);
+    PropertyState setProperty(String name, CoreValue value);
 
     /**
      * Set a multivalued valued property state
      *
      * @param name The name of this property
      * @param values The value of this property
+     * @return the affected property state
      */
-    void setProperty(String name, List<CoreValue> values);
+    PropertyState setProperty(String name, List<CoreValue> values);
 
     /**
      * Remove a property

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/TreeImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/TreeImpl.java?rev=1334455&r1=1334454&r2=1334455&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/TreeImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/TreeImpl.java
Sat May  5 17:28:57 2012
@@ -339,19 +339,21 @@ public class TreeImpl implements Tree {
     }
 
     @Override
-    public void setProperty(String name, CoreValue value) {
-        builder.setProperty(name, value);
+    public PropertyState setProperty(String name, CoreValue value) {
+        PropertyState property = builder.setProperty(name, value);
         if (listener != null) {
             listener.setProperty(this, name, value);
         }
+        return property;
     }
 
     @Override
-    public void setProperty(String name, List<CoreValue> values) {
-        builder.setProperty(name, values);
+    public PropertyState setProperty(String name, List<CoreValue> values) {
+        PropertyState property = builder.setProperty(name, values);
         if (listener != null) {
             listener.setProperty(this, name, values);
         }
+        return property;
     }
 
     @Override

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/KernelNodeStateBuilder.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/KernelNodeStateBuilder.java?rev=1334455&r1=1334454&r2=1334455&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/KernelNodeStateBuilder.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/KernelNodeStateBuilder.java
Sat May  5 17:28:57 2012
@@ -88,7 +88,7 @@ public class KernelNodeStateBuilder impl
     }
 
     @Override
-    public void setProperty(String name, CoreValue value) {
+    public PropertyState setProperty(String name, CoreValue value) {
         PropertyState property = new PropertyStateImpl(name, value);
         if (hasProperty(name)) {
             context.setProperty(property, path);
@@ -96,10 +96,11 @@ public class KernelNodeStateBuilder impl
         else {
             context.addProperty(property, path);
         }
+        return property;
     }
 
     @Override
-    public void setProperty(String name, List<CoreValue> values) {
+    public PropertyState setProperty(String name, List<CoreValue> values) {
         PropertyState property = new PropertyStateImpl(name, values);
         if (hasProperty(name)) {
             context.setProperty(property, path);
@@ -107,6 +108,7 @@ public class KernelNodeStateBuilder impl
         else {
             context.addProperty(property, path);
         }
+        return property;
     }
 
     @Override

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/state/NodeStateBuilder.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/state/NodeStateBuilder.java?rev=1334455&r1=1334454&r2=1334455&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/state/NodeStateBuilder.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/state/NodeStateBuilder.java
Sat May  5 17:28:57 2012
@@ -16,11 +16,11 @@
  */
 package org.apache.jackrabbit.oak.spi.state;
 
-import java.util.List;
-
 import org.apache.jackrabbit.oak.api.CoreValue;
 import org.apache.jackrabbit.oak.api.PropertyState;
 
+import java.util.List;
+
 /**
  * Builder interface for constructing new {@link NodeState node states}.
  */
@@ -71,10 +71,19 @@ public interface NodeStateBuilder {
      * Set a property.
      *
      * @param name property name
+     * @param value
+     * @return the affected property state
      */
-    void setProperty(String name, CoreValue values);
+    PropertyState setProperty(String name, CoreValue value);
 
-    void setProperty(String name, List<CoreValue> values);
+    /**
+     * Set a property.
+     *
+     * @param name property name
+     * @param values
+     * @return the affected property state
+     */
+    PropertyState setProperty(String name, List<CoreValue> values);
 
     /**
      * Remove the named property



Mime
View raw message