Example usage for javax.naming.ldap Rdn size

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

Introduction

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

Prototype

public int size() 

Source Link

Document

Retrieves the number of attribute type/value pairs in this Rdn.

Usage

From source file:RdnGetters.java

public static void main(String args[]) throws Exception {
    Attributes attrs = new BasicAttributes();
    attrs.put("o", "Yellow");
    attrs.put("cn", "Mango");

    byte[] mangoJuice = new byte[6];
    for (int i = 0; i < mangoJuice.length; i++) {
        mangoJuice[i] = (byte) i;
    }//from w w  w  . j ava 2s  . c  o  m
    attrs.put("ou", mangoJuice);
    Rdn rdn = new Rdn(attrs);

    System.out.println();
    System.out.println("size:" + rdn.size());
    System.out.println("getType(): " + rdn.getType());
    System.out.println("getValue(): " + rdn.getValue());

    // test toAttributes
    System.out.println();
    System.out.println("toAttributes(): " + rdn.toAttributes());
}