test_class.declarator: ADDRESS = "amqp/target1"
test_class.modifier: private static final
test_class.original_string: private static final String ADDRESS = "amqp/target1";
test_class.type: String
test_class.var_name: ADDRESS
test_class.declarator: AUTHORIZATION_CONTEXT =
              AuthorizationModelFactory.newAuthContext(DittoAuthorizationContextType.PRE_AUTHENTICATED_CONNECTION,
                      AuthorizationModelFactory.newAuthSubject("eclipse"),
                      AuthorizationModelFactory.newAuthSubject("ditto"))
test_class.modifier: private static final
test_class.original_string: private static final AuthorizationContext AUTHORIZATION_CONTEXT =
              AuthorizationModelFactory.newAuthContext(DittoAuthorizationContextType.PRE_AUTHENTICATED_CONNECTION,
                      AuthorizationModelFactory.newAuthSubject("eclipse"),
                      AuthorizationModelFactory.newAuthSubject("ditto"));
test_class.type: AuthorizationContext
test_class.var_name: AUTHORIZATION_CONTEXT
test_class.declarator: CUSTOM_MAPPING = "custom-mapping"
test_class.modifier: private static final
test_class.original_string: private static final String CUSTOM_MAPPING = "custom-mapping";
test_class.type: String
test_class.var_name: CUSTOM_MAPPING
test_class.declarator: DITTO_MAPPING = "ditto-mapping"
test_class.modifier: private static final
test_class.original_string: private static final String DITTO_MAPPING = "ditto-mapping";
test_class.type: String
test_class.var_name: DITTO_MAPPING
test_class.declarator: ACKNOWLEDGEMENT_LABEL = AcknowledgementLabel.of("custom-ack")
test_class.modifier: private static final
test_class.original_string: private static final AcknowledgementLabel ACKNOWLEDGEMENT_LABEL = AcknowledgementLabel.of("custom-ack");
test_class.type: AcknowledgementLabel
test_class.var_name: ACKNOWLEDGEMENT_LABEL
test_class.declarator: TARGET_WITH_AUTH_CONTEXT = ConnectivityModelFactory
              .newTargetBuilder()
              .address(ADDRESS)
              .authorizationContext(AUTHORIZATION_CONTEXT)
              .topics(TWIN_EVENTS)
              .issuedAcknowledgementLabel(ACKNOWLEDGEMENT_LABEL)
              .payloadMapping(ConnectivityModelFactory.newPayloadMapping(DITTO_MAPPING, CUSTOM_MAPPING))
              .build()
test_class.modifier: private static final
test_class.original_string: private static final Target TARGET_WITH_AUTH_CONTEXT = ConnectivityModelFactory
              .newTargetBuilder()
              .address(ADDRESS)
              .authorizationContext(AUTHORIZATION_CONTEXT)
              .topics(TWIN_EVENTS)
              .issuedAcknowledgementLabel(ACKNOWLEDGEMENT_LABEL)
              .payloadMapping(ConnectivityModelFactory.newPayloadMapping(DITTO_MAPPING, CUSTOM_MAPPING))
              .build();
test_class.type: Target
test_class.var_name: TARGET_WITH_AUTH_CONTEXT
test_class.declarator: TARGET_JSON_WITH_EMPTY_AUTH_CONTEXT = JsonObject
              .newBuilder()
              .set(Target.JsonFields.TOPICS, JsonFactory.newArrayBuilder().add(TWIN_EVENTS.getName()).build())
              .set(Target.JsonFields.ADDRESS, ADDRESS)
              .build()
test_class.modifier: private static final
test_class.original_string: private static final JsonObject TARGET_JSON_WITH_EMPTY_AUTH_CONTEXT = JsonObject
              .newBuilder()
              .set(Target.JsonFields.TOPICS, JsonFactory.newArrayBuilder().add(TWIN_EVENTS.getName()).build())
              .set(Target.JsonFields.ADDRESS, ADDRESS)
              .build();
test_class.type: JsonObject
test_class.var_name: TARGET_JSON_WITH_EMPTY_AUTH_CONTEXT
test_class.declarator: TARGET_JSON_WITH_AUTH_CONTEXT = TARGET_JSON_WITH_EMPTY_AUTH_CONTEXT.toBuilder()
              .set(Target.JsonFields.AUTHORIZATION_CONTEXT, JsonFactory.newArrayBuilder().add("eclipse", "ditto").build())
              .set(Target.JsonFields.ISSUED_ACKNOWLEDGEMENT_LABEL, "custom-ack")
              .set(Target.JsonFields.PAYLOAD_MAPPING, JsonArray.of(DITTO_MAPPING, CUSTOM_MAPPING))
              .build()
test_class.modifier: private static final
test_class.original_string: private static final JsonObject TARGET_JSON_WITH_AUTH_CONTEXT = TARGET_JSON_WITH_EMPTY_AUTH_CONTEXT.toBuilder()
              .set(Target.JsonFields.AUTHORIZATION_CONTEXT, JsonFactory.newArrayBuilder().add("eclipse", "ditto").build())
              .set(Target.JsonFields.ISSUED_ACKNOWLEDGEMENT_LABEL, "custom-ack")
              .set(Target.JsonFields.PAYLOAD_MAPPING, JsonArray.of(DITTO_MAPPING, CUSTOM_MAPPING))
              .build();
test_class.type: JsonObject
test_class.var_name: TARGET_JSON_WITH_AUTH_CONTEXT
test_class.declarator: MQTT_ADDRESS = "mqtt/target1"
test_class.modifier: private static final
test_class.original_string: private static final String MQTT_ADDRESS = "mqtt/target1";
test_class.type: String
test_class.var_name: MQTT_ADDRESS
test_class.declarator: MQTT_TARGET = ConnectivityModelFactory.newTargetBuilder()
              .address(MQTT_ADDRESS)
              .authorizationContext(AUTHORIZATION_CONTEXT)
              .qos(1)
              .topics(TWIN_EVENTS)
              .build()
test_class.modifier: private static final
test_class.original_string: private static final Target MQTT_TARGET = ConnectivityModelFactory.newTargetBuilder()
              .address(MQTT_ADDRESS)
              .authorizationContext(AUTHORIZATION_CONTEXT)
              .qos(1)
              .topics(TWIN_EVENTS)
              .build();
test_class.type: Target
test_class.var_name: MQTT_TARGET
test_class.declarator: MQTT_TARGET_JSON = JsonObject.newBuilder()
              .set(Target.JsonFields.TOPICS, JsonFactory.newArrayBuilder().add(TWIN_EVENTS.getName()).build())
              .set(Target.JsonFields.ADDRESS, MQTT_ADDRESS)
              .set(Target.JsonFields.QOS, 1)
              .set(Target.JsonFields.AUTHORIZATION_CONTEXT, JsonFactory.newArrayBuilder().add("eclipse", "ditto").build())
              .build()
test_class.modifier: private static final
test_class.original_string: private static final JsonObject MQTT_TARGET_JSON = JsonObject.newBuilder()
              .set(Target.JsonFields.TOPICS, JsonFactory.newArrayBuilder().add(TWIN_EVENTS.getName()).build())
              .set(Target.JsonFields.ADDRESS, MQTT_ADDRESS)
              .set(Target.JsonFields.QOS, 1)
              .set(Target.JsonFields.AUTHORIZATION_CONTEXT, JsonFactory.newArrayBuilder().add("eclipse", "ditto").build())
              .build();
test_class.type: JsonObject
test_class.var_name: MQTT_TARGET_JSON
test_class.file: model/connectivity/src/test/java/org/eclipse/ditto/model/connectivity/ImmutableTargetTest.java
test_class.identifier: ImmutableTargetTest
test_case.body: @Test
      public void toJsonReturnsExpected() {
          final JsonObject actual = TARGET_WITH_AUTH_CONTEXT.toJson();
  
          assertThat(actual).isEqualTo(TARGET_JSON_WITH_AUTH_CONTEXT);
      }
test_case.class_method_signature: ImmutableTargetTest.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: DEFAULT_HEADER_MAPPING = ImmutableSource.DEFAULT_SOURCE_HEADER_MAPPING
focal_class.modifier: static final
focal_class.original_string: static final HeaderMapping DEFAULT_HEADER_MAPPING = ImmutableSource.DEFAULT_SOURCE_HEADER_MAPPING;
focal_class.type: HeaderMapping
focal_class.var_name: DEFAULT_HEADER_MAPPING
focal_class.declarator: address
focal_class.modifier: private final
focal_class.original_string: private final String address;
focal_class.type: String
focal_class.var_name: address
focal_class.declarator: topics
focal_class.modifier: private final
focal_class.original_string: private final Set<FilteredTopic> topics;
focal_class.type: Set<FilteredTopic>
focal_class.var_name: topics
focal_class.declarator: qos
focal_class.modifier: @Nullable private final
focal_class.original_string: @Nullable private final Integer qos;
focal_class.type: Integer
focal_class.var_name: qos
focal_class.declarator: authorizationContext
focal_class.modifier: private final
focal_class.original_string: private final AuthorizationContext authorizationContext;
focal_class.type: AuthorizationContext
focal_class.var_name: authorizationContext
focal_class.declarator: originalAddress
focal_class.modifier: private final
focal_class.original_string: private final String originalAddress;
focal_class.type: String
focal_class.var_name: originalAddress
focal_class.declarator: issuedAcknowledgementLabel
focal_class.modifier: @Nullable private final
focal_class.original_string: @Nullable private final AcknowledgementLabel issuedAcknowledgementLabel;
focal_class.type: AcknowledgementLabel
focal_class.var_name: issuedAcknowledgementLabel
focal_class.declarator: headerMapping
focal_class.modifier: @Nullable private final
focal_class.original_string: @Nullable private final HeaderMapping headerMapping;
focal_class.type: HeaderMapping
focal_class.var_name: headerMapping
focal_class.declarator: payloadMapping
focal_class.modifier: private final
focal_class.original_string: private final PayloadMapping payloadMapping;
focal_class.type: PayloadMapping
focal_class.var_name: payloadMapping
focal_class.file: model/connectivity/src/main/java/org/eclipse/ditto/model/connectivity/ImmutableTarget.java
focal_class.identifier: ImmutableTarget
focal_class.interfaces: implements Target
focal_class.class_method_signature: ImmutableTarget.ImmutableTarget(final ImmutableTarget.Builder builder)
focal_class.full_signature: private  ImmutableTarget(final ImmutableTarget.Builder builder)
focal_class.identifier: ImmutableTarget
focal_class.modifiers: private
focal_class.parameters: (final ImmutableTarget.Builder builder)
focal_class.signature:  ImmutableTarget(final ImmutableTarget.Builder builder)
focal_class.class_method_signature: ImmutableTarget.getAddress()
focal_class.full_signature: @Override public String getAddress()
focal_class.identifier: getAddress
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String getAddress()
focal_class.class_method_signature: ImmutableTarget.getOriginalAddress()
focal_class.full_signature: @Override public String getOriginalAddress()
focal_class.identifier: getOriginalAddress
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String getOriginalAddress()
focal_class.class_method_signature: ImmutableTarget.withAddress(final String newAddress)
focal_class.full_signature: @Override public Target withAddress(final String newAddress)
focal_class.identifier: withAddress
focal_class.modifiers: @Override public
focal_class.parameters: (final String newAddress)
focal_class.return: Target
focal_class.signature: Target withAddress(final String newAddress)
focal_class.class_method_signature: ImmutableTarget.getTopics()
focal_class.full_signature: @Override public Set<FilteredTopic> getTopics()
focal_class.identifier: getTopics
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: Set<FilteredTopic>
focal_class.signature: Set<FilteredTopic> getTopics()
focal_class.class_method_signature: ImmutableTarget.getQos()
focal_class.full_signature: @Override public Optional<Integer> getQos()
focal_class.identifier: getQos
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: Optional<Integer>
focal_class.signature: Optional<Integer> getQos()
focal_class.class_method_signature: ImmutableTarget.getAuthorizationContext()
focal_class.full_signature: @Override public AuthorizationContext getAuthorizationContext()
focal_class.identifier: getAuthorizationContext
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: AuthorizationContext
focal_class.signature: AuthorizationContext getAuthorizationContext()
focal_class.class_method_signature: ImmutableTarget.getIssuedAcknowledgementLabel()
focal_class.full_signature: @Override public Optional<AcknowledgementLabel> getIssuedAcknowledgementLabel()
focal_class.identifier: getIssuedAcknowledgementLabel
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: Optional<AcknowledgementLabel>
focal_class.signature: Optional<AcknowledgementLabel> getIssuedAcknowledgementLabel()
focal_class.class_method_signature: ImmutableTarget.getHeaderMapping()
focal_class.full_signature: @Override public Optional<HeaderMapping> getHeaderMapping()
focal_class.identifier: getHeaderMapping
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: Optional<HeaderMapping>
focal_class.signature: Optional<HeaderMapping> getHeaderMapping()
focal_class.class_method_signature: ImmutableTarget.getPayloadMapping()
focal_class.full_signature: @Override public PayloadMapping getPayloadMapping()
focal_class.identifier: getPayloadMapping
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: PayloadMapping
focal_class.signature: PayloadMapping getPayloadMapping()
focal_class.class_method_signature: ImmutableTarget.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: ImmutableTarget.fromJson(final JsonObject jsonObject)
focal_class.full_signature: public static Target fromJson(final JsonObject jsonObject)
focal_class.identifier: fromJson
focal_class.modifiers: public static
focal_class.parameters: (final JsonObject jsonObject)
focal_class.return: Target
focal_class.signature: Target fromJson(final JsonObject jsonObject)
focal_class.class_method_signature: ImmutableTarget.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: ImmutableTarget.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: ImmutableTarget.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 Predicate<JsonField> predicate = schemaVersion.and(thePredicate);
          final JsonObjectBuilder jsonObjectBuilder = JsonFactory.newObjectBuilder();
  
          jsonObjectBuilder.set(JsonFields.SCHEMA_VERSION, schemaVersion.toInt(), predicate);
          jsonObjectBuilder.set(JsonFields.ADDRESS, address, predicate);
          jsonObjectBuilder.set(JsonFields.TOPICS, topics.stream()
                  .map(FilteredTopic::toString)
                  .map(JsonFactory::newValue)
                  .collect(JsonCollectors.valuesToArray()), predicate.and(Objects::nonNull));
          if (qos != null) {
              jsonObjectBuilder.set(JsonFields.QOS, qos, predicate);
          }
          if (!authorizationContext.isEmpty()) {
              jsonObjectBuilder.set(JsonFields.AUTHORIZATION_CONTEXT, authorizationContext.stream()
                      .map(AuthorizationSubject::getId)
                      .map(JsonFactory::newValue)
                      .collect(JsonCollectors.valuesToArray()), predicate);
          }
  
          if (issuedAcknowledgementLabel != null) {
              jsonObjectBuilder.set(JsonFields.ISSUED_ACKNOWLEDGEMENT_LABEL, issuedAcknowledgementLabel.toString(),
                      predicate);
          }
  
          if (headerMapping != null) {
              jsonObjectBuilder.set(JsonFields.HEADER_MAPPING, headerMapping.toJson(schemaVersion, thePredicate),
                      predicate);
          }
  
          if (!payloadMapping.isEmpty()) {
              jsonObjectBuilder.set(Target.JsonFields.PAYLOAD_MAPPING, payloadMapping.toJson(), predicate);
          }
  
          return jsonObjectBuilder.build();
      }
focal_method.class_method_signature: ImmutableTarget.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: and newObjectBuilder set toInt set set collect map map stream valuesToArray and set isEmpty set collect map map stream valuesToArray set toString set toJson isEmpty set toJson build
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)