import static java.util.Objects.requireNonNull;
+import com.google.common.base.MoreObjects.ToStringHelper;
import com.google.gson.stream.JsonWriter;
import java.io.IOException;
import java.io.OutputStream;
private final PatchStatusContext status;
- public YangPatchStatusBody(final FormatParameters format, final PatchStatusContext status) {
- super(format);
+ public YangPatchStatusBody(final PatchStatusContext status) {
this.status = requireNonNull(status);
}
@Override
- protected void formatToJSON(final OutputStream out, final FormatParameters format) throws IOException {
+ public void formatToJSON(final FormatParameters format, final OutputStream out) throws IOException {
try (var writer = FormattableBodySupport.createJsonWriter(out, format)) {
writer.beginObject().name("ietf-yang-patch:yang-patch-status")
.beginObject().name("patch-id").value(status.patchId());
}
@Override
- protected void formatToXML(final OutputStream out, final FormatParameters format) throws IOException {
+ public void formatToXML(final FormatParameters format, final OutputStream out) throws IOException {
final var writer = FormattableBodySupport.createXmlWriter(out, format);
try {
formatToXML(writer);
writer.writeEndElement();
}
+
+ @Override
+ protected ToStringHelper addToStringAttributes(final ToStringHelper helper) {
+ return helper.add("status", status);
+ }
}