ParseValue extends CoreValue implements ParseItem { public boolean matches(final String name) { return this.name.equals(name) || this.name.endsWith(Token.SEPARATOR + name); } ParseValue(final String name, final Token definition, final Slice slice, final Encoding encoding); boolean matches(final String name); @Override boolean isValue(); @Override ParseValue asValue(); @Override Token getDefinition(); @Override String toString(); @Override boolean equals(final Object obj); @Override int hashCode(); final String name; final Token definition; }
@Test public void matching() { assertTrue(value.matches("value")); assertFalse(value.matches("lue")); assertFalse(value.matches(".value")); }