1 package org.jbpm.identity; 2 3 import java.io.*; 4 import java.security.*; 5 import java.util.*; 6 7 11 public class Entity implements Serializable { 12 13 private static final long serialVersionUID = 1L; 14 15 long id = 0; 16 protected String name = null; 17 18 protected Set permissions = null; 19 20 22 public Entity() { 23 } 24 25 public Entity(String name) { 26 this.name = name; 27 } 28 29 public Entity(String name, Set permissions) { 30 this.name = name; 31 this.permissions = permissions; 32 } 33 34 36 public void addPermission(Permission permission) { 37 if (permissions==null) permissions = new HashSet(); 38 permissions.add(permission); 39 } 40 public Set getPermissions() { 41 return permissions; 42 } 43 public void removePermission(Permission permission) { 44 if (permissions!=null) { 45 permissions.remove(permission); 46 } 47 } 48 49 51 public long getId() { 52 return id; 53 } 54 public String getName() { 55 return name; 56 } 57 } 58 | Popular Tags |