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

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

public static class PropertyParser.Pair
extends java.lang.Object
implements java.lang.Comparable

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


Constructor Summary
PropertyParser.Pair(java.lang.String key, java.lang.String suffix)
          Creates a new instance of this class.
 
Method Summary
 int compareTo(java.lang.Object o)
          Compares this property pair with another.
 boolean equals(java.lang.Object obj)
           
 java.lang.String getKey()
          Returns the property sort key
 java.lang.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.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PropertyParser.Pair

public PropertyParser.Pair(java.lang.String key,
                           java.lang.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 java.lang.String getKey()
Returns the property sort key

Returns:
the property sort key

getSuffix

public java.lang.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(java.lang.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 java.lang.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 java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 2009 Atlassian Pty Ltd. All Rights Reserved.