org.apache.directory.server.replication.configuration
Class ReplicaId

java.lang.Object
  extended by org.apache.directory.server.replication.configuration.ReplicaId
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable

public class ReplicaId
extends java.lang.Object
implements java.lang.Comparable, java.io.Serializable

Store a replica ID after having normalized it. The normalization proces checks that the submitted id is valid, ie contains only this char set : { '-', '_', 'a..z', 'A..Z', '0..9' } and its length is between 1 and 16.

Author:
Apache Directory Project
See Also:
Serialized Form

Constructor Summary
ReplicaId(java.lang.String id)
          Creates a new instance of ReplicaId.
 
Method Summary
 int compareTo(java.lang.Object o)
          Compares this object with the specified object for order.
 boolean equals(java.lang.Object o)
          Indicates whether some other object is "equal to" this one
 java.lang.String getId()
           
 int hashCode()
          Returns a hash code value for the object.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ReplicaId

public ReplicaId(java.lang.String id)
Creates a new instance of ReplicaId. The id must be a String which respect the pattern : [-_a-zA-Z0-9]* and must be between 1 and 16 chars length

Parameters:
id - The replica pattern
Method Detail

getId

public java.lang.String getId()
Returns:
The replicaId

hashCode

public int hashCode()
Returns a hash code value for the object.

Overrides:
hashCode in class java.lang.Object
Returns:
a hash code value for this object.

equals

public boolean equals(java.lang.Object o)
Indicates whether some other object is "equal to" this one

Overrides:
equals in class java.lang.Object
Parameters:
o - the reference object with which to compare.
Returns:
true if this object is the same as the obj argument; false otherwise.

compareTo

public int compareTo(java.lang.Object o)
Compares this object with the specified object for order. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.

Specified by:
compareTo in interface java.lang.Comparable
Parameters:
o - 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.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
Returns:
the Replica Id


Copyright © 2003-2009 Apache Software Foundation. All Rights Reserved.