com.atlassian.crowd.embedded.impl
Class ImmutableGroup

java.lang.Object
  extended by com.atlassian.crowd.embedded.impl.ImmutableGroup
All Implemented Interfaces:
Group, Serializable, Comparable<Group>

public class ImmutableGroup
extends Object
implements Group, Serializable

A general purpose immutable implementation of the Group interface.

Note: This object does not allow null name.

See Also:
Serialized Form

Constructor Summary
ImmutableGroup(String name)
           
 
Method Summary
 int compareTo(Group other)
          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 java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ImmutableGroup

public ImmutableGroup(@Nonnull
                      String name)
Method Detail

getName

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

compareTo

public int compareTo(Group other)
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:
other - 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 © 2013 Atlassian. All Rights Reserved.