NodeStateAnalyzerFactory { Map<String, String> convertNodeState(NodeState state) { Map<String, String> result = Maps.newHashMap(); for (PropertyState ps : state.getProperties()) { String name = ps.getName(); if (ps.getType() != Type.BINARY && !ps.isArray() && !(name != null && NodeStateUtils.isHidden(name)) && !IGNORE_PROP_NAMES.contains(name)) { result.put(name, ps.getValue(Type.STRING)); } } result.put(LuceneIndexConstants.ANL_LUCENE_MATCH_VERSION, getVersion(state).toString()); return result; } NodeStateAnalyzerFactory(Version defaultVersion);   NodeStateAnalyzerFactory(ResourceLoader defaultLoader, Version defaultVersion); Analyzer createInstance(NodeState state);  }
@Test public void nodeStateAsMap() throws Exception{ NodeBuilder nb = EMPTY_NODE.builder(); nb.setProperty("a", "a"); nb.setProperty("b", 1); nb.setProperty(JcrConstants.JCR_PRIMARYTYPE, "nt:base"); nb.setProperty(":hiddenProp", "hiddenValue"); Map<String, String> result = factory.convertNodeState(nb.getNodeState()); assertEquals("a", result.get("a")); assertEquals("1", result.get("b")); assertNull(result.get(JcrConstants.JCR_PRIMARYTYPE)); assertNull(result.get(":hiddenProp")); }