sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From o...@apache.org
Subject [sling-org-apache-sling-clam] 04/05: add values from names conversion util for JCR property types
Date Thu, 31 Jan 2019 10:43:48 GMT
This is an automated email from the ASF dual-hosted git repository.

olli pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-clam.git

commit 466b1c335869e36ace532c26c06ed3b30af18ff8
Author: Oliver Lietz <olli@apache.org>
AuthorDate: Thu Jan 31 11:33:28 2019 +0100

    add values from names conversion util for JCR property types
---
 src/main/java/org/apache/sling/clam/internal/ClamUtil.java | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/src/main/java/org/apache/sling/clam/internal/ClamUtil.java b/src/main/java/org/apache/sling/clam/internal/ClamUtil.java
index 99a882e..e85b0f3 100644
--- a/src/main/java/org/apache/sling/clam/internal/ClamUtil.java
+++ b/src/main/java/org/apache/sling/clam/internal/ClamUtil.java
@@ -19,7 +19,9 @@
 package org.apache.sling.clam.internal;
 
 import java.util.HashMap;
+import java.util.HashSet;
 import java.util.Map;
+import java.util.Set;
 
 import javax.jcr.PropertyType;
 
@@ -83,4 +85,13 @@ public final class ClamUtil {
         return length <= maxLength;
     }
 
+    public static Set<Integer> propertyTypesFromNames(@NotNull final String[] names)
throws Exception {
+        final Set<Integer> propertyTypes = new HashSet<>();
+        for (final String name : names) {
+            final int propertyType = PropertyType.valueFromName(name);
+            propertyTypes.add(propertyType);
+        }
+        return propertyTypes;
+    }
+
 }


Mime
View raw message