@Test public void testGetNamespacePrefixes() { final ForcedRoot emptyRoot = new ForcedRoot(); assertArrayEquals("expect prefixes", new String[0], emptyRoot.getNamespacePrefixes()); final ForcedRoot noPrefixRoot = new ForcedRoot() .withPath("path") .withPrimaryType("type") .withMixinTypes("mixinType"); assertArrayEquals("expect prefixes", new String[0], noPrefixRoot.getNamespacePrefixes()); final ForcedRoot root = new ForcedRoot() .withPath("foo:path") .withPrimaryType("bar:type") .withMixinTypes("foobar:type"); assertArrayEquals("expect prefixes", new String[]{"foo", "bar", "foobar"}, root.getNamespacePrefixes()); }
public @NotNull String[] getNamespacePrefixes() { return Stream.concat( streamIt(path).flatMap(path -> Stream.of(path.split("/")) .filter(inferTest1(String::isEmpty).negate()) .flatMap(JsonCnd::streamNsPrefix)), Stream.concat( streamIt(primaryType).flatMap(JsonCnd::streamNsPrefix), mixinTypes.stream().flatMap(JsonCnd::streamNsPrefix))) .toArray(String[]::new); }
ForcedRoot implements JsonObjectConvertible, Comparable<ForcedRoot> { public @NotNull String[] getNamespacePrefixes() { return Stream.concat( streamIt(path).flatMap(path -> Stream.of(path.split("/")) .filter(inferTest1(String::isEmpty).negate()) .flatMap(JsonCnd::streamNsPrefix)), Stream.concat( streamIt(primaryType).flatMap(JsonCnd::streamNsPrefix), mixinTypes.stream().flatMap(JsonCnd::streamNsPrefix))) .toArray(String[]::new); } }
ForcedRoot implements JsonObjectConvertible, Comparable<ForcedRoot> { public @NotNull String[] getNamespacePrefixes() { return Stream.concat( streamIt(path).flatMap(path -> Stream.of(path.split("/")) .filter(inferTest1(String::isEmpty).negate()) .flatMap(JsonCnd::streamNsPrefix)), Stream.concat( streamIt(primaryType).flatMap(JsonCnd::streamNsPrefix), mixinTypes.stream().flatMap(JsonCnd::streamNsPrefix))) .toArray(String[]::new); }  }
ForcedRoot implements JsonObjectConvertible, Comparable<ForcedRoot> { public @NotNull String[] getNamespacePrefixes() { return Stream.concat( streamIt(path).flatMap(path -> Stream.of(path.split("/")) .filter(inferTest1(String::isEmpty).negate()) .flatMap(JsonCnd::streamNsPrefix)), Stream.concat( streamIt(primaryType).flatMap(JsonCnd::streamNsPrefix), mixinTypes.stream().flatMap(JsonCnd::streamNsPrefix))) .toArray(String[]::new); }  @NotNull static ForcedRoot.JsonKeys keys(); @Nullable String getPath(); void setPath(final @Nullable String path); @Nullable String getPrimaryType(); void setPrimaryType(final @Nullable String primaryType); @NotNull List<String> getMixinTypes(); void setMixinTypes(final @Nullable List<String> mixinTypes); @SuppressWarnings("WeakerAccess") ForcedRoot withPath(final @Nullable String path); @SuppressWarnings("WeakerAccess") ForcedRoot withPrimaryType(final @Nullable String primaryType); @SuppressWarnings("WeakerAccess") ForcedRoot withMixinTypes(final @NotNull String... mixinTypes); final boolean hasPath(); static @NotNull ForcedRoot fromJson(final @NotNull JsonObject json); @NotNull String[] getNamespacePrefixes(); @Override JsonObject toJson(); @Override int compareTo(final @NotNull ForcedRoot o); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); }
ForcedRoot implements JsonObjectConvertible, Comparable<ForcedRoot> { public @NotNull String[] getNamespacePrefixes() { return Stream.concat( streamIt(path).flatMap(path -> Stream.of(path.split("/")) .filter(inferTest1(String::isEmpty).negate()) .flatMap(JsonCnd::streamNsPrefix)), Stream.concat( streamIt(primaryType).flatMap(JsonCnd::streamNsPrefix), mixinTypes.stream().flatMap(JsonCnd::streamNsPrefix))) .toArray(String[]::new); }  @NotNull static ForcedRoot.JsonKeys keys(); @Nullable String getPath(); void setPath(final @Nullable String path); @Nullable String getPrimaryType(); void setPrimaryType(final @Nullable String primaryType); @NotNull List<String> getMixinTypes(); void setMixinTypes(final @Nullable List<String> mixinTypes); @SuppressWarnings("WeakerAccess") ForcedRoot withPath(final @Nullable String path); @SuppressWarnings("WeakerAccess") ForcedRoot withPrimaryType(final @Nullable String primaryType); @SuppressWarnings("WeakerAccess") ForcedRoot withMixinTypes(final @NotNull String... mixinTypes); final boolean hasPath(); static @NotNull ForcedRoot fromJson(final @NotNull JsonObject json); @NotNull String[] getNamespacePrefixes(); @Override JsonObject toJson(); @Override int compareTo(final @NotNull ForcedRoot o); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString();  }