@Override @PrePersist public void calculateHashes() { if (myHashIdentity == null) { String resourceType = getResourceType(); String paramName = getParamName(); setHashIdentity(calculateHashIdentity(resourceType, paramName)); } }
public Long getHashIdentity() { calculateHashes(); return myHashIdentity; }
@Override public boolean equals(Object theObj) { if (this == theObj) { return true; } if (theObj == null) { return false; } if (!(theObj instanceof ResourceIndexedSearchParamNumber)) { return false; } ResourceIndexedSearchParamNumber obj = (ResourceIndexedSearchParamNumber) theObj; EqualsBuilder b = new EqualsBuilder(); b.append(getParamName(), obj.getParamName()); b.append(getResource(), obj.getResource()); b.append(getValue(), obj.getValue()); b.append(isMissing(), obj.isMissing()); b.append(getHashIdentity(), obj.getHashIdentity()); return b.isEquals(); }
@Override public int hashCode() { HashCodeBuilder b = new HashCodeBuilder(); b.append(getParamName()); b.append(getResource()); b.append(getValue()); b.append(isMissing()); return b.toHashCode(); }
@Override public String toString() { ToStringBuilder b = new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE); b.append("paramName", getParamName()); b.append("resourceId", getResource().getId()); // TODO: add a field so we don't need to resolve this b.append("value", getValue()); return b.build(); }
ResourceIndexedSearchParamNumber nextEntity = new ResourceIndexedSearchParamNumber(resourceName, nextValue.getValue()); nextEntity.setResource(theEntity); retVal.add(nextEntity); } else if (nextObject instanceof Quantity) { ResourceIndexedSearchParamNumber nextEntity = new ResourceIndexedSearchParamNumber(resourceName, nextValue.getValue()); nextEntity.setResource(theEntity); retVal.add(nextEntity); } else if (nextObject instanceof IntegerType) { ResourceIndexedSearchParamNumber nextEntity = new ResourceIndexedSearchParamNumber(resourceName, new BigDecimal(nextValue.getValue())); nextEntity.setResource(theEntity); retVal.add(nextEntity); } else if (nextObject instanceof DecimalType) { ResourceIndexedSearchParamNumber nextEntity = new ResourceIndexedSearchParamNumber(resourceName, nextValue.getValue()); nextEntity.setResource(theEntity); retVal.add(nextEntity); } else {
@Override public boolean matches(IQueryParameterType theParam) { if (!(theParam instanceof NumberParam)) { return false; } NumberParam number = (NumberParam) theParam; return getValue().equals(number.getValue()); }
break; case NUMBER: param = new ResourceIndexedSearchParamNumber(); break; case QUANTITY:
ResourceIndexedSearchParamNumber nextEntity = new ResourceIndexedSearchParamNumber(resourceName, nextValue.getValue()); nextEntity.setResource(theEntity); retVal.add(nextEntity); } else if (nextObject instanceof Quantity) { ResourceIndexedSearchParamNumber nextEntity = new ResourceIndexedSearchParamNumber(resourceName, nextValue.getValue()); nextEntity.setResource(theEntity); retVal.add(nextEntity); } else if (nextObject instanceof IntegerType) { ResourceIndexedSearchParamNumber nextEntity = new ResourceIndexedSearchParamNumber(resourceName, new BigDecimal(nextValue.getValue())); nextEntity.setResource(theEntity); retVal.add(nextEntity); } else if (nextObject instanceof DecimalType) { ResourceIndexedSearchParamNumber nextEntity = new ResourceIndexedSearchParamNumber(resourceName, nextValue.getValue()); nextEntity.setResource(theEntity); retVal.add(nextEntity); } else {
ResourceIndexedSearchParamNumber nextEntity = new ResourceIndexedSearchParamNumber(resourceName, nextValue.getValue()); nextEntity.setResource(theEntity); retVal.add(nextEntity); } else if (nextObject instanceof QuantityDt) { ResourceIndexedSearchParamNumber nextEntity = new ResourceIndexedSearchParamNumber(resourceName, nextValue.getValue()); nextEntity.setResource(theEntity); retVal.add(nextEntity); } else if (nextObject instanceof IntegerDt) { ResourceIndexedSearchParamNumber nextEntity = new ResourceIndexedSearchParamNumber(resourceName, new BigDecimal(nextValue.getValue())); nextEntity.setResource(theEntity); retVal.add(nextEntity); } else if (nextObject instanceof DecimalDt) { ResourceIndexedSearchParamNumber nextEntity = new ResourceIndexedSearchParamNumber(resourceName, nextValue.getValue()); nextEntity.setResource(theEntity); retVal.add(nextEntity); } else {