com.github.dreamhead.moco.dumper.InternalMessageContent Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of moco-core Show documentation
Show all versions of moco-core Show documentation
Moco is an easy setup stub framework, mainly focusing on testing and integration.
package com.github.dreamhead.moco.dumper;
import com.fasterxml.jackson.annotation.JsonAutoDetect;
import com.github.dreamhead.moco.model.MessageContent;
import java.nio.charset.Charset;
import static com.github.dreamhead.moco.model.MessageContent.content;
@JsonAutoDetect(fieldVisibility = JsonAutoDetect.Visibility.ANY)
public class InternalMessageContent {
private byte[] content;
private Charset charset;
public InternalMessageContent() {
}
public InternalMessageContent(byte[] content, Charset charset) {
this.content = content;
this.charset = charset;
}
public MessageContent toContent() {
return content().withCharset(charset).withContent(content).build();
}
}