comparerdns.java

来自「JAVA 工作指南 可以说是程序员必备的东西哦」· Java 代码 · 共 31 行

JAVA
31
字号
import javax.naming.ldap.*;import java.util.ArrayList;import java.util.List;import javax.naming.InvalidNameException;/** * Demonstrates RDN comparison */public class CompareRdns {    public static void main(String args[])		throws Exception {	/**	 * 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    }}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?