@Test public void testConvertToString1() { InPlaceUuidValueEditor editor = new InPlaceUuidValueEditor(); byte[] bytes = new byte[] { ( byte ) 0x6b, ( byte ) 0xa7, ( byte ) 0xb8, ( byte ) 0x10, ( byte ) 0x9d, ( byte ) 0xad, ( byte ) 0x11, ( byte ) 0xd1, ( byte ) 0x80, ( byte ) 0xb4, ( byte ) 0x00, ( byte ) 0xc0, ( byte ) 0x4f, ( byte ) 0xd4, ( byte ) 0x30, ( byte ) 0xc8 }; String displayValue = editor.convertToString( bytes ); assertEquals( Strings.toLowerCaseAscii( "6ba7b810-9dad-11d1-80b4-00c04fd430c8" ), displayValue ); }
String convertToString( byte[] bytes ) { if ( bytes == null || bytes.length != 16 ) { return Messages.getString( "InPlaceUuidValueEditor.InvalidUuid" ); } char[] hex = Hex.encodeHex( bytes ); StringBuffer sb = new StringBuffer(); sb.append( hex, 0, 8 ); sb.append( '-' ); sb.append( hex, 8, 4 ); sb.append( '-' ); sb.append( hex, 12, 4 ); sb.append( '-' ); sb.append( hex, 16, 4 ); sb.append( '-' ); sb.append( hex, 20, 12 ); return Strings.toLowerCase( sb.toString() ); }
InPlaceUuidValueEditor extends HexValueEditor { String convertToString( byte[] bytes ) { if ( bytes == null || bytes.length != 16 ) { return Messages.getString( "InPlaceUuidValueEditor.InvalidUuid" ); } char[] hex = Hex.encodeHex( bytes ); StringBuffer sb = new StringBuffer(); sb.append( hex, 0, 8 ); sb.append( '-' ); sb.append( hex, 8, 4 ); sb.append( '-' ); sb.append( hex, 12, 4 ); sb.append( '-' ); sb.append( hex, 16, 4 ); sb.append( '-' ); sb.append( hex, 20, 12 ); return Strings.toLowerCase( sb.toString() ); } }
InPlaceUuidValueEditor extends HexValueEditor { String convertToString( byte[] bytes ) { if ( bytes == null || bytes.length != 16 ) { return Messages.getString( "InPlaceUuidValueEditor.InvalidUuid" ); } char[] hex = Hex.encodeHex( bytes ); StringBuffer sb = new StringBuffer(); sb.append( hex, 0, 8 ); sb.append( '-' ); sb.append( hex, 8, 4 ); sb.append( '-' ); sb.append( hex, 12, 4 ); sb.append( '-' ); sb.append( hex, 16, 4 ); sb.append( '-' ); sb.append( hex, 20, 12 ); return Strings.toLowerCase( sb.toString() ); }  }
InPlaceUuidValueEditor extends HexValueEditor { String convertToString( byte[] bytes ) { if ( bytes == null || bytes.length != 16 ) { return Messages.getString( "InPlaceUuidValueEditor.InvalidUuid" ); } char[] hex = Hex.encodeHex( bytes ); StringBuffer sb = new StringBuffer(); sb.append( hex, 0, 8 ); sb.append( '-' ); sb.append( hex, 8, 4 ); sb.append( '-' ); sb.append( hex, 12, 4 ); sb.append( '-' ); sb.append( hex, 16, 4 ); sb.append( '-' ); sb.append( hex, 20, 12 ); return Strings.toLowerCase( sb.toString() ); }  String getDisplayValue( IValue value ); }
InPlaceUuidValueEditor extends HexValueEditor { String convertToString( byte[] bytes ) { if ( bytes == null || bytes.length != 16 ) { return Messages.getString( "InPlaceUuidValueEditor.InvalidUuid" ); } char[] hex = Hex.encodeHex( bytes ); StringBuffer sb = new StringBuffer(); sb.append( hex, 0, 8 ); sb.append( '-' ); sb.append( hex, 8, 4 ); sb.append( '-' ); sb.append( hex, 12, 4 ); sb.append( '-' ); sb.append( hex, 16, 4 ); sb.append( '-' ); sb.append( hex, 20, 12 ); return Strings.toLowerCase( sb.toString() ); }  String getDisplayValue( IValue value );  }