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 fromJsonReturnsExpected() {
          final Measurement actual = ImmutableMeasurement.fromJson(MEASUREMENT_JSON);
          assertThat(actual).isEqualTo(MEASUREMENT);
      }
test_case.class_method_signature: ImmutableMeasurementTest.fromJsonReturnsExpected()
test_case.full_signature: @Test public void fromJsonReturnsExpected()
test_case.identifier: fromJsonReturnsExpected
test_case.invocations: fromJson isEqualTo assertThat
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void fromJsonReturnsExpected()
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: public static Measurement fromJson(final JsonObject jsonObject) {
  
          final JsonField type = unwrap(jsonObject);
          final JsonField success = unwrap(type.getValue());
          final JsonObject counterJson = success.getValue().asObject();
  
          final Map<Duration, Long> readCounterMap =
                  counterJson.stream()
                          .filter(f -> f.getValue().isNumber())
                          .collect(Collectors.toMap(f -> Duration.parse(f.getKeyName()), f -> f.getValue().asLong()));
  
          final Instant readLastMessageAt = counterJson
                  .getValue(JsonFields.LAST_MESSAGE_AT)
                  .map(Instant::parse)
                  .orElse(null);
  
          return new ImmutableMeasurement(MetricType.forName(type.getKeyName())
                  .orElseThrow(() -> JsonParseException.newBuilder()
                          .message("Unknown metricType: '" + type.getKeyName() + "'")
                          .build()
                  ),
                  fromSuccessFieldName(success.getKeyName()), readCounterMap,
                  readLastMessageAt);
      }
focal_method.class_method_signature: ImmutableMeasurement.fromJson(final JsonObject jsonObject)
focal_method.full_signature: public static Measurement fromJson(final JsonObject jsonObject)
focal_method.identifier: fromJson
focal_method.invocations: unwrap unwrap getValue asObject getValue collect filter stream isNumber getValue toMap parse getKeyName asLong getValue orElse map getValue orElseThrow forName getKeyName build message newBuilder getKeyName fromSuccessFieldName getKeyName
focal_method.modifiers: public static
focal_method.parameters: (final JsonObject jsonObject)
focal_method.return: Measurement
focal_method.signature: Measurement fromJson(final JsonObject jsonObject)