@Override
 public boolean equals(final Object obj) {
   if (this == obj) {
     return true;
   }
   if (obj == null) {
     return false;
   }
   if (getClass() != obj.getClass()) {
     return false;
   }
   BundleTemplateMessageImpl other = (BundleTemplateMessageImpl) obj;
   if (template == null) {
     if (other.template != null) {
       return false;
     }
   } else if (!template.equals(other.template)) {
     return false;
   }
   if (textDefault == null) {
     if (other.textDefault != null) {
       return false;
     }
   } else if (!textDefault.equals(other.textDefault)) {
     return false;
   }
   if (textKey == null) {
     if (other.textKey != null) {
       return false;
     }
   } else if (!textKey.equals(other.textKey)) {
     return false;
   }
   return true;
 }
  public Message build() {
    String text;
    try {
      text = bundles.get(clientLocale, textKey.getBundle()).getString(textKey.getKey());
    } catch (Exception e) {
      log.warn("Could not load bundle: " + textKey);
      text = textDefault;
    }

    if ((text == null) || "".equals(text)) {
      text = textKey.toString();
    }

    template.text(text);
    return template.build();
  }
 @Override
 public int hashCode() {
   final int prime = 31;
   int result = 1;
   result = prime * result + ((template == null) ? 0 : template.hashCode());
   result = prime * result + ((textDefault == null) ? 0 : textDefault.hashCode());
   result = prime * result + ((textKey == null) ? 0 : textKey.hashCode());
   return result;
 }