it adds the property description in the class FilterPair.

FEA: ItEr75S09ImproveBandboxFinders
This commit is contained in:
Susana Montes Pedreira 2011-07-19 14:56:06 +02:00
parent 644947dac3
commit b0860f98d0

View file

@ -21,6 +21,8 @@
package org.navalplanner.web.common.components.finders;
import org.apache.commons.lang.StringUtils;
/**
* @author Susana Montes Pedreira <smontes@wirelessgalicia.com>
*/
@ -28,6 +30,8 @@ public class FilterPair extends Object {
private IFilterEnum type;
private String typeDescription;
private String pattern;
private Object value;
@ -35,6 +39,14 @@ public class FilterPair extends Object {
public FilterPair() {
}
public FilterPair(IFilterEnum type, String typeDescription, String pattern,
Object value) {
this.type = type;
this.typeDescription = typeDescription;
this.value = value;
this.pattern = pattern;
}
public FilterPair(IFilterEnum type, String pattern, Object value) {
this.type = type;
this.value = value;
@ -64,4 +76,24 @@ public class FilterPair extends Object {
public void setPattern(String pattern) {
this.pattern = pattern;
}
public void setTypeDescription(String typeDescription) {
this.typeDescription = typeDescription;
}
public String getTypeDescription() {
return typeDescription;
}
public String getTypeComplete() {
if (getType() == null) {
return "";
}
String descriptionComplete = getType().toString();
if (!StringUtils.isBlank(this.getTypeDescription())) {
descriptionComplete += " ( " + getTypeDescription() + " )";
}
return descriptionComplete;
}
}