test_class.declarator: TYPE = MetricType.CONSUMED
test_class.modifier: private static final
test_class.original_string: private static final MetricType TYPE = MetricType.CONSUMED;
test_class.type: MetricType
test_class.var_name: TYPE
test_class.declarator: SUCCESS = true
test_class.modifier: private static final
test_class.original_string: private static final boolean SUCCESS = true;
test_class.type: boolean
test_class.var_name: SUCCESS
test_class.declarator: MEASUREMENT = new ImmutableMeasurement(TYPE, SUCCESS, COUNTERS, INSTANT)
test_class.modifier: private static final
test_class.original_string: private static final Measurement MEASUREMENT = new ImmutableMeasurement(TYPE, SUCCESS, COUNTERS, INSTANT);
test_class.type: Measurement
test_class.var_name: MEASUREMENT
test_class.declarator: MEASUREMENT_JSON = getMeasurementJson(TYPE, SUCCESS)
test_class.modifier: private static final
test_class.original_string: private static final JsonObject MEASUREMENT_JSON = getMeasurementJson(TYPE, SUCCESS);
test_class.type: JsonObject
test_class.var_name: MEASUREMENT_JSON
test_class.file: model/connectivity/src/test/java/org/eclipse/ditto/model/connectivity/ImmutableMeasurementTest.java
test_class.identifier: ImmutableMeasurementTest
test_case.body: @Test
      public void toJsonReturnsExpected() {
          final JsonObject actual = MEASUREMENT.toJson();
          assertThat(actual).isEqualTo(MEASUREMENT_JSON);
      }
test_case.class_method_signature: ImmutableMeasurementTest.toJsonReturnsExpected()
test_case.full_signature: @Test public void toJsonReturnsExpected()
test_case.identifier: toJsonReturnsExpected
test_case.invocations: toJson isEqualTo assertThat
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void toJsonReturnsExpected()
focal_class.declarator: SUCCESS_FIELD_NAME = "success"
focal_class.modifier: private static final
focal_class.original_string: private static final String SUCCESS_FIELD_NAME = "success";
focal_class.type: String
focal_class.var_name: SUCCESS_FIELD_NAME
focal_class.declarator: FAILURE_FIELD_NAME = "failure"
focal_class.modifier: private static final
focal_class.original_string: private static final String FAILURE_FIELD_NAME = "failure";
focal_class.type: String
focal_class.var_name: FAILURE_FIELD_NAME
focal_class.declarator: metricType
focal_class.modifier: private final
focal_class.original_string: private final MetricType metricType;
focal_class.type: MetricType
focal_class.var_name: metricType
focal_class.declarator: success
focal_class.modifier: private final
focal_class.original_string: private final boolean success;
focal_class.type: boolean
focal_class.var_name: success
focal_class.declarator: values
focal_class.modifier: private final
focal_class.original_string: private final Map<Duration, Long> values;
focal_class.type: Map<Duration, Long>
focal_class.var_name: values
focal_class.declarator: lastMessageAt
focal_class.modifier: @Nullable private final
focal_class.original_string: @Nullable private final Instant lastMessageAt;
focal_class.type: Instant
focal_class.var_name: lastMessageAt
focal_class.file: model/connectivity/src/main/java/org/eclipse/ditto/model/connectivity/ImmutableMeasurement.java
focal_class.identifier: ImmutableMeasurement
focal_class.interfaces: implements Measurement
focal_class.class_method_signature: ImmutableMeasurement.ImmutableMeasurement(final MetricType metricType, final boolean success,
              final Map<Duration, Long> values, @Nullable final Instant lastMessageAt)
focal_class.full_signature:   ImmutableMeasurement(final MetricType metricType, final boolean success,
              final Map<Duration, Long> values, @Nullable final Instant lastMessageAt)
focal_class.identifier: ImmutableMeasurement
focal_class.parameters: (final MetricType metricType, final boolean success,
              final Map<Duration, Long> values, @Nullable final Instant lastMessageAt)
focal_class.signature:  ImmutableMeasurement(final MetricType metricType, final boolean success,
              final Map<Duration, Long> values, @Nullable final Instant lastMessageAt)
focal_class.class_method_signature: ImmutableMeasurement.getMetricType()
focal_class.full_signature: @Override public MetricType getMetricType()
focal_class.identifier: getMetricType
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: MetricType
focal_class.signature: MetricType getMetricType()
focal_class.class_method_signature: ImmutableMeasurement.isSuccess()
focal_class.full_signature: @Override public boolean isSuccess()
focal_class.identifier: isSuccess
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: boolean
focal_class.signature: boolean isSuccess()
focal_class.class_method_signature: ImmutableMeasurement.getCounts()
focal_class.full_signature: @Override public Map<Duration, Long> getCounts()
focal_class.identifier: getCounts
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: Map<Duration, Long>
focal_class.signature: Map<Duration, Long> getCounts()
focal_class.class_method_signature: ImmutableMeasurement.getLastMessageAt()
focal_class.full_signature: @Override public Optional<Instant> getLastMessageAt()
focal_class.identifier: getLastMessageAt
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: Optional<Instant>
focal_class.signature: Optional<Instant> getLastMessageAt()
focal_class.class_method_signature: ImmutableMeasurement.toJson(final JsonSchemaVersion schemaVersion, final Predicate<JsonField> thePredicate)
focal_class.full_signature: @Override public JsonObject toJson(final JsonSchemaVersion schemaVersion, final Predicate<JsonField> thePredicate)
focal_class.identifier: toJson
focal_class.modifiers: @Override public
focal_class.parameters: (final JsonSchemaVersion schemaVersion, final Predicate<JsonField> thePredicate)
focal_class.return: JsonObject
focal_class.signature: JsonObject toJson(final JsonSchemaVersion schemaVersion, final Predicate<JsonField> thePredicate)
focal_class.class_method_signature: ImmutableMeasurement.getSuccessFieldName(final boolean success)
focal_class.full_signature: private static String getSuccessFieldName(final boolean success)
focal_class.identifier: getSuccessFieldName
focal_class.modifiers: private static
focal_class.parameters: (final boolean success)
focal_class.return: String
focal_class.signature: String getSuccessFieldName(final boolean success)
focal_class.class_method_signature: ImmutableMeasurement.fromSuccessFieldName(final String success)
focal_class.full_signature: private static boolean fromSuccessFieldName(final String success)
focal_class.identifier: fromSuccessFieldName
focal_class.modifiers: private static
focal_class.parameters: (final String success)
focal_class.return: boolean
focal_class.signature: boolean fromSuccessFieldName(final String success)
focal_class.class_method_signature: ImmutableMeasurement.fromJson(final JsonObject jsonObject)
focal_class.full_signature: public static Measurement fromJson(final JsonObject jsonObject)
focal_class.identifier: fromJson
focal_class.modifiers: public static
focal_class.parameters: (final JsonObject jsonObject)
focal_class.return: Measurement
focal_class.signature: Measurement fromJson(final JsonObject jsonObject)
focal_class.class_method_signature: ImmutableMeasurement.unwrap(final JsonValue jsonValue)
focal_class.full_signature: private static JsonField unwrap(final JsonValue jsonValue)
focal_class.identifier: unwrap
focal_class.modifiers: private static
focal_class.parameters: (final JsonValue jsonValue)
focal_class.return: JsonField
focal_class.signature: JsonField unwrap(final JsonValue jsonValue)
focal_class.class_method_signature: ImmutableMeasurement.equals(final Object o)
focal_class.full_signature: @Override public boolean equals(final Object o)
focal_class.identifier: equals
focal_class.modifiers: @Override public
focal_class.parameters: (final Object o)
focal_class.return: boolean
focal_class.signature: boolean equals(final Object o)
focal_class.class_method_signature: ImmutableMeasurement.hashCode()
focal_class.full_signature: @Override public int hashCode()
focal_class.identifier: hashCode
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: int
focal_class.signature: int hashCode()
focal_class.class_method_signature: ImmutableMeasurement.toString()
focal_class.full_signature: @Override public String toString()
focal_class.identifier: toString
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String toString()
focal_method.body: @Override
      public JsonObject toJson(final JsonSchemaVersion schemaVersion, final Predicate<JsonField> thePredicate) {
          final JsonObject counts = values.entrySet()
                  .stream()
                  .sorted(Comparator.comparing(Map.Entry::getKey))
                  .map(e -> JsonFactory.newField(JsonFactory.newKey(e.getKey().toString()), JsonValue.of(e.getValue())))
                  .collect(JsonCollectors.fieldsToObject());
  
          return JsonFactory.newObjectBuilder()
                  .set(metricType.getName(),
                          JsonFactory.newObjectBuilder()
                                  .set(getSuccessFieldName(success),
                                          JsonFactory.newObjectBuilder(counts)
                                                  .set(JsonFields.LAST_MESSAGE_AT, getLastMessageAt()
                                                          .map(Object::toString).orElse(null)
                                                  ).build()
                                  ).build()
                  ).build();
      }
focal_method.class_method_signature: ImmutableMeasurement.toJson(final JsonSchemaVersion schemaVersion, final Predicate<JsonField> thePredicate)
focal_method.full_signature: @Override public JsonObject toJson(final JsonSchemaVersion schemaVersion, final Predicate<JsonField> thePredicate)
focal_method.identifier: toJson
focal_method.invocations: collect map sorted stream entrySet comparing newField newKey toString getKey of getValue fieldsToObject build set newObjectBuilder getName build set newObjectBuilder getSuccessFieldName build set newObjectBuilder orElse map getLastMessageAt
focal_method.modifiers: @Override public
focal_method.parameters: (final JsonSchemaVersion schemaVersion, final Predicate<JsonField> thePredicate)
focal_method.return: JsonObject
focal_method.signature: JsonObject toJson(final JsonSchemaVersion schemaVersion, final Predicate<JsonField> thePredicate)