All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.avaje.validation.core.DMessage Maven / Gradle / Ivy

Go to download

validator for annotated pojos using constraint annotations and source code generation

There is a newer version: 2.4
Show newest version
package io.avaje.validation.core;

import io.avaje.validation.adapter.ValidationContext;

import java.util.Map;

record DMessage(String template, Map attributes, int dedupNumber)
    implements ValidationContext.Message {

  // templates can be the same across multiple adapters
  // these numbers ensure no cache collision
  private static int messageCounter = 0;

  DMessage(String template, Map attributes) {
    this(template, attributes, messageCounter++);
  }

  @Override
  public String lookupkey() {
    return template + dedupNumber;
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy