Skip to content

Commit 9821ad9

Browse files
committed
add HalResponse.toVoidEntity() for responses without body
1 parent ccc9348 commit 9821ad9

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/main/java/com/contentgrid/hateoas/client/hal/HalResponse.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,15 @@
22

33
import java.util.Objects;
44
import org.springframework.http.ResponseEntity;
5-
import org.springframework.lang.Nullable;
65

76
public interface HalResponse {
87

98
<T> ResponseEntity<T> toEntity(Class<T> bodyType);
109

10+
default ResponseEntity<Void> toVoidEntity() {
11+
return this.toEntity(Void.class);
12+
}
13+
1114
default ResponseEntity<HalDocument> toHalEntity() {
1215
return this.toEntity(HalDocument.class);
1316
}

0 commit comments

Comments
 (0)