org.glassfish.admingui.common.handlers
Class Tag

java.lang.Object
  extended by org.glassfish.admingui.common.handlers.Tag
All Implemented Interfaces:
java.io.Serializable

public class Tag
extends java.lang.Object
implements java.io.Serializable

Tag Class.

Author:
Ken Paulsen (ken.paulsen@sun.com)
See Also:
Serialized Form

Constructor Summary
Tag(java.lang.String tagName, java.lang.String tagViewId, java.lang.String displayName, java.lang.String user)
           The constructor that should normally be used.
 
Method Summary
 void addUser(java.lang.String name)
           Allows an additional user to be added as a Tag creator.
 boolean containsUser(java.lang.String name)
           Checks to see if the given user is an owner of this Tag.
 boolean equals(java.lang.Object obj)
           This implementation of equals only checks the tagName and the tagViewId for equality.
 java.lang.String getDisplayName()
           This returns a String that is meaningful to the user which represents the content of this Tag instance.
 java.lang.String getTagName()
           This provides access to the tag name.
 java.lang.String getTagViewId()
           This provides access to the TagViewId value.
 java.util.List<java.lang.String> getUsers()
           Provides access to all the users that have created this Tag.
 int hashCode()
           
 java.util.List<java.lang.String> removeUser(java.lang.String name)
           This method ensures the specified user is removed from the list of users for this Tag.
 java.lang.String toString()
           String representation of this Tag.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Tag

public Tag(java.lang.String tagName,
           java.lang.String tagViewId,
           java.lang.String displayName,
           java.lang.String user)

The constructor that should normally be used.

Method Detail

addUser

public void addUser(java.lang.String name)

Allows an additional user to be added as a Tag creator.


getUsers

public java.util.List<java.lang.String> getUsers()

Provides access to all the users that have created this Tag. This may be null.


containsUser

public boolean containsUser(java.lang.String name)

Checks to see if the given user is an owner of this Tag.


removeUser

public java.util.List<java.lang.String> removeUser(java.lang.String name)

This method ensures the specified user is removed from the list of users for this Tag.

While a Tag is of little or no use when 0 users own the Tag, it is not the responsibility of this method to remove the Tag if this state occurs as a result of a call to this method.

Returns:
The List of users remaining after removing this user, or null if none.

equals

public boolean equals(java.lang.Object obj)

This implementation of equals only checks the tagName and the tagViewId for equality. This means 2 tags with different user Lists are still considered equal. The Display Name is also of no importance to this implementation of equality.

Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

toString

public java.lang.String toString()

String representation of this Tag.

Overrides:
toString in class java.lang.Object

getTagName

public java.lang.String getTagName()

This provides access to the tag name.


getTagViewId

public java.lang.String getTagViewId()

This provides access to the TagViewId value.


getDisplayName

public java.lang.String getDisplayName()

This returns a String that is meaningful to the user which represents the content of this Tag instance.



Copyright © 2012 GlassFish Community. All Rights Reserved.