@Test public void testQNameOrResidual() throws Exception { final Fun.ThrowingFunction<String, Name> func = JsonCnd.qNameOrResidual(resolver); assertEquals("* equals *", JsonCnd.QNAME_RESIDUAL, func.tryApply(JsonCnd.TOKEN_RESIDUAL)); final Name ntFolder = NameFactoryImpl.getInstance().create(Name.NS_NT_URI, "folder"); assertEquals("nt:folder equals nt:folder", ntFolder, func.tryApply("nt:folder")); }
static Fun.ThrowingFunction<String, Name> qNameOrResidual(final @NotNull NamePathResolver resolver) { return jcrName -> { if (TOKEN_RESIDUAL.equals(jcrName)) { return QNAME_RESIDUAL; } else { return resolver.getQName(jcrName); } }; }
JsonCnd { static Fun.ThrowingFunction<String, Name> qNameOrResidual(final @NotNull NamePathResolver resolver) { return jcrName -> { if (TOKEN_RESIDUAL.equals(jcrName)) { return QNAME_RESIDUAL; } else { return resolver.getQName(jcrName); } }; } }
JsonCnd { static Fun.ThrowingFunction<String, Name> qNameOrResidual(final @NotNull NamePathResolver resolver) { return jcrName -> { if (TOKEN_RESIDUAL.equals(jcrName)) { return QNAME_RESIDUAL; } else { return resolver.getQName(jcrName); } }; } private  JsonCnd(); }
JsonCnd { static Fun.ThrowingFunction<String, Name> qNameOrResidual(final @NotNull NamePathResolver resolver) { return jcrName -> { if (TOKEN_RESIDUAL.equals(jcrName)) { return QNAME_RESIDUAL; } else { return resolver.getQName(jcrName); } }; } private  JsonCnd(); @SuppressWarnings("WeakerAccess") static List<QNodeTypeDefinition> getQTypesFromJson(final @NotNull JsonObject json,
                      final @NotNull NamespaceMapping mapping); @SuppressWarnings("WeakerAccess") static List<PrivilegeDefinition> getPrivilegesFromJson(final @NotNull JsonValue json,
                          final @NotNull NamespaceMapping mapping); static JsonObject toJson(final @NotNull List<QNodeTypeDefinition> ntDefs,
                                    final @NotNull NamespaceMapping mapping); static JsonValue privilegesToJson(final @NotNull List<PrivilegeDefinition> privDefs,
                                             final @NotNull NamespaceMapping mapping); static List<JcrNs> toJcrNsList(final @NotNull NamespaceMapping mapping,
                                          final @NotNull NamespaceMappingRequest request); static Function<NodeTypeDefinition, QNodeTypeDefinition> adaptToQ(final @NotNull Session session); static Stream<Name> namedBy(final @NotNull QNodeTypeDefinition def); static Stream<Name> namedBy(final @NotNull PrivilegeDefinition def); static NamespaceMapping toNamespaceMapping(final List<JcrNs> jcrNsList); static @NotNull Stream<String> streamNsPrefix(final @NotNull String name); static List<Result<NodeTypeSet>> readNodeTypes(final @NotNull NamespaceMapping mapping,
                                                          final @NotNull List<URL> cndUrls); static NodeTypeSet aggregateNodeTypes(final @NotNull NamespaceMapping mapping,
                                                 final @NotNull List<NodeTypeSet> nodeTypeSets); }
JsonCnd { static Fun.ThrowingFunction<String, Name> qNameOrResidual(final @NotNull NamePathResolver resolver) { return jcrName -> { if (TOKEN_RESIDUAL.equals(jcrName)) { return QNAME_RESIDUAL; } else { return resolver.getQName(jcrName); } }; } private  JsonCnd(); @SuppressWarnings("WeakerAccess") static List<QNodeTypeDefinition> getQTypesFromJson(final @NotNull JsonObject json,
                      final @NotNull NamespaceMapping mapping); @SuppressWarnings("WeakerAccess") static List<PrivilegeDefinition> getPrivilegesFromJson(final @NotNull JsonValue json,
                          final @NotNull NamespaceMapping mapping); static JsonObject toJson(final @NotNull List<QNodeTypeDefinition> ntDefs,
                                    final @NotNull NamespaceMapping mapping); static JsonValue privilegesToJson(final @NotNull List<PrivilegeDefinition> privDefs,
                                             final @NotNull NamespaceMapping mapping); static List<JcrNs> toJcrNsList(final @NotNull NamespaceMapping mapping,
                                          final @NotNull NamespaceMappingRequest request); static Function<NodeTypeDefinition, QNodeTypeDefinition> adaptToQ(final @NotNull Session session); static Stream<Name> namedBy(final @NotNull QNodeTypeDefinition def); static Stream<Name> namedBy(final @NotNull PrivilegeDefinition def); static NamespaceMapping toNamespaceMapping(final List<JcrNs> jcrNsList); static @NotNull Stream<String> streamNsPrefix(final @NotNull String name); static List<Result<NodeTypeSet>> readNodeTypes(final @NotNull NamespaceMapping mapping,
                                                          final @NotNull List<URL> cndUrls); static NodeTypeSet aggregateNodeTypes(final @NotNull NamespaceMapping mapping,
                                                 final @NotNull List<NodeTypeSet> nodeTypeSets); static final NamespaceMapping BUILTIN_MAPPINGS; static final List<String> BUILTIN_NODETYPES; static final List<String> BUILTIN_PRIVILEGES; }