Skip to content

Commit

Permalink
remove next
Browse files Browse the repository at this point in the history
  • Loading branch information
szysas committed Jun 13, 2023
1 parent ddef1f8 commit fbd17e9
Showing 1 changed file with 1 addition and 13 deletions.
14 changes: 1 addition & 13 deletions coap-core/src/main/java/com/mbed/coap/packet/CoapResponse.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,25 +19,17 @@
import com.mbed.coap.transport.TransportContext;
import java.net.InetSocketAddress;
import java.util.Objects;
import java.util.concurrent.CompletableFuture;
import java.util.function.Consumer;
import java.util.function.Supplier;

public class CoapResponse {
private final Code code;
private final HeaderOptions options;
private final Opaque payload;
public transient final Supplier<CompletableFuture<CoapResponse>> next;

private CoapResponse(Code code, Opaque payload, HeaderOptions options, Supplier<CompletableFuture<CoapResponse>> next) {
public CoapResponse(Code code, Opaque payload, HeaderOptions options) {
this.code = code;
this.payload = Objects.requireNonNull(payload);
this.options = Objects.requireNonNull(options);
this.next = next;
}

public CoapResponse(Code code, Opaque payload, HeaderOptions options) {
this(code, payload, options, null);
}

public CoapResponse(Code code, Opaque payload) {
Expand Down Expand Up @@ -155,10 +147,6 @@ public String toString() {

// --- MODIFIERS ---

public CoapResponse nextSupplier(Supplier<CompletableFuture<CoapResponse>> next) {
return new CoapResponse(code, payload, options, next);
}

public CoapResponse payload(Opaque newPayload) {
return new CoapResponse(code, newPayload, options);
}
Expand Down

0 comments on commit fbd17e9

Please sign in to comment.