Package com.fasterxml.jackson.databind.node

Examples of com.fasterxml.jackson.databind.node.TextNode


        assertThat(matcher.matches(object("foo", new TextNode("bar"))), is(false));
    }
   
    @Test
    public void matcherShouldFailWhenAskedToMatchNonArrayNode() {
        assertThat(matcher.matches(object("array", new TextNode("foo"))), is(false));
    }
View Full Code Here


        assertThat(description.toString(), is("A JSON array containing: a string containing \"joy\""));
    }
   
    @Test
    public void matcherShouldFailWhenAskedToMatchNonArrayNode() {
        assertThat(matcher.matches(new TextNode("foo")), is(false));
    }
View Full Code Here

        blueprintJson.setHostGroupCount(entity.getHostGroupCount());
        try {
            blueprintJson.setAmbariBlueprint(jsonHelper.createJsonFromString(entity.getBlueprintText()));
        } catch (Exception e) {
            LOGGER.error("Blueprint cannot be converted to JSON.", e);
            blueprintJson.setAmbariBlueprint(new TextNode(e.getMessage()));
        }
        return blueprintJson;
    }
View Full Code Here

   * @param value
   *     The value to store
   * @return This JSON return object
   */
  public JsonReturnObject put(String key, String value) {
    return put(key, new TextNode(value));
  }
View Full Code Here

      return createErrorJsonObject("invalid-field-id");
    }
    profile.removeField(field);
    currentSone.setProfile(profile);
    webInterface.getCore().touchConfiguration();
    return createSuccessJsonObject().put("field", new ObjectNode(instance).put("id", new TextNode(field.getId())));
  }
View Full Code Here

  protected Iterator<JsonNode> getMapIterator(JsonNode node) {
    List<JsonNode> list = new ArrayList<>(node.size() * 2);
    Iterator<Map.Entry<String, JsonNode>> fieldIterator = node.fields();
    while (fieldIterator.hasNext()) {
      Map.Entry<String, JsonNode> field = fieldIterator.next();
      list.add(new TextNode(field.getKey()));
      list.add(field.getValue());
    }
    return list.iterator();
  }
View Full Code Here

    super.testRequest();
    ObjectNode node = assertInstanceOf(ObjectNode.class, payload);
    Iterator<String> fields = node.fieldNames();
    assertEquals("foo", fields.next());
    assertFalse(fields.hasNext());
    TextNode text = assertInstanceOf(TextNode.class, node.get("foo"));
    assertEquals("bar", text.textValue());
  }
View Full Code Here

    }

    @Override
    public JsonNode sample() {
      synchronized (this) {
        TextNode r = new TextNode(df.format(new Date((long) start)));
        start += minInterval - meanInterval * Math.log(1 - base.nextDouble());
        return r;
      }
    }
View Full Code Here

        number = new ForeignKeySampler(100000, 0.5);
    }

    @Override
    public JsonNode sample() {
        return new TextNode(number.sample().asInt() + " " + street.sample().asText());
    }
View Full Code Here

    @Override
    public JsonNode sample() {
      synchronized (this) {
        long t = (long) Math.rint(base.nextDouble());
        return new TextNode(df.format(new java.util.Date(end - t)));
      }
    }
View Full Code Here

TOP

Related Classes of com.fasterxml.jackson.databind.node.TextNode

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.