protected boolean matchesSafely()

in jackson/src/main/java/com/spotify/hamcrest/jackson/AbstractJsonNodeMatcher.java [41:56]


  protected boolean matchesSafely(JsonNode item, Description mismatchDescription) {
    if (item.getNodeType() == type) {
      @SuppressWarnings("unchecked")
      final A node = (A) item;

      return matchesNode(node, mismatchDescription);
    } else {
      mismatchDescription
          .appendText("was not ")
          .appendText(LanguageUtils.addArticle(type.name().toLowerCase()))
          .appendText(" node, but ")
          .appendText(LanguageUtils.addArticle(item.getNodeType().name().toLowerCase()))
          .appendText(" node");
      return false;
    }
  }