org.solovyev.common.msg.AbstractMessage Maven / Gradle / Ivy
/*
* Copyright (c) 2009-2010. Created by serso.
*
* For more information, please, contact [email protected].
*/
package org.solovyev.common.msg;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.solovyev.common.collections.CollectionsUtils;
import org.solovyev.common.equals.EqualsTool;
import org.solovyev.common.equals.ListEqualizer;
import org.solovyev.common.text.StringUtils;
import org.solovyev.common.HashCodeBuilder;
import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Locale;
/**
* User: serso
* Date: Mar 29, 2010
* Time: 10:44:26 PM
*/
public abstract class AbstractMessage implements Message {
@NotNull
private final String messageCode;
@NotNull
private final List> parameters;
@NotNull
private final MessageType messageType;
protected AbstractMessage(@NotNull String messageCode, @NotNull MessageType messageType, @Nullable Object... parameters) {
this(messageCode, messageType, CollectionsUtils.asList(parameters));
}
protected AbstractMessage(@NotNull String messageCode, @NotNull MessageType messageType, @NotNull List> parameters) {
this.messageCode = messageCode;
this.parameters = new ArrayList