@Test @DisplayName("KeySet from multiple CompoundParameters") void testKeySetFromMapMultipleCompound() { final var sut = new CompoundParams( new CompoundParams("theId", JVM8Tools.asMap("a", "1", "b", "2")), new CompoundParams("otherID-no one cares", JVM8Tools.asMap("a", "4", "b", "4", "c", "5")) ); Assertions.assertEquals("a,b,c", String.join(",", sut.keySet())); }
@Override public Set<String> keySet() { final Stream<Set<String>> keyStream; if (params != null) { keyStream = Arrays.stream(params).filter(Objects::nonNull) .map(Map::keySet); } else if (cparams != null) { keyStream = Arrays.stream(cparams).filter(Objects::nonNull) .map(CompoundParams::keySet); } else { keyStream = Stream.of(); } return keyStream.filter(Objects::nonNull).flatMap(Collection::stream) .collect(Collectors.toSet()); }
CompoundParams implements javax0.geci.api.CompoundParams { @Override public Set<String> keySet() { final Stream<Set<String>> keyStream; if (params != null) { keyStream = Arrays.stream(params).filter(Objects::nonNull) .map(Map::keySet); } else if (cparams != null) { keyStream = Arrays.stream(cparams).filter(Objects::nonNull) .map(CompoundParams::keySet); } else { keyStream = Stream.of(); } return keyStream.filter(Objects::nonNull).flatMap(Collection::stream) .collect(Collectors.toSet()); } }
CompoundParams implements javax0.geci.api.CompoundParams { @Override public Set<String> keySet() { final Stream<Set<String>> keyStream; if (params != null) { keyStream = Arrays.stream(params).filter(Objects::nonNull) .map(Map::keySet); } else if (cparams != null) { keyStream = Arrays.stream(cparams).filter(Objects::nonNull) .map(CompoundParams::keySet); } else { keyStream = Stream.of(); } return keyStream.filter(Objects::nonNull).flatMap(Collection::stream) .collect(Collectors.toSet()); } @SafeVarargs  CompoundParams(String id, Map<String, ?>... params);  CompoundParams(CompoundParams... cparams); }
CompoundParams implements javax0.geci.api.CompoundParams { @Override public Set<String> keySet() { final Stream<Set<String>> keyStream; if (params != null) { keyStream = Arrays.stream(params).filter(Objects::nonNull) .map(Map::keySet); } else if (cparams != null) { keyStream = Arrays.stream(cparams).filter(Objects::nonNull) .map(CompoundParams::keySet); } else { keyStream = Stream.of(); } return keyStream.filter(Objects::nonNull).flatMap(Collection::stream) .collect(Collectors.toSet()); } @SafeVarargs  CompoundParams(String id, Map<String, ?>... params);  CompoundParams(CompoundParams... cparams); void trace(); @Override void setConstraints(Source source, String mnemonic, Set<String> allowedKeys); @Override String get(String key, String defaults); @Override String get(String key, Supplier<String> defaultSupplier); @Override String get(String key); @Override String id(String mnemonic); @Override List<String> getValueList(String key, List<String> defaults); @Override List<String> getValueList(String key); @Override boolean is(String key); @Override boolean is(String key, boolean defaultValue); @Override boolean is(String key, String defaultValue); @Override Set<String> keySet(); @Override String toString(); }
CompoundParams implements javax0.geci.api.CompoundParams { @Override public Set<String> keySet() { final Stream<Set<String>> keyStream; if (params != null) { keyStream = Arrays.stream(params).filter(Objects::nonNull) .map(Map::keySet); } else if (cparams != null) { keyStream = Arrays.stream(cparams).filter(Objects::nonNull) .map(CompoundParams::keySet); } else { keyStream = Stream.of(); } return keyStream.filter(Objects::nonNull).flatMap(Collection::stream) .collect(Collectors.toSet()); } @SafeVarargs  CompoundParams(String id, Map<String, ?>... params);  CompoundParams(CompoundParams... cparams); void trace(); @Override void setConstraints(Source source, String mnemonic, Set<String> allowedKeys); @Override String get(String key, String defaults); @Override String get(String key, Supplier<String> defaultSupplier); @Override String get(String key); @Override String id(String mnemonic); @Override List<String> getValueList(String key, List<String> defaults); @Override List<String> getValueList(String key); @Override boolean is(String key); @Override boolean is(String key, boolean defaultValue); @Override boolean is(String key, String defaultValue); @Override Set<String> keySet(); @Override String toString();  }