2015-06-05 11:43:53 +02:00
|
|
|
/**
|
|
|
|
*
|
|
|
|
*/
|
2015-06-08 17:30:08 +02:00
|
|
|
package org.gcube.accounting.datamodel.decorators;
|
2015-06-05 11:43:53 +02:00
|
|
|
|
|
|
|
import java.io.Serializable;
|
|
|
|
|
2015-06-08 18:20:02 +02:00
|
|
|
import org.gcube.accounting.datamodel.UsageRecord;
|
2015-12-18 17:09:05 +01:00
|
|
|
import org.gcube.documentstore.exception.InvalidValueException;
|
2015-06-05 12:54:26 +02:00
|
|
|
|
2015-06-05 11:43:53 +02:00
|
|
|
/**
|
|
|
|
* @author Luca Frosini (ISTI - CNR) http://www.lucafrosini.com/
|
|
|
|
*/
|
2015-06-09 17:36:38 +02:00
|
|
|
public interface FieldAction {
|
2015-06-08 18:20:02 +02:00
|
|
|
|
2015-06-05 18:50:07 +02:00
|
|
|
/**
|
2015-06-08 18:20:02 +02:00
|
|
|
* Validate (and eventually convert) the value of the property identified by
|
|
|
|
* the key.
|
|
|
|
* @param key The key of the property
|
|
|
|
* @param value The value to be validated (and eventually converted) of the
|
|
|
|
* property
|
|
|
|
* @param usageRecord the Usage Record the property is attached
|
|
|
|
* @return the validated (and eventually converted) value of the property
|
|
|
|
* @throws InvalidValueException if the validation or the eventual
|
|
|
|
* conversion fails
|
2015-06-05 18:50:07 +02:00
|
|
|
*/
|
2015-11-30 17:49:18 +01:00
|
|
|
public Comparable<? extends Serializable> validate(String key, Comparable<? extends Serializable> value, UsageRecord usageRecord) throws InvalidValueException;
|
2015-06-05 11:43:53 +02:00
|
|
|
|
|
|
|
}
|