Example usage for javax.naming.ldap Rdn equals

List of usage examples for javax.naming.ldap Rdn equals

Introduction

In this page you can find the example usage for javax.naming.ldap Rdn equals.

Prototype

public boolean equals(Object obj) 

Source Link

Document

Compares the specified Object with this Rdn for equality.

Usage

From source file:RdntoString.java

public static void main(String args[]) throws Exception {
    Rdn rdn = new Rdn("cn=Juicy\\,Fruit");
    String str = rdn.toString();/*from w  ww  .  j av a  2 s  . c  om*/
    System.out.println(str);
    Rdn rdn2 = new Rdn(str);
    System.out.println(rdn.equals(rdn2)); // true
}

From source file:Main.java

public static void main(String args[]) throws Exception {
    /**//w  w  w .  jav a 2s. co  m
     * Compare: 1) same RDN sequence with an type/value pairs ordered
     * differently. 2) RDN sequence of different length. 3) RDN sequence of
     * different Case.
     */
    Rdn one = new Rdn("ou=Sales+cn=Bob");
    Rdn two = new Rdn("cn=Bob+ou=Sales");
    Rdn three = new Rdn("ou=Sales+cn=Bob+c=US");
    Rdn four = new Rdn("cn=lowercase");
    Rdn five = new Rdn("cn=LowerCASE");
    System.out.println(one.equals(two)); // true
    System.out.println(two.equals(three)); // false
    System.out.println(one.equals(three)); // false
    System.out.println(four.equals(five)); // true
}

From source file:CompareRdns.java

public static void main(String args[]) throws Exception {

    /**//from   w w w .ja v  a2 s .c o m
     * Compare: 1) same RDN sequence with an type/value pairs ordered
     * differently. 2) RDN sequence of different length. 3) RDN sequence of
     * different Case.
     */
    Rdn one = new Rdn("ou=Sales+cn=Bob");
    Rdn two = new Rdn("cn=Bob+ou=Sales");
    Rdn three = new Rdn("ou=Sales+cn=Bob+c=US");
    Rdn four = new Rdn("cn=lowercase");
    Rdn five = new Rdn("cn=LowerCASE");
    System.out.println(one.equals(two)); // true
    System.out.println(two.equals(three)); // false
    System.out.println(one.equals(three)); // false
    System.out.println(four.equals(five)); // true
}