package ru.nbch.credit_tracker.enums;

import java.util.Arrays;
import java.util.Collections;

public class EnumKeyMessage {
    private final IEnumKeyCode subject;
    /**
     * Параметры для подстановки в текст сообщения. Все Serializable.
     * args not null.
     */
    private Object[] args;

    public EnumKeyMessage(IEnumKeyCode subject) {
        this.subject = subject;
        this.args = Collections.emptyList().toArray(new Object[0]);
    }


    public EnumKeyMessage(IEnumKeyCode subject, Object... args) {
        this.subject = subject;
        this.args = args;
    }

    public IEnumKeyCode getSubject() {
        return subject;
    }

    public Object[] getArgs() {
        return args;
    }

    public void setArgs(Object[] args) {
        this.args = args;
    }

    @Override
    public String toString() {
        return "EnumKeyMessage{subject=" + subject + ", args: " + Arrays.toString(args) + "}";
    }
}
