本文整理了Java中com.fasterxml.jackson.databind.node.FloatNode
类的一些代码示例,展示了FloatNode
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。FloatNode
类的具体详情如下:
包路径:com.fasterxml.jackson.databind.node.FloatNode
类名称:FloatNode
FloatNode介绍
[英]JsonNode
implementation for efficiently containing 32-bit float
values.
[中]JsonNode
用于高效包含32位“float”值的实现。
代码示例
代码示例来源:origin: redisson/redisson
public static FloatNode valueOf(float v) { return new FloatNode(v); }
代码示例来源:origin: redisson/redisson
/**
* Factory method for getting an instance of JSON numeric value
* that expresses given 32-bit floating point value
*/
@Override
public NumericNode numberNode(float v) { return FloatNode.valueOf((float) v); }
代码示例来源:origin: redisson/redisson
@Override
public BigInteger bigIntegerValue() {
return decimalValue().toBigInteger();
}
代码示例来源:origin: com.arpnetworking.logback/logback-steno
encoder.append(DoubleNode.valueOf((Double) value).toString());
} else if (value instanceof Float) {
encoder.append(FloatNode.valueOf((Float) value).toString());
} else if (value instanceof Long) {
encoder.append(LongNode.valueOf((Long) value).toString());
代码示例来源:origin: net.thisptr/jackson-jq
@Override
public void serialize(FloatNode value, JsonGenerator gen, SerializerProvider serializers) throws IOException, JsonProcessingException {
gen.writeRaw(format(value.asDouble()));
}
}
代码示例来源:origin: eiiches/jackson-jq
@Override
public void serialize(FloatNode value, JsonGenerator gen, SerializerProvider serializers) throws IOException, JsonProcessingException {
gen.writeRaw(format(value.asDouble()));
}
}
代码示例来源:origin: opensourceBIM/BIMserver
return new DoubleNode((Double) object);
} else if (object instanceof Float) {
return new FloatNode((Float) object);
} else if (object instanceof Enum) {
return new TextNode(object.toString());
代码示例来源:origin: redisson/redisson
/**
* Alternate factory method that will handle wrapper value, which may
* be null.
* Due to possibility of null, returning type is not guaranteed to be
* {@link NumericNode}, but just {@link ValueNode}.
*/
@Override
public ValueNode numberNode(Float value) {
return (value == null) ? nullNode() : FloatNode.valueOf(value.floatValue());
}
代码示例来源:origin: hstaudacher/osgi-jax-rs-connector
@Override
public BigInteger bigIntegerValue() {
return decimalValue().toBigInteger();
}
代码示例来源:origin: schibsted/jslt
public JsonNode convert(Object node) {
if (node == null)
return NullNode.instance;
else
return new FloatNode((Float) node);
}
}
代码示例来源:origin: apache/avro
@Test
public void testToJsonNode() {
assertEquals(null, toJsonNode(null));
assertEquals(NullNode.getInstance(), toJsonNode(JsonProperties.NULL_VALUE));
assertEquals(BooleanNode.TRUE, toJsonNode(true));
assertEquals(IntNode.valueOf(1), toJsonNode(1));
assertEquals(LongNode.valueOf(2), toJsonNode(2L));
assertEquals(FloatNode.valueOf(1.0f), toJsonNode(1.0f));
assertEquals(DoubleNode.valueOf(2.0), toJsonNode(2.0));
assertEquals(TextNode.valueOf("\u0001\u0002"), toJsonNode(new byte[] { 1, 2 }));
assertEquals(TextNode.valueOf("a"), toJsonNode("a"));
assertEquals(TextNode.valueOf("UP"), toJsonNode(Direction.UP));
ArrayNode an = JsonNodeFactory.instance.arrayNode();
an.add(1);
assertEquals(an, toJsonNode(Collections.singletonList(1)));
ObjectNode on = JsonNodeFactory.instance.objectNode();
on.put("a", 1);
assertEquals(on, toJsonNode(Collections.singletonMap("a", 1)));
}
代码示例来源:origin: com.jwebmp.jackson.core/jackson-databind
@Override
public BigInteger bigIntegerValue() {
return decimalValue().toBigInteger();
}
代码示例来源:origin: com.reprezen.jsonoverlay/jsonoverlay
@Override
public NumericNode numberNode(float v) {
return new FloatNode(v);
}
代码示例来源:origin: Nextdoor/bender
/**
* Factory method for getting an instance of JSON numeric value
* that expresses given 32-bit floating point value
*/
@Override
public NumericNode numberNode(float v) { return FloatNode.valueOf((float) v); }
代码示例来源:origin: Nextdoor/bender
@Override
public BigInteger bigIntegerValue() {
return decimalValue().toBigInteger();
}
代码示例来源:origin: com.jwebmp.jackson.core/jackson-databind
public static FloatNode valueOf(float v) { return new FloatNode(v); }
代码示例来源:origin: com.eclipsesource.jaxrs/jersey-all
/**
* Factory method for getting an instance of JSON numeric value
* that expresses given 32-bit floating point value
*/
@Override
public NumericNode numberNode(float v) { return FloatNode.valueOf((float) v); }
代码示例来源:origin: com.eclipsesource.jaxrs/jersey-all
@Override
public BigInteger bigIntegerValue() {
return decimalValue().toBigInteger();
}
代码示例来源:origin: hstaudacher/osgi-jax-rs-connector
public static FloatNode valueOf(float v) { return new FloatNode(v); }
代码示例来源:origin: com.jwebmp.jackson.core/jackson-databind
/**
* Factory method for getting an instance of JSON numeric value
* that expresses given 32-bit floating point value
*/
@Override
public NumericNode numberNode(float v) { return FloatNode.valueOf((float) v); }