All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.dreamhead.moco.dumper.InternalMessageContent Maven / Gradle / Ivy

Go to download

Moco is an easy setup stub framework, mainly focusing on testing and integration.

There is a newer version: 1.5.0
Show newest version
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();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy