Klasse SecuritySet<T extends SecurityEntity>

java.lang.Object
org.apache.fulcrum.security.util.SecuritySet<T>
Alle implementierten Schnittstellen:
Serializable, Iterable<T>, Collection<T>, Set<T>
Bekannte direkte Unterklassen:
GroupSet, PermissionSet, RoleSet, UserSet

public abstract class SecuritySet<T extends SecurityEntity> extends Object implements Serializable, Set<T>, Iterable<T>
This class represents a set of Security Entities. It makes it easy to build a UI. It wraps a TreeSet object to enforce that only relevant methods are available. TreeSet's contain only unique Objects (no duplicates) based on the ID. They may or may not have a name, that depends on the implementation. Want to get away from requiring an ID and a name... Nothing should force Name to be unique in the basic architecture of Fulcrum Security.
Version:
$Id$
Autor:
Eric Pugh, John D. McNally, Brett McLaughlin, Marco Knüttel, Henning P. Schmiedehausen
Siehe auch:
  • Felddetails

  • Konstruktordetails

    • SecuritySet

      public SecuritySet()
      Constructs an empty Set
  • Methodendetails

    • getSet

      public Set<T> getSet()
      Returns a set of security objects in this object.
      Gibt zurück:
      A Set Object
    • getNames

      public Set<String> getNames()
      Returns a set of Names in this Object.
      Gibt zurück:
      The Set of Names in this Object, backed by the actual data.
    • getIds

      public Set<Object> getIds()
      Returns a set of Id values in this Object.
      Gibt zurück:
      The Set of Ids in this Object, backed by the actual data.
    • clear

      public void clear()
      Removes all Objects from this Set.
      Angegeben von:
      clear in Schnittstelle Collection<T extends SecurityEntity>
      Angegeben von:
      clear in Schnittstelle Set<T extends SecurityEntity>
    • containsName

      public boolean containsName(String name)
      Searches if an Object with a given name is in the Set
      Parameter:
      name - Name of the Security Object.
      Gibt zurück:
      True if argument matched an Object in this Set; false if no match.
    • containsId

      public boolean containsId(Object id)
      Searches if an Object with a given Id is in the Set
      Parameter:
      id - Id of the Security Object.
      Gibt zurück:
      True if argument matched an Object in this Set; false if no match.
    • iterator

      public Iterator<T> iterator()
      Returns an Iterator for Objects in this Set.
      Angegeben von:
      iterator in Schnittstelle Collection<T extends SecurityEntity>
      Angegeben von:
      iterator in Schnittstelle Iterable<T extends SecurityEntity>
      Angegeben von:
      iterator in Schnittstelle Set<T extends SecurityEntity>
      Gibt zurück:
      An iterator for the Set
    • size

      public int size()
      Returns size (cardinality) of this set.
      Angegeben von:
      size in Schnittstelle Collection<T extends SecurityEntity>
      Angegeben von:
      size in Schnittstelle Set<T extends SecurityEntity>
      Gibt zurück:
      The cardinality of this Set.
    • toString

      public String toString()
      list of role names in this set
      Setzt außer Kraft:
      toString in Klasse Object
      Gibt zurück:
      The string representation of this Set.
    • add

      public boolean add(T o)
      Angegeben von:
      add in Schnittstelle Collection<T extends SecurityEntity>
      Angegeben von:
      add in Schnittstelle Set<T extends SecurityEntity>
      Siehe auch:
    • add

      public boolean add(Collection<? extends T> collection)
      Adds the entities in a Collection to this SecuritySet.
      Parameter:
      collection - A Collection of entities.
      Gibt zurück:
      True if this Set changed as a result; false if no change to this Set occurred (this Set already contained all members of the added Set).
    • addAll

      public boolean addAll(Collection<? extends T> collection)
      Angegeben von:
      addAll in Schnittstelle Collection<T extends SecurityEntity>
      Angegeben von:
      addAll in Schnittstelle Set<T extends SecurityEntity>
    • isEmpty

      public boolean isEmpty()
      Angegeben von:
      isEmpty in Schnittstelle Collection<T extends SecurityEntity>
      Angegeben von:
      isEmpty in Schnittstelle Set<T extends SecurityEntity>
    • containsAll

      public boolean containsAll(Collection<?> collection)
      Angegeben von:
      containsAll in Schnittstelle Collection<T extends SecurityEntity>
      Angegeben von:
      containsAll in Schnittstelle Set<T extends SecurityEntity>
    • removeAll

      public boolean removeAll(Collection<?> collection)
      Angegeben von:
      removeAll in Schnittstelle Collection<T extends SecurityEntity>
      Angegeben von:
      removeAll in Schnittstelle Set<T extends SecurityEntity>
    • retainAll

      public boolean retainAll(Collection<?> collection)
      Angegeben von:
      retainAll in Schnittstelle Collection<T extends SecurityEntity>
      Angegeben von:
      retainAll in Schnittstelle Set<T extends SecurityEntity>
    • toArray

      public Object[] toArray()
      Angegeben von:
      toArray in Schnittstelle Collection<T extends SecurityEntity>
      Angegeben von:
      toArray in Schnittstelle Set<T extends SecurityEntity>
    • contains

      public boolean contains(Object o)
      Checks whether this SecuritySet contains an entity.
      Angegeben von:
      contains in Schnittstelle Collection<T extends SecurityEntity>
      Angegeben von:
      contains in Schnittstelle Set<T extends SecurityEntity>
      Parameter:
      o - An entity.
      Gibt zurück:
      True if this Set contains the entity, false otherwise.
    • remove

      public boolean remove(Object o)
      Removes an entity from this SecuritySet.
      Angegeben von:
      remove in Schnittstelle Collection<T extends SecurityEntity>
      Angegeben von:
      remove in Schnittstelle Set<T extends SecurityEntity>
      Parameter:
      o - An entity.
      Gibt zurück:
      True if this Set contained the entity before it was removed.
    • toArray

      public <A> A[] toArray(A[] a)
      Angegeben von:
      toArray in Schnittstelle Collection<T extends SecurityEntity>
      Angegeben von:
      toArray in Schnittstelle Set<T extends SecurityEntity>
    • getByName

      public T getByName(String name)
      Returns an entity with the given name, if it is contained in this SecuritySet.
      Parameter:
      name - Name of entity.
      Gibt zurück:
      entity if argument matched an entity in this Set; null if no match.
    • getById

      public T getById(Object id)
      Returns an entity with the given id, if it is contained in this SecuritySet.
      Parameter:
      id - ID of entity.
      Gibt zurück:
      entity if argument matched an entity in this Set; null if no match.