]> git.argeo.org Git - lgpl/argeo-commons.git/blobdiff - org.argeo.api/src/org/argeo/api/gcr/Content.java
Start integrating GCR and JCR (not yet working)
[lgpl/argeo-commons.git] / org.argeo.api / src / org / argeo / api / gcr / Content.java
index c5cee9f0e6676495acd7f791a98204bec9f6c8d8..b032aa7b888020dce1779b34d0434ee36613fd28 100644 (file)
@@ -2,6 +2,9 @@ package org.argeo.api.gcr;
 
 import java.util.Map;
 
+/**
+ * A semi-structured content, with attributes, within a hierarchical structure.
+ */
 public interface Content extends Iterable<Content>, Map<String, Object> {
 
        String getName();
@@ -10,7 +13,7 @@ public interface Content extends Iterable<Content>, Map<String, Object> {
 
        <A> A get(String key, Class<A> clss);
 
-       ContentSession getSession();
+//     ContentSession getSession();
 
        /*
         * DEFAULT METHODS
@@ -26,12 +29,12 @@ public interface Content extends Iterable<Content>, Map<String, Object> {
                return get(key, String.class);
        }
 
-       default String attr(Enum<?> key) {
-               return attr(key.name());
+       default String attr(Object key) {
+               return key != null ? attr(key.toString()) : attr(null);
        }
 
-       default <A> A get(Enum<?> key, Class<A> clss) {
-               return get(key.name(), clss);
+       default <A> A get(Object key, Class<A> clss) {
+               return key != null ? get(key.toString(), clss) : get(null, clss);
        }
 
        /*