Summary Table

Categories Total Count
PII 0
URL 0
DNS 0
EKL 0
IP 0
PORT 0
VsID 0
CF 0
AI 0
VPD 0
PL 0
Other 0

File Content

package gov.va.med.pbm.ampl.utility.operations.criteria;

import gov.va.med.pbm.ampl.utility.operations.SearchOperators;

/**
* The SearchCriteria class provides the API a format for filtering records from collections.
*
* @author Ian Meinert
*
*/
public class SearchCriteria {
private String key;
private SearchOperators operation;
private Object value;

/**
* The constructor which requires a key, operation, and value.
*
* @param key the field to search on
* @param operation the operation for the filter
* @param value the value to search for
*/
public SearchCriteria(String key, String operation, Object value) {
this.key = key;
this.operation = SearchOperators.getSimpleOperation(operation);
this.value = value;
}

/**
* The getter for the key.
*
*
* @return the field name
*/
public String getKey() {
return key;
}

/**
* The setter for the key.
*
* @param key the field name
*
*/
public void setKey(String key) {
this.key = key;
}

/**
* The getter for the operation.
*
*
* @return the search operator
*/
public SearchOperators getOperation() {
return operation;
}

/**
* The setter for the operation.
*
* @param operation the search operation
*
*/
public void setOperation(SearchOperators operation) {
this.operation = operation;
}

/**
* The getter for the value.
*
*
* @return the value to search for
*/
public Object getValue() {
return value;
}

/**
* The setter for the value.
*
* @param value the value to search for
*
*/
public void setValue(Object value) {
this.value = value;
}

/**
* Returns the class values in a string format.
*
* @allowed
*/
@Override
public String toString() {
return key + operation.getValue() + value;
}
}