class Message extends FieldMap {

    @Override
    public String toString() {
        Context context = stringContexts.get();
        if (CharsetSupport.isStringEquivalent()) { // length & checksum can easily be calculated after message is built
            header.setField(context.bodyLength);
            trailer.setField(context.checkSum);
        } else {
            header.setInt(BodyLength.FIELD, bodyLength());
            trailer.setString(CheckSum.FIELD, checksum());
        }
        StringBuilder stringBuilder = context.stringBuilder;
        try {
            header.calculateString(stringBuilder, null, null);
            calculateString(stringBuilder, null, null);
            trailer.calculateString(stringBuilder, null, null);
            if (CharsetSupport.isStringEquivalent()) {
                setBodyLength(stringBuilder);
                setChecksum(stringBuilder);
            }
            return stringBuilder.toString();
        } finally {
            stringBuilder.setLength(0);
        }
    }

    public  Message();
    protected  Message(int[] fieldOrder);
    public  Message(String string);
    public  Message(String string, boolean validate);
    public  Message(String string, DataDictionary dd);
    public  Message(String string, DataDictionary dd, boolean validate);
    public  Message(String string, DataDictionary sessionDictionary, DataDictionary applicationDictionary, boolean validate);

}