@Test public void secured_path_besides_anything() { Builder<String> root = new Builder<>("root"); Builder<String> any = new Builder<>("any"); root.addChild(NodeId.ANY, any); any.addChild(NodeId.ANY, any); root.getOrCreate(ROOT.property("secure").property("property"), "secure property"); Schema<String> schema = root.build(); assertThat(schema.get(ROOT.property("foo")).getValue()).isEqualTo("any"); assertThat(schema.get(ROOT.key("foo").key("bar")).getValue()).isEqualTo("any"); assertThat(schema.get(ROOT.index(123).index(456)).getValue()).isEqualTo("any"); assertThat(schema.get((ROOT.property("foo").property("secure"))).getValue()).isEqualTo("any"); assertThat(schema.get(ROOT.property("secure").property("property")).getValue()).isEqualTo("secure property"); try { schema.get(ROOT.property("secure").property("insecure")); fail("Found insecure under secure"); } catch (IllegalArgumentException e) { } }
public T getValue() { return value; }
Schema extends SchemaBase<Schema<T>> { public T getValue() { return value; } }
Schema extends SchemaBase<Schema<T>> { public T getValue() { return value; } protected  Schema(Builder<T> builder); private  Schema(Builder<T> schemaBuilder, IdentityHashMap<Builder<T>, Schema<T>> schemas); }
Schema extends SchemaBase<Schema<T>> { public T getValue() { return value; } protected  Schema(Builder<T> builder); private  Schema(Builder<T> schemaBuilder, IdentityHashMap<Builder<T>, Schema<T>> schemas); static Builder<T> builder(); T getValue(); Schema<T> getChild(NodeId nodeId); boolean hasChildren(); boolean hasChild(NodeId nodeId); }
Schema extends SchemaBase<Schema<T>> { public T getValue() { return value; } protected  Schema(Builder<T> builder); private  Schema(Builder<T> schemaBuilder, IdentityHashMap<Builder<T>, Schema<T>> schemas); static Builder<T> builder(); T getValue(); Schema<T> getChild(NodeId nodeId); boolean hasChildren(); boolean hasChild(NodeId nodeId);  }