public LdapRdn immutableLdapRdn ( ) { Map < String , LdapRdnComponent > mapWithImmutableRdns = new LinkedHashMap < String , LdapRdnComponent > ( components . size ( ) ) ; for ( Iterator iterator = components . values ( ) . iterator ( ) ; iterator . hasNext ( ) ; ) { LdapRdnComponent rdnComponent = ( LdapRdnComponent ) iterator . next ( ) ; mapWithImmutableRdns . put ( rdnComponent . getKey ( ) , rdnComponent . immutableLdapRdnComponent ( ) ) ; } Map < String , LdapRdnComponent > unmodifiableMapOfImmutableRdns = Collections . unmodifiableMap ( mapWithImmutableRdns ) ; LdapRdn immutableRdn = new LdapRdn ( ) ; immutableRdn . components = unmodifiableMapOfImmutableRdns ; return immutableRdn ; }
Create an immutable copy of this instance . It will not be possible to add or remove components or modify the keys and values of these components .