com.atlassian.crowd.integration.osuser
Class PropertyParser.Pair

java.lang.Object
  extended by com.atlassian.crowd.integration.osuser.PropertyParser.Pair
All Implemented Interfaces:
Comparable
Enclosing class:
PropertyParser

public static class PropertyParser.Pair
extends Object
implements Comparable

This class implements the holder for the property sort key and suffix.


Constructor Summary
PropertyParser.Pair(String key, String suffix)
          Creates a new instance of this class.
 
Method Summary
 int compareTo(Object o)
          Compares this property pair with another.
 boolean equals(Object obj)
           
 String getKey()
          Returns the property sort key
 String getSuffix()
          Returns the property suffix
 int hashCode()
           
 boolean hasSuffix()
          Returns true if this pair has a property suffix (not null and not empty string), false otherwise.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PropertyParser.Pair

public PropertyParser.Pair(String key,
                           String suffix)
Creates a new instance of this class. It is immutable and the key is required. If the key is not passed in it throws new NullPointerException.

Parameters:
key - property sort key
suffix - property suffix
Method Detail

getKey

public String getKey()
Returns the property sort key

Returns:
the property sort key

getSuffix

public String getSuffix()
Returns the property suffix

Returns:
the property suffix

hasSuffix

public boolean hasSuffix()
Returns true if this pair has a property suffix (not null and not empty string), false otherwise.

Returns:
true if this pair has a property suffix, false otherwise.

compareTo

public int compareTo(Object o)
Compares this property pair with another. It returns the result of comparison of the property sort keys, unless they are equal. If the sort keys are equal it returns the result of suffix comparison.

Specified by:
compareTo in interface Comparable
Parameters:
o - another instance of Pair to compare to
Returns:
0 if they are equal, grater than 0 if this pair is greater than the other, less than 0 otherwise

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2006 Atlassian Software Systems. All Rights Reserved.