@Test public void shouldFilterPrivateUnicodeCharactersNull() throws Exception { assertThat(WhatsAppMessage.filterPrivateBlock(null)).isNull(); }
static String filterPrivateBlock(String s) { if (s == null) return null; final StringBuilder sb = new StringBuilder(); for (int i=0; i<s.length(); ) { int codepoint = s.codePointAt(i); Character.UnicodeBlock block = Character.UnicodeBlock.of(codepoint); if (block != Character.UnicodeBlock.PRIVATE_USE_AREA) { sb.append(Character.toChars(codepoint)); } i += Character.charCount(codepoint); } return sb.toString(); }
WhatsAppMessage implements Comparable<WhatsAppMessage> { static String filterPrivateBlock(String s) { if (s == null) return null; final StringBuilder sb = new StringBuilder(); for (int i=0; i<s.length(); ) { int codepoint = s.codePointAt(i); Character.UnicodeBlock block = Character.UnicodeBlock.of(codepoint); if (block != Character.UnicodeBlock.PRIVATE_USE_AREA) { sb.append(Character.toChars(codepoint)); } i += Character.charCount(codepoint); } return sb.toString(); } }
WhatsAppMessage implements Comparable<WhatsAppMessage> { static String filterPrivateBlock(String s) { if (s == null) return null; final StringBuilder sb = new StringBuilder(); for (int i=0; i<s.length(); ) { int codepoint = s.codePointAt(i); Character.UnicodeBlock block = Character.UnicodeBlock.of(codepoint); if (block != Character.UnicodeBlock.PRIVATE_USE_AREA) { sb.append(Character.toChars(codepoint)); } i += Character.charCount(codepoint); } return sb.toString(); } WhatsAppMessage();  WhatsAppMessage(Cursor c); }
WhatsAppMessage implements Comparable<WhatsAppMessage> { static String filterPrivateBlock(String s) { if (s == null) return null; final StringBuilder sb = new StringBuilder(); for (int i=0; i<s.length(); ) { int codepoint = s.codePointAt(i); Character.UnicodeBlock block = Character.UnicodeBlock.of(codepoint); if (block != Character.UnicodeBlock.PRIVATE_USE_AREA) { sb.append(Character.toChars(codepoint)); } i += Character.charCount(codepoint); } return sb.toString(); } WhatsAppMessage();  WhatsAppMessage(Cursor c); long getId(); boolean isReceived(); Date getTimestamp(); String getText(); String getFilteredText(); int getStatus(); double getLongitude(); double getLatitude(); int getRecipientCount(); String getNumber(); Media getMedia(); Receipt getReceipt(); boolean hasMediaAttached(); boolean hasText(); @Override String toString(); @Override int compareTo(WhatsAppMessage another); boolean isDirectMessage(); boolean isGroupMessage(); }
WhatsAppMessage implements Comparable<WhatsAppMessage> { static String filterPrivateBlock(String s) { if (s == null) return null; final StringBuilder sb = new StringBuilder(); for (int i=0; i<s.length(); ) { int codepoint = s.codePointAt(i); Character.UnicodeBlock block = Character.UnicodeBlock.of(codepoint); if (block != Character.UnicodeBlock.PRIVATE_USE_AREA) { sb.append(Character.toChars(codepoint)); } i += Character.charCount(codepoint); } return sb.toString(); } WhatsAppMessage();  WhatsAppMessage(Cursor c); long getId(); boolean isReceived(); Date getTimestamp(); String getText(); String getFilteredText(); int getStatus(); double getLongitude(); double getLatitude(); int getRecipientCount(); String getNumber(); Media getMedia(); Receipt getReceipt(); boolean hasMediaAttached(); boolean hasText(); @Override String toString(); @Override int compareTo(WhatsAppMessage another); boolean isDirectMessage(); boolean isGroupMessage(); static final String TABLE; static final String GROUP; static final String DIRECT; }