private static void extractValuesFromPrefix( String varName, JsonPathToTableExtraction extraction, JsonPathResult jpResult, ObjectNode answerValues) { if (extraction.getSchema().getType() == Type.LIST || extraction.getSchema().getType() == Type.SET) { throw new BatfishException("Prefix-based hints are incompatible with list or set types"); } answerValues.set(varName, new TextNode(jpResult.getPrefixPart(extraction.getIndex()))); }
JsonNode value = (extraction.getMethod() == Method.PREFIXOFSUFFIX) ? new TextNode(result.getPrefixPart(extraction.getIndex())) : result.getSuffix(); confirmValueType(value, extraction.getSchema().getBaseType());