@Test public void bankCardNoHide() { Assert .assertEquals("330104*********2007", SensitiveUtils.bankCardNoHide("3301040160000852007")); Assert.assertEquals("33010*****0008", SensitiveUtils.bankCardNoHide("33010401600008")); }
public String bankCardNoHide(String data) { if (!Strings.hasText(data)) { return data; } if (data.length() >= BANK_CARD_LENGTH) { return customizeHide(data, 6, 4, data.length() - 10); } else { return defaultHide(data); } }
SensitiveUtils { public String bankCardNoHide(String data) { if (!Strings.hasText(data)) { return data; } if (data.length() >= BANK_CARD_LENGTH) { return customizeHide(data, 6, 4, data.length() - 10); } else { return defaultHide(data); } } }
SensitiveUtils { public String bankCardNoHide(String data) { if (!Strings.hasText(data)) { return data; } if (data.length() >= BANK_CARD_LENGTH) { return customizeHide(data, 6, 4, data.length() - 10); } else { return defaultHide(data); } }  }
SensitiveUtils { public String bankCardNoHide(String data) { if (!Strings.hasText(data)) { return data; } if (data.length() >= BANK_CARD_LENGTH) { return customizeHide(data, 6, 4, data.length() - 10); } else { return defaultHide(data); } }  String nameHide(final String data); String idCardNoHide(String data); String bankCardNoHide(String data); String cellphoneHide(String data); String emailHide(String data); String defaultHide(String data); String customizeHide(String data, int front, int tail, int hidden); }
SensitiveUtils { public String bankCardNoHide(String data) { if (!Strings.hasText(data)) { return data; } if (data.length() >= BANK_CARD_LENGTH) { return customizeHide(data, 6, 4, data.length() - 10); } else { return defaultHide(data); } }  String nameHide(final String data); String idCardNoHide(String data); String bankCardNoHide(String data); String cellphoneHide(String data); String emailHide(String data); String defaultHide(String data); String customizeHide(String data, int front, int tail, int hidden);  }