Explore JSon approach
[lgpl/argeo-commons.git] / security / runtime / org.argeo.security.core / src / main / java / org / argeo / security / UserNature.java
index eceed398005fb04b3075341ce7565e59568a60c3..f0bff97e8bf9547274f8fbe5254a24a69ddf26a5 100644 (file)
@@ -1,5 +1,40 @@
 package org.argeo.security;
 
-public interface UserNature {
+import java.util.UUID;
 
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+//@JsonAutoDetect(value = { JsonMethod.GETTER, JsonMethod.SETTER })
+public class UserNature {
+       private final static Log log = LogFactory.getLog(UserNature.class);
+
+       private String uuid = UUID.randomUUID().toString();
+       private String type;
+
+       public String getUuid() {
+               return uuid;
+       }
+
+       public void setUuid(String uuid) {
+               this.uuid = uuid;
+       }
+
+       public String getType() {
+               if (type != null)
+                       return type;
+               else
+                       return getClass().getName();
+       }
+
+       public void setType(String type) {
+               this.type = type;
+       }
+
+//     @JsonAnySetter
+//     public void anySetter(String key, Object obj) {
+//             if (obj != null)
+//                     log.info("anySetter: " + key + "=" + obj + " (" + obj.getClass()
+//                                     + "), natureType=" + type);
+//     }
 }