Class CmsDefaultSet<T>

java.lang.Object
org.opencms.util.CmsDefaultSet<T>
Type Parameters:
T - the element type
All Implemented Interfaces:
com.google.gwt.user.client.rpc.IsSerializable

public class CmsDefaultSet<T> extends Object implements com.google.gwt.user.client.rpc.IsSerializable
A utility class used for keeping track of a set of objects. You can explicitly include or exclude objects, and define a default membership value for those objects whose membership hasn't been explicitly set.

  • Constructor Details

  • Method Details

    • checkNotFrozen

      public void checkNotFrozen()
      Checks that this object isn't frozen.

    • contains

      public boolean contains(T value)
      Returns true if the given object is a member of this set.

      Parameters:
      value - the value to check
      Returns:
      true if the value is a member
    • freeze

      public void freeze()
      Makes the object unmodifiable.

    • getBaseMap

      public Map<T,Boolean> getBaseMap()
      Gets the map internally used for storing the membership statuses.

      Returns:
      the membership map
    • getDefaultMembership

      public boolean getDefaultMembership()
      Gets the default membership value.

      Returns:
      the default membership value
    • setContains

      public void setContains(T value, boolean isMember)
      Sets the membership of an object.

      Parameters:
      value - the object
      isMember - true if the object should be a member, otherwise false
    • setDefaultMembership

      public void setDefaultMembership(boolean defaultMembership)
      Sets the default membership value.

      Parameters:
      defaultMembership - the new value