@Test public void testGetMatchNonStringLiteral() { PotentialMatch pm = new PotentialMatch( new PathElement(ADDRESS_GROUP_NAME, "\"label\"", 0, 0), "pfx", ImmutableList.of()); assertThat(pm.getMatch(), equalTo(null)); }
@Nullable String getMatch() { if (getAnchorType() == STRING_LITERAL || getAnchorType() == CHAR_LITERAL) { String fullToken = _anchor.getLabel(); if (fullToken.length() >= 2) { fullToken = fullToken.substring(1, fullToken.length() - 1); } return fullToken; } return null; }
PotentialMatch { @Nullable String getMatch() { if (getAnchorType() == STRING_LITERAL || getAnchorType() == CHAR_LITERAL) { String fullToken = _anchor.getLabel(); if (fullToken.length() >= 2) { fullToken = fullToken.substring(1, fullToken.length() - 1); } return fullToken; } return null; } }
PotentialMatch { @Nullable String getMatch() { if (getAnchorType() == STRING_LITERAL || getAnchorType() == CHAR_LITERAL) { String fullToken = _anchor.getLabel(); if (fullToken.length() >= 2) { fullToken = fullToken.substring(1, fullToken.length() - 1); } return fullToken; } return null; } PotentialMatch(PathElement anchor, String matchPrefix, List<PathElement> path); }
PotentialMatch { @Nullable String getMatch() { if (getAnchorType() == STRING_LITERAL || getAnchorType() == CHAR_LITERAL) { String fullToken = _anchor.getLabel(); if (fullToken.length() >= 2) { fullToken = fullToken.substring(1, fullToken.length() - 1); } return fullToken; } return null; } PotentialMatch(PathElement anchor, String matchPrefix, List<PathElement> path); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); }
PotentialMatch { @Nullable String getMatch() { if (getAnchorType() == STRING_LITERAL || getAnchorType() == CHAR_LITERAL) { String fullToken = _anchor.getLabel(); if (fullToken.length() >= 2) { fullToken = fullToken.substring(1, fullToken.length() - 1); } return fullToken; } return null; } PotentialMatch(PathElement anchor, String matchPrefix, List<PathElement> path); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString();  }