Skip to content

Commit

Permalink
Merge pull request #3 from bosch-iot-things/feature/dittoheaderssettable
Browse files Browse the repository at this point in the history
Feature/dittoheaderssettable
  • Loading branch information
Yannic92 authored and GitHub Enterprise committed Feb 1, 2021
2 parents ad864f9 + a0041c6 commit 77d1cfd
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import org.eclipse.ditto.model.base.common.HttpStatus;
import org.eclipse.ditto.model.base.common.HttpStatusCode;
import org.eclipse.ditto.model.base.entity.id.EntityIdWithType;
import org.eclipse.ditto.model.base.headers.WithDittoHeaders;
import org.eclipse.ditto.model.base.headers.DittoHeadersSettable;
import org.eclipse.ditto.signals.acks.base.Acknowledgement;

/**
Expand All @@ -31,7 +31,7 @@
* @since 1.1.0
*/
@Immutable
public interface AcknowledgementRequestHandle extends WithDittoHeaders<AcknowledgementRequestHandle> {
public interface AcknowledgementRequestHandle extends DittoHeadersSettable<AcknowledgementRequestHandle> {

/**
* Returns the {@code AcknowledgementLabel} this handle was created for.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@
import org.eclipse.ditto.json.JsonPointer;
import org.eclipse.ditto.json.JsonValue;
import org.eclipse.ditto.model.base.entity.type.WithEntityType;
import org.eclipse.ditto.model.base.headers.WithDittoHeaders;
import org.eclipse.ditto.model.base.headers.DittoHeadersSettable;
import org.eclipse.ditto.signals.base.WithId;

/**
* Common interface for all Thing related changes.
*
* @since 1.0.0
*/
public interface Change extends WithId, WithEntityType, WithDittoHeaders<Change>, Acknowledgeable {
public interface Change extends WithId, WithEntityType, DittoHeadersSettable<Change>, Acknowledgeable {

/**
* Returns the {@link ChangeAction} which caused this change.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
import org.eclipse.ditto.model.base.common.HttpStatusCode;
import org.eclipse.ditto.model.base.headers.DittoHeaderDefinition;
import org.eclipse.ditto.model.base.headers.DittoHeaders;
import org.eclipse.ditto.model.base.headers.WithDittoHeaders;
import org.eclipse.ditto.model.base.headers.DittoHeadersSettable;
import org.eclipse.ditto.model.base.json.JsonSchemaVersion;
import org.eclipse.ditto.model.things.ThingId;
import org.eclipse.ditto.protocoladapter.Adaptable;
Expand Down Expand Up @@ -239,7 +239,7 @@ protected String buildProtocolCommand(final String protocolCmd, final Map<String
return toSend;
}

protected <T extends WithDittoHeaders<T>> T setChannel(final T signal, final TopicPath.Channel channel) {
protected <T extends DittoHeadersSettable<T>> T setChannel(final T signal, final TopicPath.Channel channel) {
switch (channel) {
case LIVE:
return adjustHeadersForLive(signal);
Expand Down Expand Up @@ -342,7 +342,7 @@ public JsonObject toJson(final JsonSchemaVersion schemaVersion, final Predicate<
};
}

private static <T extends WithDittoHeaders<T>> T adjustHeadersForLive(final T signal) {
private static <T extends DittoHeadersSettable<T>> T adjustHeadersForLive(final T signal) {
return signal.setDittoHeaders(
signal.getDittoHeaders()
.toBuilder()
Expand Down

0 comments on commit 77d1cfd

Please sign in to comment.