@Test public void testConvertToStringNull() { InPlaceMsAdObjectGuidValueEditor editor = new InPlaceMsAdObjectGuidValueEditor(); byte[] bytes = null; String displayValue = editor.convertToString( bytes ); assertEquals( Messages.getString( "InPlaceMsAdObjectGuidValueEditor.InvalidGuid" ), displayValue ); }
String convertToString( byte[] bytes ) { if (( bytes == null ) || ( bytes.length != 16 ) ) { return Messages.getString( "InPlaceMsAdObjectGuidValueEditor.InvalidGuid" ); } char[] hex = Hex.encodeHex( bytes ); StringBuffer sb = new StringBuffer(); sb.append( '{' ); sb.append( hex, 6, 2 ); sb.append( hex, 4, 2 ); sb.append( hex, 2, 2 ); sb.append( hex, 0, 2 ); sb.append( '-' ); sb.append( hex, 10, 2 ); sb.append( hex, 8, 2 ); sb.append( '-' ); sb.append( hex, 14, 2 ); sb.append( hex, 12, 2 ); sb.append( '-' ); sb.append( hex, 16, 4 ); sb.append( '-' ); sb.append( hex, 20, 12 ); sb.append( '}' ); return Strings.toLowerCase( sb.toString() ); }
InPlaceMsAdObjectGuidValueEditor extends HexValueEditor { String convertToString( byte[] bytes ) { if (( bytes == null ) || ( bytes.length != 16 ) ) { return Messages.getString( "InPlaceMsAdObjectGuidValueEditor.InvalidGuid" ); } char[] hex = Hex.encodeHex( bytes ); StringBuffer sb = new StringBuffer(); sb.append( '{' ); sb.append( hex, 6, 2 ); sb.append( hex, 4, 2 ); sb.append( hex, 2, 2 ); sb.append( hex, 0, 2 ); sb.append( '-' ); sb.append( hex, 10, 2 ); sb.append( hex, 8, 2 ); sb.append( '-' ); sb.append( hex, 14, 2 ); sb.append( hex, 12, 2 ); sb.append( '-' ); sb.append( hex, 16, 4 ); sb.append( '-' ); sb.append( hex, 20, 12 ); sb.append( '}' ); return Strings.toLowerCase( sb.toString() ); } }
InPlaceMsAdObjectGuidValueEditor extends HexValueEditor { String convertToString( byte[] bytes ) { if (( bytes == null ) || ( bytes.length != 16 ) ) { return Messages.getString( "InPlaceMsAdObjectGuidValueEditor.InvalidGuid" ); } char[] hex = Hex.encodeHex( bytes ); StringBuffer sb = new StringBuffer(); sb.append( '{' ); sb.append( hex, 6, 2 ); sb.append( hex, 4, 2 ); sb.append( hex, 2, 2 ); sb.append( hex, 0, 2 ); sb.append( '-' ); sb.append( hex, 10, 2 ); sb.append( hex, 8, 2 ); sb.append( '-' ); sb.append( hex, 14, 2 ); sb.append( hex, 12, 2 ); sb.append( '-' ); sb.append( hex, 16, 4 ); sb.append( '-' ); sb.append( hex, 20, 12 ); sb.append( '}' ); return Strings.toLowerCase( sb.toString() ); }  }
InPlaceMsAdObjectGuidValueEditor extends HexValueEditor { String convertToString( byte[] bytes ) { if (( bytes == null ) || ( bytes.length != 16 ) ) { return Messages.getString( "InPlaceMsAdObjectGuidValueEditor.InvalidGuid" ); } char[] hex = Hex.encodeHex( bytes ); StringBuffer sb = new StringBuffer(); sb.append( '{' ); sb.append( hex, 6, 2 ); sb.append( hex, 4, 2 ); sb.append( hex, 2, 2 ); sb.append( hex, 0, 2 ); sb.append( '-' ); sb.append( hex, 10, 2 ); sb.append( hex, 8, 2 ); sb.append( '-' ); sb.append( hex, 14, 2 ); sb.append( hex, 12, 2 ); sb.append( '-' ); sb.append( hex, 16, 4 ); sb.append( '-' ); sb.append( hex, 20, 12 ); sb.append( '}' ); return Strings.toLowerCase( sb.toString() ); }  String getDisplayValue( IValue value ); }
InPlaceMsAdObjectGuidValueEditor extends HexValueEditor { String convertToString( byte[] bytes ) { if (( bytes == null ) || ( bytes.length != 16 ) ) { return Messages.getString( "InPlaceMsAdObjectGuidValueEditor.InvalidGuid" ); } char[] hex = Hex.encodeHex( bytes ); StringBuffer sb = new StringBuffer(); sb.append( '{' ); sb.append( hex, 6, 2 ); sb.append( hex, 4, 2 ); sb.append( hex, 2, 2 ); sb.append( hex, 0, 2 ); sb.append( '-' ); sb.append( hex, 10, 2 ); sb.append( hex, 8, 2 ); sb.append( '-' ); sb.append( hex, 14, 2 ); sb.append( hex, 12, 2 ); sb.append( '-' ); sb.append( hex, 16, 4 ); sb.append( '-' ); sb.append( hex, 20, 12 ); sb.append( '}' ); return Strings.toLowerCase( sb.toString() ); }  String getDisplayValue( IValue value );  }