Package com.fasterxml.jackson.core

Examples of com.fasterxml.jackson.core.JsonGenerator.writeNumberField()


      }
      g.writeNumberField("collected_at", metric.getEpoch(TimeUnit.SECONDS));
      if (metric.getValue() instanceof Integer) {
        g.writeNumberField("value", (Integer) metric.getValue());
      } else if (metric.getValue() instanceof Long) {
        g.writeNumberField("value", (Long) metric.getValue());
      } else if (metric.getValue() instanceof Float) {
        g.writeNumberField("value", (Float) metric.getValue());
      } else if (metric.getValue() instanceof Double) {
        g.writeNumberField("value", (Double) metric.getValue());
      }
View Full Code Here


      if (metric.getValue() instanceof Integer) {
        g.writeNumberField("value", (Integer) metric.getValue());
      } else if (metric.getValue() instanceof Long) {
        g.writeNumberField("value", (Long) metric.getValue());
      } else if (metric.getValue() instanceof Float) {
        g.writeNumberField("value", (Float) metric.getValue());
      } else if (metric.getValue() instanceof Double) {
        g.writeNumberField("value", (Double) metric.getValue());
      }
      g.writeEndObject();
    }
View Full Code Here

      } else if (metric.getValue() instanceof Long) {
        g.writeNumberField("value", (Long) metric.getValue());
      } else if (metric.getValue() instanceof Float) {
        g.writeNumberField("value", (Float) metric.getValue());
      } else if (metric.getValue() instanceof Double) {
        g.writeNumberField("value", (Double) metric.getValue());
      }
      g.writeEndObject();
    }

    g.writeEndArray();
View Full Code Here

              time = counter.getEpoch(TimeUnit.SECONDS);
              myID = counter.getType();
              first = 1;
              g.writeStartObject();
              g.writeStringField("identifier", myID);
              g.writeNumberField("timestamp", time);
              g.writeObjectFieldStart("values");
           }
           if (counter.getValue() instanceof Integer) {
                g.writeNumberField(counter.getName(), (Integer) counter.getValue());
            } else if (counter.getValue() instanceof Long) {
View Full Code Here

              g.writeStringField("identifier", myID);
              g.writeNumberField("timestamp", time);
              g.writeObjectFieldStart("values");
           }
           if (counter.getValue() instanceof Integer) {
                g.writeNumberField(counter.getName(), (Integer) counter.getValue());
            } else if (counter.getValue() instanceof Long) {
                g.writeNumberField(counter.getName(), (Long) counter.getValue());
            } else if (counter.getValue() instanceof Float) {
                g.writeNumberField(counter.getName(), (Float) counter.getValue());
            } else if (counter.getValue() instanceof Double) {
View Full Code Here

              g.writeObjectFieldStart("values");
           }
           if (counter.getValue() instanceof Integer) {
                g.writeNumberField(counter.getName(), (Integer) counter.getValue());
            } else if (counter.getValue() instanceof Long) {
                g.writeNumberField(counter.getName(), (Long) counter.getValue());
            } else if (counter.getValue() instanceof Float) {
                g.writeNumberField(counter.getName(), (Float) counter.getValue());
            } else if (counter.getValue() instanceof Double) {
                g.writeNumberField(counter.getName(), (Double) counter.getValue());
            }
View Full Code Here

           if (counter.getValue() instanceof Integer) {
                g.writeNumberField(counter.getName(), (Integer) counter.getValue());
            } else if (counter.getValue() instanceof Long) {
                g.writeNumberField(counter.getName(), (Long) counter.getValue());
            } else if (counter.getValue() instanceof Float) {
                g.writeNumberField(counter.getName(), (Float) counter.getValue());
            } else if (counter.getValue() instanceof Double) {
                g.writeNumberField(counter.getName(), (Double) counter.getValue());
            }
        }
        g.writeEndObject();
View Full Code Here

            } else if (counter.getValue() instanceof Long) {
                g.writeNumberField(counter.getName(), (Long) counter.getValue());
            } else if (counter.getValue() instanceof Float) {
                g.writeNumberField(counter.getName(), (Float) counter.getValue());
            } else if (counter.getValue() instanceof Double) {
                g.writeNumberField(counter.getName(), (Double) counter.getValue());
            }
        }
        g.writeEndObject();
        g.writeEndObject();
        g.flush();
View Full Code Here

            g.writeStartObject();
            g.writeStringField("name", counter.getName());
            if (source != null && !source.isEmpty()) {
                g.writeStringField("source", source);
            }
            g.writeNumberField("measure_time", counter.getEpoch(TimeUnit.SECONDS));
            if (counter.getValue() instanceof Integer) {
                g.writeNumberField("value", (Integer) counter.getValue());
            } else if (counter.getValue() instanceof Long) {
                g.writeNumberField("value", (Long) counter.getValue());
            } else if (counter.getValue() instanceof Float) {
View Full Code Here

            if (source != null && !source.isEmpty()) {
                g.writeStringField("source", source);
            }
            g.writeNumberField("measure_time", counter.getEpoch(TimeUnit.SECONDS));
            if (counter.getValue() instanceof Integer) {
                g.writeNumberField("value", (Integer) counter.getValue());
            } else if (counter.getValue() instanceof Long) {
                g.writeNumberField("value", (Long) counter.getValue());
            } else if (counter.getValue() instanceof Float) {
                g.writeNumberField("value", (Float) counter.getValue());
            } else if (counter.getValue() instanceof Double) {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.