net.anotheria.anodoc.query2.QueryProperty Maven / Gradle / Ivy
package net.anotheria.anodoc.query2;
import java.io.Serializable;
/**
* QueryProperty class.
*
* @author another
* @version $Id: $Id
*/
public class QueryProperty implements Serializable{
/**
* svid.
*/
private static final long serialVersionUID = 2030752289719048811L;
/**
* Name of the property.
*/
private String name;
/**
* Value of the property.
*/
private Object value;
private boolean unprepaireable;
/**
* Constructor for QueryProperty.
*
* @param aName a {@link java.lang.String} object.
* @param aValue a {@link java.lang.Object} object.
*/
public QueryProperty(String aName, Object aValue){
this(aName, aValue, false);
}
/**
* Constructor for QueryProperty.
*
* @param aName a {@link java.lang.String} object.
* @param aValue a {@link java.lang.Object} object.
* @param anUnprepaireable a boolean.
*/
public QueryProperty(String aName, Object aValue, boolean anUnprepaireable){
name = aName;
value = aValue;
unprepaireable = anUnprepaireable;
}
/**
* Getter for the field name
.
*
* @return a {@link java.lang.String} object.
*/
public String getName() {
return name;
}
/**
* Setter for the field name
.
*
* @param name a {@link java.lang.String} object.
*/
public void setName(String name) {
this.name = name;
}
/**
* Getter for the field value
.
*
* @return a {@link java.lang.Object} object.
*/
public Object getValue() {
return value;
}
/**
* Setter for the field value
.
*
* @param value a {@link java.lang.Object} object.
*/
public void setValue(Object value) {
this.value = value;
}
/** {@inheritDoc} */
@Override public String toString(){
return getName() + "=" +getValue();
}
/**
* Returns the comparator operation for this query.
*
* @return a {@link java.lang.String} object.
*/
public String getComparator(){
return " = ";
}
/**
* doesMatch.
*
* @param o a {@link java.lang.Object} object.
* @return a boolean.
*/
public boolean doesMatch(Object o){
return o== null ? value == null :
o.equals(value);
}
/**
* unprepaireable.
*
* @return a boolean.
*/
public boolean unprepaireable(){
return unprepaireable;
}
/**
* getOriginalValue.
*
* @return a {@link java.lang.Object} object.
*/
protected Object getOriginalValue(){
return value;
}
}