public static CallerID buildFromComponents ( final String firstname , final String lastname , final String number ) { String name = "" ; //$NON-NLS-1$ if ( firstname != null ) { name += firstname . trim ( ) ; } if ( lastname != null ) { if ( name . length ( ) > 0 ) { name += " " ; //$NON-NLS-1$ } name += lastname . trim ( ) ; } return PBXFactory . getActivePBX ( ) . buildCallerID ( number , name ) ; }
This is a little helper class which will buid the name component of a clid from the first and lastnames . If both firstname and lastname are null then the name component will be an empty string .