// Path: src/main/java/net/nextpulse/jadmin/FormPostEntry.java
// public class FormPostEntry {
//   
//   /**
//    * Key value(s) for this post entry, i.e. the object id, non-editable values.
//    */
//   private LinkedHashMap<String, String> keyValues = new LinkedHashMap<>();
//   /**
//    * Editable values of a resource, i.e. an editable name field.
//    */
//   private LinkedHashMap<String, String> values = new LinkedHashMap<>();
//   
//   public FormPostEntry() {
//   }
//   
//   /**
//    * @return map of unescaped post values
//    */
//   public LinkedHashMap<String, String> getValues() {
//     return values;
//   }
//   
//   public void addValue(String columnName, String value) {
//     values.put(columnName, value);
//   }
//   
//   /**
//    * @return map of unescaped values that make up the identifier of this row
//    */
//   public LinkedHashMap<String, String> getKeyValues() {
//     return keyValues;
//   }
//   
//   /**
//    * Adds a new user supplied value for the specified column.
//    *
//    * @param columnName column name
//    * @param value      user provided value
//    */
//   public void addKeyValue(String columnName, String value) {
//     keyValues.put(columnName, value);
//   }
//   
//   /**
//    * Returns a Map with column keys linked to the submitted values.
//    *
//    * @return this entry as map of column name to value
//    */
//   public Map<String, String> toPropertiesMap() {
//     LinkedHashMap<String, String> output = new LinkedHashMap<>();
//     output.putAll(keyValues);
//     output.putAll(values);
//     return output;
//   }
// }
// 
// Path: src/main/java/net/nextpulse/jadmin/ValidationMode.java
// public enum ValidationMode {
//   /**
//    * Enum value to identify the creation of a new entry
//    */
//   CREATE,
//   /**
//    * Enum value to identify updating an existing entry
//    */
//   EDIT
// }


import net.nextpulse.jadmin.FormPostEntry;
import net.nextpulse.jadmin.ValidationMode;
package net.nextpulse.jadmin.dsl;


/**
 * A functional interface that is used to provide user input validation methods.
 */
@FunctionalInterface
public interface ValidationFunction {
  
  /**
   * Validation function that will be called by the JAdmin internals. The function may throw an InvalidInputException if
   * the provided FormPostEntry does not conform to the validation requirements. Additionally, the function may add or
   * change the data.
   * 
   * @param validationMode validation mode, can be EDIT or NEW
   * @param formPostEntry  user submitted post data
   * @throws InvalidInputException if the object could not be validated
   */
// Path: src/main/java/net/nextpulse/jadmin/FormPostEntry.java
// public class FormPostEntry {
//   
//   /**
//    * Key value(s) for this post entry, i.e. the object id, non-editable values.
//    */
//   private LinkedHashMap<String, String> keyValues = new LinkedHashMap<>();
//   /**
//    * Editable values of a resource, i.e. an editable name field.
//    */
//   private LinkedHashMap<String, String> values = new LinkedHashMap<>();
//   
//   public FormPostEntry() {
//   }
//   
//   /**
//    * @return map of unescaped post values
//    */
//   public LinkedHashMap<String, String> getValues() {
//     return values;
//   }
//   
//   public void addValue(String columnName, String value) {
//     values.put(columnName, value);
//   }
//   
//   /**
//    * @return map of unescaped values that make up the identifier of this row
//    */
//   public LinkedHashMap<String, String> getKeyValues() {
//     return keyValues;
//   }
//   
//   /**
//    * Adds a new user supplied value for the specified column.
//    *
//    * @param columnName column name
//    * @param value      user provided value
//    */
//   public void addKeyValue(String columnName, String value) {
//     keyValues.put(columnName, value);
//   }
//   
//   /**
//    * Returns a Map with column keys linked to the submitted values.
//    *
//    * @return this entry as map of column name to value
//    */
//   public Map<String, String> toPropertiesMap() {
//     LinkedHashMap<String, String> output = new LinkedHashMap<>();
//     output.putAll(keyValues);
//     output.putAll(values);
//     return output;
//   }
// }
// 
// Path: src/main/java/net/nextpulse/jadmin/ValidationMode.java
// public enum ValidationMode {
//   /**
//    * Enum value to identify the creation of a new entry
//    */
//   CREATE,
//   /**
//    * Enum value to identify updating an existing entry
//    */
//   EDIT
// }


// Path: src/main/java/net/nextpulse/jadmin/dsl/ValidationFunction.java
import net.nextpulse.jadmin.FormPostEntry;
import net.nextpulse.jadmin.ValidationMode;

package net.nextpulse.jadmin.dsl;


/**
 * A functional interface that is used to provide user input validation methods.
 */
@FunctionalInterface
public interface ValidationFunction {
  
  /**
   * Validation function that will be called by the JAdmin internals. The function may throw an InvalidInputException if
   * the provided FormPostEntry does not conform to the validation requirements. Additionally, the function may add or
   * change the data.
   * 
   * @param validationMode validation mode, can be EDIT or NEW
   * @param formPostEntry  user submitted post data
   * @throws InvalidInputException if the object could not be validated
   */
  void apply(ValidationMode validationMode, FormPostEntry formPostEntry) throws InvalidInputException;