@Test public void testGetComposedId() { assertEquals("dmnshape-page-1-_1111-2222", getComposedId("dmnshape", "page 1", "_1111-2222")); assertEquals("dmnshape-page-1-_1111-2222", getComposedId("dmnshape", "page 1 ", "_1111-2222")); assertEquals("dmnshape-_1111-2222", getComposedId("dmnshape", "", "_1111-2222")); assertEquals("dmnshape-_1111-2222", getComposedId("dmnshape", "_1111-2222")); }
public static String getComposedId(final String... parts) { return Stream.of(parts) .filter(s -> !isEmpty(s)) .map(s -> s.trim().replaceAll("\\s+", COMBINER_DELIMITER)) .collect(Collectors.joining(COMBINER_DELIMITER)); }
IdUtils { public static String getComposedId(final String... parts) { return Stream.of(parts) .filter(s -> !isEmpty(s)) .map(s -> s.trim().replaceAll("\\s+", COMBINER_DELIMITER)) .collect(Collectors.joining(COMBINER_DELIMITER)); } }
IdUtils { public static String getComposedId(final String... parts) { return Stream.of(parts) .filter(s -> !isEmpty(s)) .map(s -> s.trim().replaceAll("\\s+", COMBINER_DELIMITER)) .collect(Collectors.joining(COMBINER_DELIMITER)); }  }
IdUtils { public static String getComposedId(final String... parts) { return Stream.of(parts) .filter(s -> !isEmpty(s)) .map(s -> s.trim().replaceAll("\\s+", COMBINER_DELIMITER)) .collect(Collectors.joining(COMBINER_DELIMITER)); }  static String getPrefixedId(final String prefixId,
                                       final String rawId); static String getRawId(final String prefixedId); static String getComposedId(final String... parts); static String getShapeId(final JSIDMNDiagram diagram,
                                    final List<String> dmnElementIds,
                                    final String dmnElementId); static String getEdgeId(final JSIDMNDiagram diagram,
                                   final List<String> dmnElementIds,
                                   final String dmnElementId); static String uniqueId(); }
IdUtils { public static String getComposedId(final String... parts) { return Stream.of(parts) .filter(s -> !isEmpty(s)) .map(s -> s.trim().replaceAll("\\s+", COMBINER_DELIMITER)) .collect(Collectors.joining(COMBINER_DELIMITER)); }  static String getPrefixedId(final String prefixId,
                                       final String rawId); static String getRawId(final String prefixedId); static String getComposedId(final String... parts); static String getShapeId(final JSIDMNDiagram diagram,
                                    final List<String> dmnElementIds,
                                    final String dmnElementId); static String getEdgeId(final JSIDMNDiagram diagram,
                                   final List<String> dmnElementIds,
                                   final String dmnElementId); static String uniqueId();  }