jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r1400898 [1/2] - in /jackrabbit/oak/trunk/oak-core/src: main/java/org/apache/jackrabbit/oak/api/ main/java/org/apache/jackrabbit/oak/core/ main/java/org/apache/jackrabbit/oak/plugins/identifier/ main/java/org/apache/jackrabbit/oak/plugins/m...
Date Mon, 22 Oct 2012 14:41:26 GMT
Author: mduerig
Date: Mon Oct 22 14:41:25 2012
New Revision: 1400898

URL: http://svn.apache.org/viewvc?rev=1400898&view=rev
Log:
OAK-380: Define conversion of property values
- Move static factory methods closer to the implementation
- Better name for multi valued properties

Added:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/MultiBinaryPropertyState.java   (contents, props changed)
      - copied, changed from r1400897, jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/BinariesPropertyState.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/MultiBooleanPropertyState.java   (contents, props changed)
      - copied, changed from r1400897, jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/BooleansPropertyState.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/MultiDecimalPropertyState.java   (contents, props changed)
      - copied, changed from r1400897, jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/DecimalsPropertyState.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/MultiDoublePropertyState.java   (contents, props changed)
      - copied, changed from r1400897, jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/DoublesPropertyState.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/MultiGenericPropertyState.java   (with props)
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/MultiLongPropertyState.java   (contents, props changed)
      - copied, changed from r1400897, jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/LongsPropertyState.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/MultiStringPropertyState.java   (contents, props changed)
      - copied, changed from r1400897, jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/StringsPropertyState.java
Removed:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/BinariesPropertyState.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/BooleansPropertyState.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/DecimalsPropertyState.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/DoublesPropertyState.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/GenericsPropertyState.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/LongsPropertyState.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/StringsPropertyState.java
Modified:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/CommitFailedException.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/plugins/identifier/IdentifierManager.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/BinaryPropertyState.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/BooleanPropertyState.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/DecimalPropertyState.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/DoublePropertyState.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/EmptyPropertyState.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/GenericPropertyState.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/LongPropertyState.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/MemoryPropertyBuilder.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/PropertyStates.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/StringPropertyState.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/value/ValueFactoryImpl.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/query/PropertyValues.java
    jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/core/TreeImplTest.java
    jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/kernel/JsopDiffTest.java
    jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/memory/MemoryNodeBuilderTest.java
    jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/memory/MemoryPropertyBuilderTest.java

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/CommitFailedException.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/CommitFailedException.java?rev=1400898&r1=1400897&r2=1400898&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/CommitFailedException.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/CommitFailedException.java Mon Oct 22 14:41:25 2012
@@ -65,7 +65,7 @@ public class CommitFailedException exten
             throw e;
         }
         else {
-            throw new RepositoryException(cause);
+            throw new RepositoryException(this);
         }
     }
 }

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=1400898&r1=1400897&r2=1400898&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 Mon Oct 22 14:41:25 2012
@@ -37,7 +37,7 @@ import org.apache.jackrabbit.oak.api.Typ
 import org.apache.jackrabbit.oak.commons.PathUtils;
 import org.apache.jackrabbit.oak.core.RootImpl.PurgeListener;
 import org.apache.jackrabbit.oak.plugins.memory.MemoryPropertyBuilder;
-import org.apache.jackrabbit.oak.plugins.memory.PropertyStates;
+import org.apache.jackrabbit.oak.plugins.memory.MultiStringPropertyState;
 import org.apache.jackrabbit.oak.spi.state.NodeBuilder;
 import org.apache.jackrabbit.oak.spi.state.NodeState;
 import org.apache.jackrabbit.oak.spi.state.NodeStateDiff;
@@ -359,9 +359,7 @@ public class TreeImpl implements Tree, P
             tail = Iterables.skip(filtered, idx);
         }
         // concatenate head, this name and tail
-        parent.getNodeBuilder().setProperty(PropertyStates.stringProperty(
-                OAK_CHILD_ORDER,
-                Iterables.concat(head, Collections.singleton(getName()), tail))
+        parent.getNodeBuilder().setProperty(MultiStringPropertyState.stringProperty(OAK_CHILD_ORDER, Iterables.concat(head, Collections.singleton(getName()), tail))
         );
         root.purge();
         return true;
@@ -574,9 +572,7 @@ public class TreeImpl implements Tree, P
         PropertyState childOrder = getNodeBuilder().getProperty(OAK_CHILD_ORDER);
         if (childOrder == null) {
             getNodeBuilder().setProperty(
-                    PropertyStates.stringProperty(
-                            OAK_CHILD_ORDER,
-                            getNodeBuilder().getChildNodeNames()));
+                    MultiStringPropertyState.stringProperty(OAK_CHILD_ORDER, getNodeBuilder().getChildNodeNames()));
         }
     }
 

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/identifier/IdentifierManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/identifier/IdentifierManager.java?rev=1400898&r1=1400897&r2=1400898&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/identifier/IdentifierManager.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/identifier/IdentifierManager.java Mon Oct 22 14:41:25 2012
@@ -42,7 +42,7 @@ import org.apache.jackrabbit.oak.api.Tre
 import org.apache.jackrabbit.oak.api.Type;
 import org.apache.jackrabbit.oak.commons.PathUtils;
 import org.apache.jackrabbit.oak.namepath.NamePathMapper;
-import org.apache.jackrabbit.oak.plugins.memory.PropertyStates;
+import org.apache.jackrabbit.oak.plugins.memory.StringPropertyState;
 import org.apache.jackrabbit.oak.spi.query.PropertyValues;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -280,7 +280,7 @@ public class IdentifierManager {
 
     @CheckForNull
     private String resolveUUID(String uuid) {
-        return resolveUUID(PropertyStates.stringProperty("", uuid));
+        return resolveUUID(StringPropertyState.stringProperty("", uuid));
     }
 
     private String resolveUUID(PropertyState uuid) {

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/BinaryPropertyState.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/BinaryPropertyState.java?rev=1400898&r1=1400897&r2=1400898&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/BinaryPropertyState.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/BinaryPropertyState.java Mon Oct 22 14:41:25 2012
@@ -16,7 +16,10 @@
  */
 package org.apache.jackrabbit.oak.plugins.memory;
 
+import javax.jcr.Value;
+
 import org.apache.jackrabbit.oak.api.Blob;
+import org.apache.jackrabbit.oak.api.PropertyState;
 import org.apache.jackrabbit.oak.api.Type;
 import org.apache.jackrabbit.oak.plugins.value.Conversions;
 import org.apache.jackrabbit.oak.plugins.value.Conversions.Converter;
@@ -29,6 +32,46 @@ public class BinaryPropertyState extends
         this.value = value;
     }
 
+    /**
+     * Create a {@code PropertyState} from an array of bytes.
+     * @param name  The name of the property state
+     * @param value  The value of the property state
+     * @return  The new property state of type {@link Type#BINARY}
+     */
+    public static PropertyState binaryProperty(String name, byte[] value) {
+        return new BinaryPropertyState(name, new ArrayBasedBlob(value));
+    }
+
+    /**
+     * Create a {@code PropertyState} from an array of bytes.
+     * @param name  The name of the property state
+     * @param value  The value of the property state
+     * @return  The new property state of type {@link Type#BINARY}
+     */
+    public static PropertyState binaryProperty(String name, String value) {
+        return new BinaryPropertyState(name, new StringBasedBlob(value));
+    }
+
+    /**
+     * Create a {@code PropertyState} from a {@link Blob}.
+     * @param name  The name of the property state
+     * @param value  The value of the property state
+     * @return  The new property state of type {@link Type#BINARY}
+     */
+    public static PropertyState binaryProperty(String name, Blob value) {
+        return new BinaryPropertyState(name, value);
+    }
+
+    /**
+     * Create a {@code PropertyState} from a {@link javax.jcr.Value}.
+     * @param name  The name of the property state
+     * @param value  The value of the property state
+     * @return  The new property state of type {@link Type#BINARY}
+     */
+    public static PropertyState binaryProperty(String name, Value value) {
+        return new BinaryPropertyState(name, new ValueBasedBlob(value));
+    }
+
     @Override
     public Blob getValue() {
         return value;

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/BooleanPropertyState.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/BooleanPropertyState.java?rev=1400898&r1=1400897&r2=1400898&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/BooleanPropertyState.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/BooleanPropertyState.java Mon Oct 22 14:41:25 2012
@@ -18,11 +18,12 @@
  */
 package org.apache.jackrabbit.oak.plugins.memory;
 
+import org.apache.jackrabbit.oak.api.PropertyState;
 import org.apache.jackrabbit.oak.api.Type;
 import org.apache.jackrabbit.oak.plugins.value.Conversions;
 import org.apache.jackrabbit.oak.plugins.value.Conversions.Converter;
 
-import static org.apache.jackrabbit.oak.api.Type.*;
+import static org.apache.jackrabbit.oak.api.Type.BOOLEAN;
 
 public class BooleanPropertyState extends SinglePropertyState<Boolean> {
     private final boolean value;
@@ -32,6 +33,16 @@ public class BooleanPropertyState extend
         this.value = value;
     }
 
+    /**
+     * Create a {@code PropertyState} from a boolean.
+     * @param name  The name of the property state
+     * @param value  The value of the property state
+     * @return  The new property state of type {@link Type#BOOLEAN}
+     */
+    public static PropertyState booleanProperty(String name, boolean value) {
+        return new BooleanPropertyState(name, value);
+    }
+
     @Override
     public Boolean getValue() {
         return value;

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/DecimalPropertyState.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/DecimalPropertyState.java?rev=1400898&r1=1400897&r2=1400898&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/DecimalPropertyState.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/DecimalPropertyState.java Mon Oct 22 14:41:25 2012
@@ -18,6 +18,7 @@ package org.apache.jackrabbit.oak.plugin
 
 import java.math.BigDecimal;
 
+import org.apache.jackrabbit.oak.api.PropertyState;
 import org.apache.jackrabbit.oak.api.Type;
 import org.apache.jackrabbit.oak.plugins.value.Conversions;
 import org.apache.jackrabbit.oak.plugins.value.Conversions.Converter;
@@ -32,6 +33,16 @@ public class DecimalPropertyState extend
         this.value = value;
     }
 
+    /**
+     * Create a {@code PropertyState} from a decimal.
+     * @param name  The name of the property state
+     * @param value  The value of the property state
+     * @return  The new property state of type {@link Type#DECIMAL}
+     */
+    public static PropertyState decimalProperty(String name, BigDecimal value) {
+        return new DecimalPropertyState(name, value);
+    }
+
     @Override
     public BigDecimal getValue() {
         return value;

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/DoublePropertyState.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/DoublePropertyState.java?rev=1400898&r1=1400897&r2=1400898&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/DoublePropertyState.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/DoublePropertyState.java Mon Oct 22 14:41:25 2012
@@ -18,6 +18,7 @@
  */
 package org.apache.jackrabbit.oak.plugins.memory;
 
+import org.apache.jackrabbit.oak.api.PropertyState;
 import org.apache.jackrabbit.oak.api.Type;
 import org.apache.jackrabbit.oak.plugins.value.Conversions;
 import org.apache.jackrabbit.oak.plugins.value.Conversions.Converter;
@@ -32,6 +33,16 @@ public class DoublePropertyState extends
         this.value = value;
     }
 
+    /**
+     * Create a {@code PropertyState} from a double.
+     * @param name  The name of the property state
+     * @param value  The value of the property state
+     * @return  The new property state of type {@link Type#DOUBLE}
+     */
+    public static PropertyState doubleProperty(String name, double value) {
+        return new DoublePropertyState(name, value);
+    }
+
     @Override
     public Double getValue() {
         return value;

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/EmptyPropertyState.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/EmptyPropertyState.java?rev=1400898&r1=1400897&r2=1400898&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/EmptyPropertyState.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/EmptyPropertyState.java Mon Oct 22 14:41:25 2012
@@ -48,6 +48,24 @@ public abstract class EmptyPropertyState
         this.name = name;
     }
 
+    /**
+     * Create an empty {@code PropertyState}
+     * @param name  The name of the property state
+     * @param type  The type of the property state
+     * @return  The new property state
+     */
+    public static PropertyState emptyProperty(String name, final Type<?> type) {
+        if (!type.isArray()) {
+            throw new IllegalArgumentException("Not an array type:" + type);
+        }
+        return new EmptyPropertyState(name) {
+            @Override
+            public Type<?> getType() {
+                return type;
+            }
+        };
+    }
+
     @Nonnull
     @Override
     public String getName() {

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/GenericPropertyState.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/GenericPropertyState.java?rev=1400898&r1=1400897&r2=1400898&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/GenericPropertyState.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/GenericPropertyState.java Mon Oct 22 14:41:25 2012
@@ -16,11 +16,17 @@
  */
 package org.apache.jackrabbit.oak.plugins.memory;
 
+import org.apache.jackrabbit.oak.api.PropertyState;
 import org.apache.jackrabbit.oak.api.Type;
 import org.apache.jackrabbit.oak.plugins.value.Conversions;
 import org.apache.jackrabbit.oak.plugins.value.Conversions.Converter;
 
 import static com.google.common.base.Preconditions.checkArgument;
+import static org.apache.jackrabbit.oak.api.Type.NAME;
+import static org.apache.jackrabbit.oak.api.Type.PATH;
+import static org.apache.jackrabbit.oak.api.Type.REFERENCE;
+import static org.apache.jackrabbit.oak.api.Type.URI;
+import static org.apache.jackrabbit.oak.api.Type.WEAKREFERENCE;
 
 public class GenericPropertyState extends SinglePropertyState<String> {
     private final String value;
@@ -36,6 +42,61 @@ public class GenericPropertyState extend
         this.type = type;
     }
 
+    /**
+     * Create a {@code PropertyState} from a name. No validation is performed
+     * on the string passed for {@code value}.
+     * @param name  The name of the property state
+     * @param value  The value of the property state
+     * @return  The new property state of type {@link Type#NAME}
+     */
+    public static PropertyState nameProperty(String name, String value) {
+        return new GenericPropertyState(name, value, NAME);
+    }
+
+    /**
+     * Create a {@code PropertyState} from a path. No validation is performed
+     * on the string passed for {@code value}.
+     * @param name  The name of the property state
+     * @param value  The value of the property state
+     * @return  The new property state of type {@link Type#PATH}
+     */
+    public static PropertyState pathProperty(String name, String value) {
+        return new GenericPropertyState(name, value, PATH);
+    }
+
+    /**
+     * Create a {@code PropertyState} from a reference. No validation is performed
+     * on the string passed for {@code value}.
+     * @param name  The name of the property state
+     * @param value  The value of the property state
+     * @return  The new property state of type {@link Type#REFERENCE}
+     */
+    public static PropertyState referenceProperty(String name, String value) {
+        return new GenericPropertyState(name, value, REFERENCE);
+    }
+
+    /**
+     * Create a {@code PropertyState} from a weak reference. No validation is performed
+     * on the string passed for {@code value}.
+     * @param name  The name of the property state
+     * @param value  The value of the property state
+     * @return  The new property state of type {@link Type#WEAKREFERENCE}
+     */
+    public static PropertyState weakreferenceProperty(String name, String value) {
+        return new GenericPropertyState(name, value, WEAKREFERENCE);
+    }
+
+    /**
+     * Create a {@code PropertyState} from a URI. No validation is performed
+     * on the string passed for {@code value}.
+     * @param name  The name of the property state
+     * @param value  The value of the property state
+     * @return  The new property state of type {@link Type#URI}
+     */
+    public static PropertyState uriProperty(String name, String value) {
+        return new GenericPropertyState(name, value, URI);
+    }
+
     @Override
     public String getValue() {
         return value;

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/LongPropertyState.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/LongPropertyState.java?rev=1400898&r1=1400897&r2=1400898&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/LongPropertyState.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/LongPropertyState.java Mon Oct 22 14:41:25 2012
@@ -20,6 +20,7 @@ package org.apache.jackrabbit.oak.plugin
 
 import java.util.Calendar;
 
+import org.apache.jackrabbit.oak.api.PropertyState;
 import org.apache.jackrabbit.oak.api.Type;
 import org.apache.jackrabbit.oak.plugins.value.Conversions;
 import org.apache.jackrabbit.oak.plugins.value.Conversions.Converter;
@@ -28,7 +29,7 @@ public class LongPropertyState extends S
     private final long value;
     private final Type<?> type;
 
-    private LongPropertyState(String name, long value, Type<?> type) {
+    public LongPropertyState(String name, long value, Type<?> type) {
         super(name);
         this.value = value;
         this.type = type;
@@ -40,7 +41,7 @@ public class LongPropertyState extends S
      * @param value  The value of the property state
      * @return  The new property state of type {@link Type#LONG}
      */
-    public static LongPropertyState createLongProperty(String name, long value) {
+    public static PropertyState createLongProperty(String name, long value) {
         return new LongPropertyState(name, value, Type.LONG);
     }
 
@@ -50,7 +51,7 @@ public class LongPropertyState extends S
      * @param value  The value of the property state
      * @return  The new property state of type {@link Type#DATE}
      */
-    public static LongPropertyState createDateProperty(String name, long value) {
+    public static PropertyState createDateProperty(String name, long value) {
         return new LongPropertyState(name, value, Type.DATE);
     }
 
@@ -60,7 +61,7 @@ public class LongPropertyState extends S
      * @param value  The value of the property state
      * @return  The new property state of type {@link Type#DATE}
      */
-    public static LongPropertyState createDateProperty(String name, Calendar value) {
+    public static PropertyState createDateProperty(String name, Calendar value) {
         return new LongPropertyState(name, Conversions.convert(value).toLong(), Type.DATE);
     }
 
@@ -71,7 +72,7 @@ public class LongPropertyState extends S
      * @return  The new property state of type {@link Type#DATE}
      * @throws IllegalArgumentException if {@code value} is not a parseable to a date.
      */
-    public static LongPropertyState createDateProperty(String name, String value) {
+    public static PropertyState createDateProperty(String name, String value) {
         return createDateProperty(name, Conversions.convert(value).toCalendar());
     }
 

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/MemoryPropertyBuilder.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/MemoryPropertyBuilder.java?rev=1400898&r1=1400897&r2=1400898&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/MemoryPropertyBuilder.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/MemoryPropertyBuilder.java Mon Oct 22 14:41:25 2012
@@ -147,45 +147,45 @@ public class MemoryPropertyBuilder<T> im
     public PropertyState getPropertyState(boolean asArray) {
         checkState(name != null, "Property has no name");
         if (values.isEmpty()) {
-            return PropertyStates.emptyProperty(name, Type.fromTag(type.tag(), true));
+            return EmptyPropertyState.emptyProperty(name, Type.fromTag(type.tag(), true));
         }
         else if (isArray() || asArray) {
             switch (type.tag()) {
                 case PropertyType.STRING:
-                    return PropertyStates.stringProperty(name, (Iterable<String>) values);
+                    return MultiStringPropertyState.stringProperty(name, (Iterable<String>) values);
                 case PropertyType.BINARY:
-                    return PropertyStates.binaryPropertyFromBlob(name, (Iterable<Blob>) values);
+                    return MultiBinaryPropertyState.binaryPropertyFromBlob(name, (Iterable<Blob>) values);
                 case PropertyType.LONG:
-                    return PropertyStates.longProperty(name, (Iterable<Long>) values);
+                    return MultiLongPropertyState.createLongProperty(name, (Iterable<Long>) values);
                 case PropertyType.DOUBLE:
-                    return PropertyStates.doubleProperty(name, (Iterable<Double>) values);
+                    return MultiDoublePropertyState.doubleProperty(name, (Iterable<Double>) values);
                 case PropertyType.DATE:
-                    return LongsPropertyState.createDatesProperty(name, (Iterable<String>) values);
+                    return MultiLongPropertyState.createDateProperty(name, (Iterable<String>) values);
                 case PropertyType.BOOLEAN:
-                    return PropertyStates.booleanProperty(name, (Iterable<Boolean>) values);
+                    return MultiBooleanPropertyState.booleanProperty(name, (Iterable<Boolean>) values);
                 case PropertyType.DECIMAL:
-                    return PropertyStates.decimalProperty(name, (Iterable<BigDecimal>) values);
+                    return MultiDecimalPropertyState.decimalProperty(name, (Iterable<BigDecimal>) values);
                 default:
-                    return new GenericsPropertyState(name, (Iterable<String>) values, Type.fromTag(type.tag(), true));
+                    return new MultiGenericPropertyState(name, (Iterable<String>) values, Type.fromTag(type.tag(), true));
             }
         }
         else {
             T value = values.get(0);
             switch (type.tag()) {
                 case PropertyType.STRING:
-                    return PropertyStates.stringProperty(name, (String) value);
+                    return StringPropertyState.stringProperty(name, (String) value);
                 case PropertyType.BINARY:
-                    return PropertyStates.binaryProperty(name, (Blob) value);
+                    return  BinaryPropertyState.binaryProperty(name, (Blob) value);
                 case PropertyType.LONG:
-                    return PropertyStates.longProperty(name, (Long) value);
+                    return LongPropertyState.createLongProperty(name, (Long) value);
                 case PropertyType.DOUBLE:
-                    return PropertyStates.doubleProperty(name, (Double) value);
+                    return DoublePropertyState.doubleProperty(name, (Double) value);
                 case PropertyType.DATE:
-                    return PropertyStates.dateProperty(name, (String) value);
+                    return LongPropertyState.createDateProperty(name, (String) value);
                 case PropertyType.BOOLEAN:
-                    return PropertyStates.booleanProperty(name, (Boolean) value);
+                    return BooleanPropertyState.booleanProperty(name, (Boolean) value);
                 case PropertyType.DECIMAL:
-                    return PropertyStates.decimalProperty(name, (BigDecimal) value);
+                    return DecimalPropertyState.decimalProperty(name, (BigDecimal) value);
                 default:
                     return new GenericPropertyState(name, (String) value, type);
             }

Copied: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/MultiBinaryPropertyState.java (from r1400897, jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/BinariesPropertyState.java)
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/MultiBinaryPropertyState.java?p2=jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/MultiBinaryPropertyState.java&p1=jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/BinariesPropertyState.java&r1=1400897&r2=1400898&rev=1400898&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/BinariesPropertyState.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/MultiBinaryPropertyState.java Mon Oct 22 14:41:25 2012
@@ -16,18 +16,46 @@
  */
 package org.apache.jackrabbit.oak.plugins.memory;
 
+import java.util.List;
+
+import com.google.common.collect.Lists;
 import org.apache.jackrabbit.oak.api.Blob;
+import org.apache.jackrabbit.oak.api.PropertyState;
 import org.apache.jackrabbit.oak.api.Type;
 import org.apache.jackrabbit.oak.plugins.value.Conversions;
 import org.apache.jackrabbit.oak.plugins.value.Conversions.Converter;
 
 import static org.apache.jackrabbit.oak.api.Type.BINARIES;
 
-public class BinariesPropertyState extends MultiPropertyState<Blob> {
-    public BinariesPropertyState(String name, Iterable<Blob> values) {
+public class MultiBinaryPropertyState extends MultiPropertyState<Blob> {
+    public MultiBinaryPropertyState(String name, Iterable<Blob> values) {
         super(name, values);
     }
 
+    /**
+     * Create a multi valued {@code PropertyState} from a list of {@link Blob}.
+     * @param name  The name of the property state
+     * @param values  The values of the property state
+     * @return  The new property state of type {@link Type#BINARIES}
+     */
+    public static PropertyState binaryPropertyFromBlob(String name, Iterable<Blob> values) {
+        return new MultiBinaryPropertyState(name, values);
+    }
+
+    /**
+     * Create a multi valued {@code PropertyState} from a list of byte arrays.
+     * @param name  The name of the property state
+     * @param values  The values of the property state
+     * @return  The new property state of type {@link Type#BINARIES}
+     */
+    public static PropertyState binaryPropertyFromArray(String name, Iterable<byte[]> values) {
+        List<Blob> blobs = Lists.newArrayList();
+        for (byte[] data : values) {
+            blobs.add(new ArrayBasedBlob(data));
+        }
+        return new MultiBinaryPropertyState(name, blobs);
+    }
+
     @Override
     public Converter getConverter(Blob value) {
         return Conversions.convert(value);

Propchange: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/MultiBinaryPropertyState.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/MultiBinaryPropertyState.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision Rev URL

Copied: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/MultiBooleanPropertyState.java (from r1400897, jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/BooleansPropertyState.java)
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/MultiBooleanPropertyState.java?p2=jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/MultiBooleanPropertyState.java&p1=jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/BooleansPropertyState.java&r1=1400897&r2=1400898&rev=1400898&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/BooleansPropertyState.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/MultiBooleanPropertyState.java Mon Oct 22 14:41:25 2012
@@ -16,17 +16,28 @@
  */
 package org.apache.jackrabbit.oak.plugins.memory;
 
+import org.apache.jackrabbit.oak.api.PropertyState;
 import org.apache.jackrabbit.oak.api.Type;
 import org.apache.jackrabbit.oak.plugins.value.Conversions;
 import org.apache.jackrabbit.oak.plugins.value.Conversions.Converter;
 
 import static org.apache.jackrabbit.oak.api.Type.BOOLEANS;
 
-public class BooleansPropertyState extends MultiPropertyState<Boolean> {
-    public BooleansPropertyState(String name, Iterable<Boolean> values) {
+public class MultiBooleanPropertyState extends MultiPropertyState<Boolean> {
+    public MultiBooleanPropertyState(String name, Iterable<Boolean> values) {
         super(name, values);
     }
 
+    /**
+     * Create a multi valued {@code PropertyState} from a list of booleans.
+     * @param name  The name of the property state
+     * @param values  The values of the property state
+     * @return  The new property state of type {@link Type#BOOLEANS}
+     */
+    public static PropertyState booleanProperty(String name, Iterable<Boolean> values) {
+        return new MultiBooleanPropertyState(name, values);
+    }
+
     @Override
     public Converter getConverter(Boolean value) {
         return Conversions.convert(value);

Propchange: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/MultiBooleanPropertyState.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/MultiBooleanPropertyState.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision Rev URL

Copied: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/MultiDecimalPropertyState.java (from r1400897, jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/DecimalsPropertyState.java)
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/MultiDecimalPropertyState.java?p2=jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/MultiDecimalPropertyState.java&p1=jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/DecimalsPropertyState.java&r1=1400897&r2=1400898&rev=1400898&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/DecimalsPropertyState.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/MultiDecimalPropertyState.java Mon Oct 22 14:41:25 2012
@@ -18,17 +18,28 @@ package org.apache.jackrabbit.oak.plugin
 
 import java.math.BigDecimal;
 
+import org.apache.jackrabbit.oak.api.PropertyState;
 import org.apache.jackrabbit.oak.api.Type;
 import org.apache.jackrabbit.oak.plugins.value.Conversions;
 import org.apache.jackrabbit.oak.plugins.value.Conversions.Converter;
 
 import static org.apache.jackrabbit.oak.api.Type.DECIMALS;
 
-public class DecimalsPropertyState extends MultiPropertyState<BigDecimal> {
-    public DecimalsPropertyState(String name, Iterable<BigDecimal> values) {
+public class MultiDecimalPropertyState extends MultiPropertyState<BigDecimal> {
+    public MultiDecimalPropertyState(String name, Iterable<BigDecimal> values) {
         super(name, values);
     }
 
+    /**
+     * Create a multi valued {@code PropertyState} from a list of decimals.
+     * @param name  The name of the property state
+     * @param values  The values of the property state
+     * @return  The new property state of type {@link Type#DECIMALS}
+     */
+    public static PropertyState decimalProperty(String name, Iterable<BigDecimal> values) {
+        return new MultiDecimalPropertyState(name, values);
+    }
+
     @Override
     public Converter getConverter(BigDecimal value) {
         return Conversions.convert(value);

Propchange: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/MultiDecimalPropertyState.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/MultiDecimalPropertyState.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision Rev URL

Copied: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/MultiDoublePropertyState.java (from r1400897, jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/DoublesPropertyState.java)
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/MultiDoublePropertyState.java?p2=jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/MultiDoublePropertyState.java&p1=jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/DoublesPropertyState.java&r1=1400897&r2=1400898&rev=1400898&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/DoublesPropertyState.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/MultiDoublePropertyState.java Mon Oct 22 14:41:25 2012
@@ -18,17 +18,28 @@
  */
 package org.apache.jackrabbit.oak.plugins.memory;
 
+import org.apache.jackrabbit.oak.api.PropertyState;
 import org.apache.jackrabbit.oak.api.Type;
 import org.apache.jackrabbit.oak.plugins.value.Conversions;
 import org.apache.jackrabbit.oak.plugins.value.Conversions.Converter;
 
 import static org.apache.jackrabbit.oak.api.Type.DOUBLES;
 
-public class DoublesPropertyState extends MultiPropertyState<Double> {
-    public DoublesPropertyState(String name, Iterable<Double>values) {
+public class MultiDoublePropertyState extends MultiPropertyState<Double> {
+    public MultiDoublePropertyState(String name, Iterable<Double> values) {
         super(name, values);
     }
 
+    /**
+     * Create a multi valued {@code PropertyState} from a list of doubles.
+     * @param name  The name of the property state
+     * @param values  The values of the property state
+     * @return  The new property state of type {@link Type#DOUBLES}
+     */
+    public static PropertyState doubleProperty(String name, Iterable<Double> values) {
+        return new MultiDoublePropertyState(name, values);
+    }
+
     @Override
     public Converter getConverter(Double value) {
         return Conversions.convert(value);

Propchange: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/MultiDoublePropertyState.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/MultiDoublePropertyState.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision Rev URL

Added: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/MultiGenericPropertyState.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/MultiGenericPropertyState.java?rev=1400898&view=auto
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/MultiGenericPropertyState.java (added)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/MultiGenericPropertyState.java Mon Oct 22 14:41:25 2012
@@ -0,0 +1,109 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.jackrabbit.oak.plugins.memory;
+
+import org.apache.jackrabbit.oak.api.PropertyState;
+import org.apache.jackrabbit.oak.api.Type;
+import org.apache.jackrabbit.oak.plugins.value.Conversions;
+import org.apache.jackrabbit.oak.plugins.value.Conversions.Converter;
+
+import static com.google.common.base.Preconditions.checkArgument;
+import static org.apache.jackrabbit.oak.api.Type.NAMES;
+import static org.apache.jackrabbit.oak.api.Type.PATHS;
+import static org.apache.jackrabbit.oak.api.Type.REFERENCES;
+import static org.apache.jackrabbit.oak.api.Type.URIS;
+import static org.apache.jackrabbit.oak.api.Type.WEAKREFERENCES;
+
+public class MultiGenericPropertyState extends MultiPropertyState<String> {
+    private final Type<?> type;
+
+    /**
+     * @throws IllegalArgumentException if {@code type.isArray()} is {@code false}
+     */
+    public MultiGenericPropertyState(String name, Iterable<String> values, Type<?> type) {
+        super(name, values);
+        checkArgument(type.isArray());
+        this.type = type;
+    }
+
+    /**
+     * Create a multi valued {@code PropertyState} from a list of names.
+     * No validation is performed on the strings passed for {@code values}.
+     * @param name  The name of the property state
+     * @param values  The values of the property state
+     * @return  The new property state of type {@link Type#NAMES}
+     */
+    public static PropertyState nameProperty(String name, Iterable<String> values) {
+        return new MultiGenericPropertyState(name, values, NAMES);
+    }
+
+    /**
+     * Create a multi valued {@code PropertyState} from a list of paths.
+     * No validation is performed on the strings passed for {@code values}.
+     * @param name  The name of the property state
+     * @param values  The values of the property state
+     * @return  The new property state of type {@link Type#PATHS}
+     */
+    public static PropertyState pathProperty(String name, Iterable<String> values) {
+        return new MultiGenericPropertyState(name, values, PATHS);
+    }
+
+    /**
+     * Create a multi valued {@code PropertyState} from a list of references.
+     * No validation is performed on the strings passed for {@code values}.
+     * @param name  The name of the property state
+     * @param values  The values of the property state
+     * @return  The new property state of type {@link Type#REFERENCES}
+     */
+    public static PropertyState referenceProperty(String name, Iterable<String> values) {
+        return new MultiGenericPropertyState(name, values, REFERENCES);
+    }
+
+    /**
+     * Create a multi valued {@code PropertyState} from a list of weak references.
+     * No validation is performed on the strings passed for {@code values}.
+     * @param name  The name of the property state
+     * @param values  The values of the property state
+     * @return  The new property state of type {@link Type#WEAKREFERENCES}
+     */
+    public static PropertyState weakreferenceProperty(String name, Iterable<String> values) {
+        return new MultiGenericPropertyState(name, values, WEAKREFERENCES);
+    }
+
+    /**
+     * Create a multi valued {@code PropertyState} from a list of URIs.
+     * No validation is performed on the strings passed for {@code values}.
+     * @param name  The name of the property state
+     * @param values  The values of the property state
+     * @return  The new property state of type {@link Type#URIS}
+     */
+    public static PropertyState uriProperty(String name, Iterable<String> values) {
+        return new MultiGenericPropertyState(name, values, URIS);
+    }
+
+    @Override
+    public Converter getConverter(String value) {
+        return Conversions.convert(value);
+    }
+
+    @Override
+    public Type<?> getType() {
+        return type;
+    }
+}

Propchange: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/MultiGenericPropertyState.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/MultiGenericPropertyState.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision Rev URL

Copied: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/MultiLongPropertyState.java (from r1400897, jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/LongsPropertyState.java)
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/MultiLongPropertyState.java?p2=jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/MultiLongPropertyState.java&p1=jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/LongsPropertyState.java&r1=1400897&r2=1400898&rev=1400898&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/LongsPropertyState.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/MultiLongPropertyState.java Mon Oct 22 14:41:25 2012
@@ -22,14 +22,15 @@ import java.util.Calendar;
 import java.util.List;
 
 import com.google.common.collect.Lists;
+import org.apache.jackrabbit.oak.api.PropertyState;
 import org.apache.jackrabbit.oak.api.Type;
 import org.apache.jackrabbit.oak.plugins.value.Conversions;
 import org.apache.jackrabbit.oak.plugins.value.Conversions.Converter;
 
-public class LongsPropertyState extends MultiPropertyState<Long> {
+public class MultiLongPropertyState extends MultiPropertyState<Long> {
     private final Type<?> type;
 
-    private LongsPropertyState(String name, Iterable<Long> values, Type<?> type) {
+    public MultiLongPropertyState(String name, Iterable<Long> values, Type<?> type) {
         super(name, values);
         this.type = type;
     }
@@ -40,8 +41,8 @@ public class LongsPropertyState extends 
      * @param values  The values of the property state
      * @return  The new property state of type {@link Type#LONGS}
      */
-    public static LongsPropertyState createLongsProperty(String name, Iterable<Long> values) {
-        return new LongsPropertyState(name, Lists.newArrayList(values), Type.LONGS);
+    public static PropertyState createLongProperty(String name, Iterable<Long> values) {
+        return new MultiLongPropertyState(name, Lists.newArrayList(values), Type.LONGS);
     }
 
     /**
@@ -50,8 +51,8 @@ public class LongsPropertyState extends 
      * @param values  The values of the property state
      * @return  The new property state of type {@link Type#DATES}
      */
-    public static LongsPropertyState createDatesPropertyFromLong(String name, Iterable<Long> values) {
-        return new LongsPropertyState(name, Lists.newArrayList(values), Type.DATES);
+    public static PropertyState createDatePropertyFromLong(String name, Iterable<Long> values) {
+        return new MultiLongPropertyState(name, Lists.newArrayList(values), Type.DATES);
     }
 
     /**
@@ -60,12 +61,12 @@ public class LongsPropertyState extends 
      * @param values  The values of the property state
      * @return  The new property state of type {@link Type#DATES}
      */
-    public static LongsPropertyState createDatesPropertyFromCalendar(String name, Iterable<Calendar> values) {
+    public static PropertyState createDatePropertyFromCalendar(String name, Iterable<Calendar> values) {
         List<Long> dates = Lists.newArrayList();
         for (Calendar v : values) {
             dates.add(Conversions.convert(v).toLong());
         }
-        return new LongsPropertyState(name, dates, Type.DATES);
+        return new MultiLongPropertyState(name, dates, Type.DATES);
     }
 
     /**
@@ -75,12 +76,12 @@ public class LongsPropertyState extends 
      * @return  The new property state of type {@link Type#DATES}
      * @throws IllegalArgumentException if one of the {@code values} is not a parseable to a date.
      */
-    public static LongsPropertyState createDatesProperty(String name, Iterable<String> values) {
+    public static PropertyState createDateProperty(String name, Iterable<String> values) {
         List<Long> dates = Lists.newArrayList();
         for (String v : values) {
             dates.add(Conversions.convert(Conversions.convert(v).toCalendar()).toLong());
         }
-        return new LongsPropertyState(name, dates, Type.DATES);
+        return new MultiLongPropertyState(name, dates, Type.DATES);
     }
 
     @Override

Propchange: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/MultiLongPropertyState.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/MultiLongPropertyState.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision Rev URL

Copied: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/MultiStringPropertyState.java (from r1400897, jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/StringsPropertyState.java)
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/MultiStringPropertyState.java?p2=jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/MultiStringPropertyState.java&p1=jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/StringsPropertyState.java&r1=1400897&r2=1400898&rev=1400898&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/StringsPropertyState.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/MultiStringPropertyState.java Mon Oct 22 14:41:25 2012
@@ -18,15 +18,26 @@
  */
 package org.apache.jackrabbit.oak.plugins.memory;
 
+import org.apache.jackrabbit.oak.api.PropertyState;
 import org.apache.jackrabbit.oak.api.Type;
 import org.apache.jackrabbit.oak.plugins.value.Conversions;
 import org.apache.jackrabbit.oak.plugins.value.Conversions.Converter;
 
-public class StringsPropertyState extends MultiPropertyState<String> {
-    public StringsPropertyState(String name, Iterable<String> values) {
+public class MultiStringPropertyState extends MultiPropertyState<String> {
+    public MultiStringPropertyState(String name, Iterable<String> values) {
         super(name, values);
     }
 
+    /**
+     * Create a multi valued {@code PropertyState} from a list of strings.
+     * @param name  The name of the property state
+     * @param values  The values of the property state
+     * @return  The new property state of type {@link Type#STRINGS}
+     */
+    public static PropertyState stringProperty(String name, Iterable<String> values) {
+        return new MultiStringPropertyState(name, values);
+    }
+
     @Override
     public Converter getConverter(String value) {
         return Conversions.convert(value);

Propchange: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/MultiStringPropertyState.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/MultiStringPropertyState.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision Rev URL

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/PropertyStates.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/PropertyStates.java?rev=1400898&r1=1400897&r2=1400898&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/PropertyStates.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/PropertyStates.java Mon Oct 22 14:41:25 2012
@@ -19,7 +19,6 @@
 package org.apache.jackrabbit.oak.plugins.memory;
 
 import java.math.BigDecimal;
-import java.util.Calendar;
 import java.util.List;
 
 import javax.annotation.Nonnull;
@@ -38,17 +37,7 @@ import org.apache.jackrabbit.oak.kernel.
 import org.apache.jackrabbit.oak.kernel.TypeCodes;
 import org.apache.jackrabbit.oak.plugins.value.Conversions;
 
-import static org.apache.jackrabbit.oak.api.Type.NAME;
-import static org.apache.jackrabbit.oak.api.Type.NAMES;
-import static org.apache.jackrabbit.oak.api.Type.PATH;
-import static org.apache.jackrabbit.oak.api.Type.PATHS;
-import static org.apache.jackrabbit.oak.api.Type.REFERENCE;
-import static org.apache.jackrabbit.oak.api.Type.REFERENCES;
 import static org.apache.jackrabbit.oak.api.Type.STRINGS;
-import static org.apache.jackrabbit.oak.api.Type.URI;
-import static org.apache.jackrabbit.oak.api.Type.URIS;
-import static org.apache.jackrabbit.oak.api.Type.WEAKREFERENCE;
-import static org.apache.jackrabbit.oak.api.Type.WEAKREFERENCES;
 
 /**
  * Utility class for creating {@link PropertyState} instances.
@@ -70,19 +59,19 @@ public final class PropertyStates {
         int type = value.getType();
         switch (type) {
             case PropertyType.STRING:
-                return stringProperty(name, value.getString());
+                return StringPropertyState.stringProperty(name, value.getString());
             case PropertyType.BINARY:
-                return binaryProperty(name, value);
+                return BinaryPropertyState.binaryProperty(name, value);
             case PropertyType.LONG:
-                return longProperty(name, value.getLong());
+                return LongPropertyState.createLongProperty(name, value.getLong());
             case PropertyType.DOUBLE:
-                return doubleProperty(name, value.getDouble());
+                return DoublePropertyState.doubleProperty(name, value.getDouble());
             case PropertyType.DATE:
-                return dateProperty(name, value.getLong());
+                return LongPropertyState.createDateProperty(name, value.getLong());
             case PropertyType.BOOLEAN:
-                return booleanProperty(name, value.getBoolean());
+                return BooleanPropertyState.booleanProperty(name, value.getBoolean());
             case PropertyType.DECIMAL:
-                return decimalProperty(name, value.getDecimal());
+                return DecimalPropertyState.decimalProperty(name, value.getDecimal());
             default:
                 return new GenericPropertyState(name, value.getString(), Type.fromTag(type, false));
         }
@@ -103,7 +92,7 @@ public final class PropertyStates {
     public static PropertyState createProperty(String name, Iterable<Value> values) throws RepositoryException {
         Value first = Iterables.getFirst(values, null);
         if (first == null) {
-            return emptyProperty(name, STRINGS);
+            return EmptyPropertyState.emptyProperty(name, STRINGS);
         }
 
         int type = first.getType();
@@ -113,49 +102,49 @@ public final class PropertyStates {
                 for (Value value : values) {
                     strings.add(value.getString());
                 }
-                return stringProperty(name, strings);
+                return MultiStringPropertyState.stringProperty(name, strings);
             case PropertyType.BINARY:
                 List<Blob> blobs = Lists.newArrayList();
                 for (Value value : values) {
                     blobs.add(new ValueBasedBlob(value));
                 }
-                return binaryPropertyFromBlob(name, blobs);
+                return MultiBinaryPropertyState.binaryPropertyFromBlob(name, blobs);
             case PropertyType.LONG:
                 List<Long> longs = Lists.newArrayList();
                 for (Value value : values) {
                     longs.add(value.getLong());
                 }
-                return longProperty(name, longs);
+                return MultiLongPropertyState.createLongProperty(name, longs);
             case PropertyType.DOUBLE:
                 List<Double> doubles = Lists.newArrayList();
                 for (Value value : values) {
                     doubles.add(value.getDouble());
                 }
-                return doubleProperty(name, doubles);
+                return MultiDoublePropertyState.doubleProperty(name, doubles);
             case PropertyType.DATE:
                 List<Long> dates = Lists.newArrayList();
                 for (Value value : values) {
                     dates.add(value.getLong());
                 }
-                return datePropertyFromLong(name, dates);
+                return MultiLongPropertyState.createDatePropertyFromLong(name, dates);
             case PropertyType.BOOLEAN:
                 List<Boolean> booleans = Lists.newArrayList();
                 for (Value value : values) {
                     booleans.add(value.getBoolean());
                 }
-                return booleanProperty(name, booleans);
+                return MultiBooleanPropertyState.booleanProperty(name, booleans);
             case PropertyType.DECIMAL:
                 List<BigDecimal> decimals = Lists.newArrayList();
                 for (Value value : values) {
                     decimals.add(value.getDecimal());
                 }
-                return decimalProperty(name, decimals);
+                return MultiDecimalPropertyState.decimalProperty(name, decimals);
             default:
                 List<String> vals = Lists.newArrayList();
                 for (Value value : values) {
                     vals.add(value.getString());
                 }
-                return new GenericsPropertyState(name, vals, Type.fromTag(type, true));
+                return new MultiGenericPropertyState(name, vals, Type.fromTag(type, true));
         }
     }
 
@@ -170,19 +159,19 @@ public final class PropertyStates {
     public static PropertyState createProperty(String name, String value, int type) {
         switch (type) {
             case PropertyType.STRING:
-                return stringProperty(name, value);
+                return StringPropertyState.stringProperty(name, value);
             case PropertyType.BINARY:
-                return binaryProperty(name, Conversions.convert(value).toBinary());
+                return  BinaryPropertyState.binaryProperty(name, Conversions.convert(value).toBinary());
             case PropertyType.LONG:
-                return longProperty(name, Conversions.convert(value).toLong());
+                return LongPropertyState.createLongProperty(name, Conversions.convert(value).toLong());
             case PropertyType.DOUBLE:
-                return doubleProperty(name, Conversions.convert(value).toDouble());
+                return DoublePropertyState.doubleProperty(name, Conversions.convert(value).toDouble());
             case PropertyType.DATE:
-                return dateProperty(name, value);
+                return LongPropertyState.createDateProperty(name, value);
             case PropertyType.BOOLEAN:
-                return booleanProperty(name, Conversions.convert(value).toBoolean());
+                return BooleanPropertyState.booleanProperty(name, Conversions.convert(value).toBoolean());
             case PropertyType.DECIMAL:
-                return decimalProperty(name, Conversions.convert(value).toDecimal());
+                return DecimalPropertyState.decimalProperty(name, Conversions.convert(value).toDecimal());
             default:
                 return new GenericPropertyState(name, value, Type.fromTag(type, false));
         }
@@ -199,42 +188,54 @@ public final class PropertyStates {
     @Nonnull
     public static <T> PropertyState createProperty(String name, T value, Type<T> type) {
         switch (type.tag()) {
-            case PropertyType.STRING: return type.isArray()
-                ? stringProperty(name, (Iterable<String>) value)
-                : stringProperty(name, (String) value);
-            case PropertyType.BINARY: return type.isArray()
-                ? binaryPropertyFromBlob(name, (Iterable<Blob>) value)
-                : binaryProperty(name, (Blob) value);
-            case PropertyType.LONG: return type.isArray()
-                ? longProperty(name, (Iterable<Long>) value)
-                : longProperty(name, (Long) value);
-            case PropertyType.DOUBLE: return type.isArray()
-                ? doubleProperty(name, (Iterable<Double>) value)
-                : doubleProperty(name, (Double) value);
-            case PropertyType.DATE: return type.isArray()
-                ? dateProperty(name, (Iterable<String>) value)
-                : dateProperty(name, (String) value);
-            case PropertyType.BOOLEAN: return type.isArray()
-                ? booleanProperty(name, (Iterable<Boolean>) value)
-                : booleanProperty(name, (Boolean) value);
-            case PropertyType.NAME: return type.isArray()
-                ? nameProperty(name, (Iterable<String>) value)
-                : nameProperty(name, (String) value);
-            case PropertyType.PATH: return type.isArray()
-                ? pathProperty(name, (Iterable<String>) value)
-                : pathProperty(name, (String) value);
-            case PropertyType.REFERENCE: return type.isArray()
-                ? referenceProperty(name, (Iterable<String>) value)
-                : referenceProperty(name, (String) value);
-            case PropertyType.WEAKREFERENCE: return type.isArray()
-                ? weakreferenceProperty(name, (Iterable<String>) value)
-                : weakreferenceProperty(name, (String) value);
-            case PropertyType.URI: return type.isArray()
-                ? uriProperty(name, (Iterable<String>) value)
-                : uriProperty(name, (String) value);
-            case PropertyType.DECIMAL: return type.isArray()
-                ? decimalProperty(name, (Iterable<BigDecimal>) value)
-                : decimalProperty(name, (BigDecimal) value);
+            case PropertyType.STRING:
+                return type.isArray()
+                ? MultiStringPropertyState.stringProperty(name, (Iterable<String>) value)
+                : StringPropertyState.stringProperty(name, (String) value);
+            case PropertyType.BINARY:
+                return type.isArray()
+                ? MultiBinaryPropertyState.binaryPropertyFromBlob(name, (Iterable<Blob>) value)
+                : BinaryPropertyState.binaryProperty(name, (Blob) value);
+            case PropertyType.LONG:
+                return type.isArray()
+                ? MultiLongPropertyState.createLongProperty(name, (Iterable<Long>) value)
+                : LongPropertyState.createLongProperty(name, (Long) value);
+            case PropertyType.DOUBLE:
+                return type.isArray()
+                ? MultiDoublePropertyState.doubleProperty(name, (Iterable<Double>) value)
+                : DoublePropertyState.doubleProperty(name, (Double) value);
+            case PropertyType.DATE:
+                return type.isArray()
+                ? MultiLongPropertyState.createDateProperty(name, (Iterable<String>) value)
+                : LongPropertyState.createDateProperty(name, (String) value);
+            case PropertyType.BOOLEAN:
+                return type.isArray()
+                ? MultiBooleanPropertyState.booleanProperty(name, (Iterable<Boolean>) value)
+                : BooleanPropertyState.booleanProperty(name, (Boolean) value);
+            case PropertyType.NAME:
+                return type.isArray()
+                ? MultiGenericPropertyState.nameProperty(name, (Iterable<String>) value)
+                : GenericPropertyState.nameProperty(name, (String) value);
+            case PropertyType.PATH:
+                return type.isArray()
+                ? MultiGenericPropertyState.pathProperty(name, (Iterable<String>) value)
+                : GenericPropertyState.pathProperty(name, (String) value);
+            case PropertyType.REFERENCE:
+                return type.isArray()
+                ? MultiGenericPropertyState.referenceProperty(name, (Iterable<String>) value)
+                : GenericPropertyState.referenceProperty(name, (String) value);
+            case PropertyType.WEAKREFERENCE:
+                return type.isArray()
+                ? MultiGenericPropertyState.weakreferenceProperty(name, (Iterable<String>) value)
+                : GenericPropertyState.weakreferenceProperty(name, (String) value);
+            case PropertyType.URI:
+                return type.isArray()
+                ? MultiGenericPropertyState.uriProperty(name, (Iterable<String>) value)
+                : GenericPropertyState.uriProperty(name, (String) value);
+            case PropertyType.DECIMAL:
+                return type.isArray()
+                ? MultiDecimalPropertyState.decimalProperty(name, (Iterable<BigDecimal>) value)
+                : DecimalPropertyState.decimalProperty(name, (BigDecimal) value);
             default: throw new IllegalArgumentException("Invalid type: " + type);
         }
     }
@@ -250,28 +251,28 @@ public final class PropertyStates {
     @Nonnull
     public static <T> PropertyState createProperty(String name, T value) {
         if (value instanceof String) {
-            return stringProperty(name, (String) value);
+            return StringPropertyState.stringProperty(name, (String) value);
         }
         else if (value instanceof Blob) {
-            return binaryProperty(name, (Blob) value);
+            return  BinaryPropertyState.binaryProperty(name, (Blob) value);
         }
         else if (value instanceof byte[]) {
-            return binaryProperty(name, (byte[]) value);
+            return BinaryPropertyState.binaryProperty(name, (byte[]) value);
         }
         else if (value instanceof Long) {
-            return longProperty(name, (Long) value);
+            return LongPropertyState.createLongProperty(name, (Long) value);
         }
         else if (value instanceof Integer) {
-            return longProperty(name, (Integer) value);
+            return LongPropertyState.createLongProperty(name, (long) (Integer) value);
         }
         else if (value instanceof Double) {
-            return doubleProperty(name, (Double) value);
+            return DoublePropertyState.doubleProperty(name, (Double) value);
         }
         else if (value instanceof Boolean) {
-            return booleanProperty(name, (Boolean) value);
+            return BooleanPropertyState.booleanProperty(name, (Boolean) value);
         }
         else if (value instanceof BigDecimal) {
-            return decimalProperty(name, (BigDecimal) value);
+            return DecimalPropertyState.decimalProperty(name, (BigDecimal) value);
         }
         else {
             throw new IllegalArgumentException("Can't infer type of value of class '" + value.getClass() + '\'');
@@ -279,364 +280,6 @@ public final class PropertyStates {
     }
 
     /**
-     * Create an empty {@code PropertyState}
-     * @param name  The name of the property state
-     * @param type  The type of the property state
-     * @return  The new property state
-     */
-    public static PropertyState emptyProperty(String name, final Type<?> type) {
-        if (!type.isArray()) {
-            throw new IllegalArgumentException("Not an array type:" + type);
-        }
-        return new EmptyPropertyState(name) {
-            @Override
-            public Type<?> getType() {
-                return type;
-            }
-        };
-    }
-
-    /**
-     * Create a {@code PropertyState} from a string.
-     * @param name  The name of the property state
-     * @param value  The value of the property state
-     * @return  The new property state of type {@link Type#STRING}
-     */
-    public static PropertyState stringProperty(String name, String value) {
-        return new StringPropertyState(name, value);
-    }
-
-    /**
-     * Create a {@code PropertyState} from an array of bytes.
-     * @param name  The name of the property state
-     * @param value  The value of the property state
-     * @return  The new property state of type {@link Type#BINARY}
-     */
-    public static PropertyState binaryProperty(String name, byte[] value) {
-        return new BinaryPropertyState(name, new ArrayBasedBlob(value));
-    }
-
-    /**
-     * Create a {@code PropertyState} from an array of bytes.
-     * @param name  The name of the property state
-     * @param value  The value of the property state
-     * @return  The new property state of type {@link Type#BINARY}
-     */
-    public static PropertyState binaryProperty(String name, String value) {
-        return new BinaryPropertyState(name, new StringBasedBlob(value));
-    }
-
-    /**
-     * Create a {@code PropertyState} from a {@link Blob}.
-     * @param name  The name of the property state
-     * @param value  The value of the property state
-     * @return  The new property state of type {@link Type#BINARY}
-     */
-    public static PropertyState binaryProperty(String name, Blob value) {
-        return new BinaryPropertyState(name, value);
-    }
-
-    /**
-     * Create a {@code PropertyState} from a {@link Value}.
-     * @param name  The name of the property state
-     * @param value  The value of the property state
-     * @return  The new property state of type {@link Type#BINARY}
-     */
-    public static PropertyState binaryProperty(String name, Value value) {
-        return new BinaryPropertyState(name, new ValueBasedBlob(value));
-    }
-
-    /**
-     * Create a {@code PropertyState} from a long.
-     * @param name  The name of the property state
-     * @param value  The value of the property state
-     * @return  The new property state of type {@link Type#LONG}
-     */
-    public static PropertyState longProperty(String name, long value) {
-        return LongPropertyState.createLongProperty(name, value);
-    }
-
-    /**
-     * Create a {@code PropertyState} from a double.
-     * @param name  The name of the property state
-     * @param value  The value of the property state
-     * @return  The new property state of type {@link Type#DOUBLE}
-     */
-    public static PropertyState doubleProperty(String name, double value) {
-        return new DoublePropertyState(name, value);
-    }
-
-    /**
-     * Create a {@code PropertyState} from a date. No validation is performed
-     * on the string passed for {@code value}.
-     * @param name  The name of the property state
-     * @param value  The value of the property state
-     * @return  The new property state of type {@link Type#DATE}
-     */
-    public static PropertyState dateProperty(String name, String value) {
-        return LongPropertyState.createDateProperty(name, value);
-    }
-
-    /**
-     * Create a {@code PropertyState} from a date. No validation is performed
-     * on the string passed for {@code value}.
-     * @param name  The name of the property state
-     * @param value  The value of the property state
-     * @return  The new property state of type {@link Type#DATE}
-     */
-    public static PropertyState dateProperty(String name, long value) {
-        return LongPropertyState.createDateProperty(name, value);
-    }
-
-    /**
-     * Create a {@code PropertyState} from a date. No validation is performed
-     * on the string passed for {@code value}.
-     * @param name  The name of the property state
-     * @param value  The value of the property state
-     * @return  The new property state of type {@link Type#DATE}
-     */
-    public static PropertyState dateProperty(String name, Calendar value) {
-        return LongPropertyState.createDateProperty(name, value);
-    }
-
-    /**
-     * Create a {@code PropertyState} from a boolean.
-     * @param name  The name of the property state
-     * @param value  The value of the property state
-     * @return  The new property state of type {@link Type#BOOLEAN}
-     */
-    public static PropertyState booleanProperty(String name, boolean value) {
-        return new BooleanPropertyState(name, value);
-    }
-
-    /**
-     * Create a {@code PropertyState} from a name. No validation is performed
-     * on the string passed for {@code value}.
-     * @param name  The name of the property state
-     * @param value  The value of the property state
-     * @return  The new property state of type {@link Type#NAME}
-     */
-    public static PropertyState nameProperty(String name, String value) {
-        return new GenericPropertyState(name, value, NAME);
-    }
-
-    /**
-     * Create a {@code PropertyState} from a path. No validation is performed
-     * on the string passed for {@code value}.
-     * @param name  The name of the property state
-     * @param value  The value of the property state
-     * @return  The new property state of type {@link Type#PATH}
-     */
-    public static PropertyState pathProperty(String name, String value) {
-        return new GenericPropertyState(name, value, PATH);
-    }
-
-    /**
-     * Create a {@code PropertyState} from a reference. No validation is performed
-     * on the string passed for {@code value}.
-     * @param name  The name of the property state
-     * @param value  The value of the property state
-     * @return  The new property state of type {@link Type#REFERENCE}
-     */
-    public static PropertyState referenceProperty(String name, String value) {
-        return new GenericPropertyState(name, value, REFERENCE);
-    }
-
-    /**
-     * Create a {@code PropertyState} from a weak reference. No validation is performed
-     * on the string passed for {@code value}.
-     * @param name  The name of the property state
-     * @param value  The value of the property state
-     * @return  The new property state of type {@link Type#WEAKREFERENCE}
-     */
-    public static PropertyState weakreferenceProperty(String name, String value) {
-        return new GenericPropertyState(name, value, WEAKREFERENCE);
-    }
-
-    /**
-     * Create a {@code PropertyState} from a URI. No validation is performed
-     * on the string passed for {@code value}.
-     * @param name  The name of the property state
-     * @param value  The value of the property state
-     * @return  The new property state of type {@link Type#URI}
-     */
-    public static PropertyState uriProperty(String name, String value) {
-        return new GenericPropertyState(name, value, URI);
-    }
-
-    /**
-     * Create a {@code PropertyState} from a decimal.
-     * @param name  The name of the property state
-     * @param value  The value of the property state
-     * @return  The new property state of type {@link Type#DECIMAL}
-     */
-    public static PropertyState decimalProperty(String name, BigDecimal value) {
-        return new DecimalPropertyState(name, value);
-    }
-
-    /**
-     * Create a multi valued {@code PropertyState} from a list of strings.
-     * @param name  The name of the property state
-     * @param values  The values of the property state
-     * @return  The new property state of type {@link Type#STRINGS}
-     */
-    public static PropertyState stringProperty(String name, Iterable<String> values) {
-        return new StringsPropertyState(name, values);
-    }
-
-    /**
-     * Create a multi valued {@code PropertyState} from a list of {@link Blob}.
-     * @param name  The name of the property state
-     * @param values  The values of the property state
-     * @return  The new property state of type {@link Type#BINARIES}
-     */
-    public static PropertyState binaryPropertyFromBlob(String name, Iterable<Blob> values) {
-        return new BinariesPropertyState(name, values);
-    }
-
-    /**
-     * Create a multi valued {@code PropertyState} from a list of byte arrays.
-     * @param name  The name of the property state
-     * @param values  The values of the property state
-     * @return  The new property state of type {@link Type#BINARIES}
-     */
-    public static PropertyState binaryPropertyFromArray(String name, Iterable<byte[]> values) {
-        List<Blob> blobs = Lists.newArrayList();
-        for (byte[] data : values) {
-            blobs.add(new ArrayBasedBlob(data));
-        }
-        return new BinariesPropertyState(name, blobs);
-    }
-
-    /**
-     * Create a multi valued {@code PropertyState} from a list of longs.
-     * @param name  The name of the property state
-     * @param values  The values of the property state
-     * @return  The new property state of type {@link Type#LONGS}
-     */
-    public static PropertyState longProperty(String name, Iterable<Long> values) {
-        return LongsPropertyState.createLongsProperty(name, values);
-    }
-
-    /**
-     * Create a multi valued {@code PropertyState} from a list of doubles.
-     * @param name  The name of the property state
-     * @param values  The values of the property state
-     * @return  The new property state of type {@link Type#DOUBLES}
-     */
-    public static PropertyState doubleProperty(String name, Iterable<Double> values) {
-        return new DoublesPropertyState(name, values);
-    }
-
-    /**
-     * Create a multi valued {@code PropertyState} from a list of dates.
-     * No validation is performed on the strings passed for {@code values}.
-     * @param name  The name of the property state
-     * @param values  The values of the property state
-     * @return  The new property state of type {@link Type#DATES}
-     */
-    public static PropertyState dateProperty(String name, Iterable<String> values) {
-        return LongsPropertyState.createDatesProperty(name, values);
-    }
-
-    /**
-     * Create a multi valued {@code PropertyState} from a list of dates.
-     * No validation is performed on the strings passed for {@code values}.
-     * @param name  The name of the property state
-     * @param values  The values of the property state
-     * @return  The new property state of type {@link Type#DATES}
-     */
-    public static PropertyState datePropertyFromLong(String name, Iterable<Long> values) {
-        return LongsPropertyState.createDatesPropertyFromLong(name, values);
-    }
-
-    /**
-     * Create a multi valued {@code PropertyState} from a list of dates.
-     * No validation is performed on the strings passed for {@code values}.
-     * @param name  The name of the property state
-     * @param values  The values of the property state
-     * @return  The new property state of type {@link Type#DATES}
-     */
-    public static PropertyState datePropertyFromCalendar(String name, Iterable<Calendar> values) {
-        return LongsPropertyState.createDatesPropertyFromCalendar(name, values);
-    }
-
-    /**
-     * Create a multi valued {@code PropertyState} from a list of booleans.
-     * @param name  The name of the property state
-     * @param values  The values of the property state
-     * @return  The new property state of type {@link Type#BOOLEANS}
-     */
-    public static PropertyState booleanProperty(String name, Iterable<Boolean> values) {
-        return new BooleansPropertyState(name, values);
-    }
-
-    /**
-     * Create a multi valued {@code PropertyState} from a list of names.
-     * No validation is performed on the strings passed for {@code values}.
-     * @param name  The name of the property state
-     * @param values  The values of the property state
-     * @return  The new property state of type {@link Type#NAMES}
-     */
-    public static PropertyState nameProperty(String name, Iterable<String> values) {
-        return new GenericsPropertyState(name, values, NAMES);
-    }
-
-    /**
-     * Create a multi valued {@code PropertyState} from a list of paths.
-     * No validation is performed on the strings passed for {@code values}.
-     * @param name  The name of the property state
-     * @param values  The values of the property state
-     * @return  The new property state of type {@link Type#PATHS}
-     */
-    public static PropertyState pathProperty(String name, Iterable<String> values) {
-        return new GenericsPropertyState(name, values, PATHS);
-    }
-
-    /**
-     * Create a multi valued {@code PropertyState} from a list of references.
-     * No validation is performed on the strings passed for {@code values}.
-     * @param name  The name of the property state
-     * @param values  The values of the property state
-     * @return  The new property state of type {@link Type#REFERENCES}
-     */
-    public static PropertyState referenceProperty(String name, Iterable<String> values) {
-        return new GenericsPropertyState(name, values, REFERENCES);
-    }
-
-    /**
-     * Create a multi valued {@code PropertyState} from a list of weak references.
-     * No validation is performed on the strings passed for {@code values}.
-     * @param name  The name of the property state
-     * @param values  The values of the property state
-     * @return  The new property state of type {@link Type#WEAKREFERENCES}
-     */
-    public static PropertyState weakreferenceProperty(String name, Iterable<String> values) {
-        return new GenericsPropertyState(name, values, WEAKREFERENCES);
-    }
-
-    /**
-     * Create a multi valued {@code PropertyState} from a list of URIs.
-     * No validation is performed on the strings passed for {@code values}.
-     * @param name  The name of the property state
-     * @param values  The values of the property state
-     * @return  The new property state of type {@link Type#URIS}
-     */
-    public static PropertyState uriProperty(String name, Iterable<String> values) {
-        return new GenericsPropertyState(name, values, URIS);
-    }
-
-    /**
-     * Create a multi valued {@code PropertyState} from a list of decimals.
-     * @param name  The name of the property state
-     * @param values  The values of the property state
-     * @return  The new property state of type {@link Type#DECIMALS}
-     */
-    public static PropertyState decimalProperty(String name, Iterable<BigDecimal> values) {
-        return new DecimalsPropertyState(name, values);
-    }
-
-    /**
      * Read a {@code PropertyState} from a {@link JsopReader}
      * @param name  The name of the property state
      * @param reader  The reader
@@ -648,21 +291,21 @@ public final class PropertyStates {
             String number = reader.getToken();
             return createProperty(name, number, PropertyType.LONG);
         } else if (reader.matches(JsopReader.TRUE)) {
-            return booleanProperty(name, true);
+            return BooleanPropertyState.booleanProperty(name, true);
         } else if (reader.matches(JsopReader.FALSE)) {
-            return booleanProperty(name, false);
+            return BooleanPropertyState.booleanProperty(name, false);
         } else if (reader.matches(JsopReader.STRING)) {
             String jsonString = reader.getToken();
             if (TypeCodes.startsWithCode(jsonString)) {
                 int type = TypeCodes.getTypeForCode(jsonString.substring(0, 3));
                 String value = jsonString.substring(4);
                 if (type == PropertyType.BINARY) {
-                    return binaryProperty(name, new KernelBlob(value, kernel));
+                    return  BinaryPropertyState.binaryProperty(name, new KernelBlob(value, kernel));
                 } else {
                     return createProperty(name, value, type);
                 }
             } else {
-                return stringProperty(name, jsonString);
+                return StringPropertyState.stringProperty(name, jsonString);
             }
         } else {
             throw new IllegalArgumentException("Unexpected token: " + reader.getToken());

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/StringPropertyState.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/StringPropertyState.java?rev=1400898&r1=1400897&r2=1400898&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/StringPropertyState.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/StringPropertyState.java Mon Oct 22 14:41:25 2012
@@ -18,6 +18,7 @@
  */
 package org.apache.jackrabbit.oak.plugins.memory;
 
+import org.apache.jackrabbit.oak.api.PropertyState;
 import org.apache.jackrabbit.oak.api.Type;
 import org.apache.jackrabbit.oak.plugins.value.Conversions;
 import org.apache.jackrabbit.oak.plugins.value.Conversions.Converter;
@@ -32,6 +33,16 @@ public class StringPropertyState extends
         this.value = value;
     }
 
+    /**
+     * Create a {@code PropertyState} from a string.
+     * @param name  The name of the property state
+     * @param value  The value of the property state
+     * @return  The new property state of type {@link Type#STRING}
+     */
+    public static PropertyState stringProperty(String name, String value) {
+        return new StringPropertyState(name, value);
+    }
+
     @Override
     public String getValue() {
         return value;



Mime
View raw message