class Message {

	public JsonObject toJson() {
		return Json.createObjectBuilder()
				.add("id", id == null ? "" : id)
				.add("tag", tag == null ? "" : tag)
				.add("groupid", messageGroupId == null ? "" : messageGroupId)
				.add("sequencenumber", sequenceNumber)
				.add("sequencetotal", sequenceTotal)
				.add("priority", priority)
				.add("timestamp", timestamp)
				.add("publisher", publisher == null ? "" : publisher)
				.add("authid", authIdentifier == null ? "" : authIdentifier)
				.add("authgroup", authGroup == null ? "" : authGroup)
				.add("version", version)
				.add("chainposition", chainPosition)
				.add("hash", hash == null ? "" : hash)
				.add("previoushash", previousHash == null ? "" : previousHash)
				.add("nonce", nonce == null ? "" : nonce)
				.add("difficultytarget", difficultyTarget)
				.add("infotype", infoType == null ? "" : infoType)
				.add("infoformat", infoFormat == null ? "" : infoFormat)
				.add("contextdata", contextData == null ? "" : new String(Base64.getEncoder().encode(contextData)))
				.add("contentdata", contentData == null ? "" : new String(Base64.getEncoder().encode(contentData)))
				.build();
	}

	public  Message();
	public  Message(String publisher);
	public  Message(JsonObject json);
	public  Message(byte[] rawBytes);
	public  Message(byte[] header, byte[] data);

}