@Override public <T> T get(String fieldName) { if (this.overwrites.containsKey(fieldName)) { return (T) this.overwrites.get(fieldName); } return getWrapped().get(fieldName); }
private int compare(Extension o1, Extension o2, SortClause sortClause) { Object value1 = o1.get(sortClause.getField()); Object value2 = o2.get(sortClause.getField()); if (value1 instanceof Comparable && value2 instanceof Comparable) { return ObjectUtils.compare((Comparable) value1, (Comparable) value2) + (sortClause.getOrder() == ORDER.ASC ? 1 : -1); } return 0; } }
/** * @param filter the filter * @param extension the extension to match * @return true if the extension is matched by the filer * @since 7.0M2 */ public static boolean matches(Filter filter, Extension extension) { return matches(filter, extension.<Object>get(filter.getField())); }