com.atlassian.crowd.embedded.impl
Class DelegatingGroupWithAttributes

java.lang.Object
  extended by com.atlassian.crowd.embedded.impl.AbstractDelegatingEntityWithAttributes
      extended by com.atlassian.crowd.embedded.impl.DelegatingGroupWithAttributes
All Implemented Interfaces:
Attributes, Group, GroupWithAttributes, Comparable<Group>

public class DelegatingGroupWithAttributes
extends AbstractDelegatingEntityWithAttributes
implements GroupWithAttributes

Implementation of GroupWithAttributes that simply delegates to an underlying Group and Attributes object.

Instances of this class will be effectively immutable so long as either:


Constructor Summary
DelegatingGroupWithAttributes(Group group, Attributes attributes)
           
 
Method Summary
 int compareTo(Group group)
          CompareTo must be compatible with the equals() and hashCode() methods
 boolean equals(Object o)
          Implementations must ensure equality based on case-insensitive getName().
 String getName()
           
 int hashCode()
          Implementations must produce a hash-code based on case-insensitive getName().
 
Methods inherited from class com.atlassian.crowd.embedded.impl.AbstractDelegatingEntityWithAttributes
getKeys, getValue, getValues, isEmpty
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.atlassian.crowd.embedded.api.Attributes
getKeys, getValue, getValues, isEmpty
 

Constructor Detail

DelegatingGroupWithAttributes

public DelegatingGroupWithAttributes(Group group,
                                     Attributes attributes)
Method Detail

getName

public String getName()
Specified by:
getName in interface Group
Returns:
name of the group.

compareTo

public int compareTo(Group group)
Description copied from interface: Group
CompareTo must be compatible with the equals() and hashCode() methods

Specified by:
compareTo in interface Group
Specified by:
compareTo in interface Comparable<Group>
Parameters:
group - the object to be compared.
Returns:
a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.

equals

public boolean equals(Object o)
Description copied from interface: Group
Implementations must ensure equality based on case-insensitive getName().

Specified by:
equals in interface Group
Overrides:
equals in class Object
Parameters:
o - object to compare to.
Returns:
true if and only if the names in lowercase of the directory entities match.

hashCode

public int hashCode()
Description copied from interface: Group
Implementations must produce a hash-code based on case-insensitive getName().

Specified by:
hashCode in interface Group
Overrides:
hashCode in class Object
Returns:
hash-code.


Copyright © 2012 Atlassian. All Rights Reserved.