@Test public void testTruncateWhenItIsNotTruncated() { final String actualTruncate = card.truncate("12345", 5); final String expectedTruncate = "12345"; assertEquals(expectedTruncate, actualTruncate); }
String truncate(final String value, final int limit) { if (value.length() > limit) { return "..." + value.substring(value.length() - limit); } return value; }
BaseCardComponent implements CardComponent { String truncate(final String value, final int limit) { if (value.length() > limit) { return "..." + value.substring(value.length() - limit); } return value; } }
BaseCardComponent implements CardComponent { String truncate(final String value, final int limit) { if (value.length() > limit) { return "..." + value.substring(value.length() - limit); } return value; } BaseCardComponent(final V contentView,
                             final Event<RefreshDecisionComponents> refreshDecisionComponentsEvent); }
BaseCardComponent implements CardComponent { String truncate(final String value, final int limit) { if (value.length() > limit) { return "..." + value.substring(value.length() - limit); } return value; } BaseCardComponent(final V contentView,
                             final Event<RefreshDecisionComponents> refreshDecisionComponentsEvent); @PostConstruct void init(); void setup(final DMNCardsGridComponent grid,
                      final R includedModel); @Override HasCssName getIcon(); @Override String getTitle(); @Override String getUUID(); @Override HTMLElement getContent(); @Override Function<String, Boolean> onTitleChanged(); void remove(); }
BaseCardComponent implements CardComponent { String truncate(final String value, final int limit) { if (value.length() > limit) { return "..." + value.substring(value.length() - limit); } return value; } BaseCardComponent(final V contentView,
                             final Event<RefreshDecisionComponents> refreshDecisionComponentsEvent); @PostConstruct void init(); void setup(final DMNCardsGridComponent grid,
                      final R includedModel); @Override HasCssName getIcon(); @Override String getTitle(); @Override String getUUID(); @Override HTMLElement getContent(); @Override Function<String, Boolean> onTitleChanged(); void remove();  }