package lc.mecha.nls;

public class NlsMessage {
    private final String msgFormat;
    private final String code;
    private final int number;

    public NlsMessage(String msgCode, int msgNumber, String format) {
        assert (msgCode != null);
        assert (format != null);

        msgFormat = msgCode.toUpperCase() + "-" + String.format("%05d", msgNumber) + ": " + format;
        this.code = msgCode;
        this.number = msgNumber;
    }

    public String getCode() {
        return code;
    }

    public int getNumber() {
        return number;
    }

    public String format(Object[] values) {
        return String.format(msgFormat, values);
    }

    public String format() {
        return format(null);
    }
}
