class OQLFilterBuilder {

	public static Filter<Object> getFilter(String expression) {
		return getFilter(expression, new FilterFactory<Object>() {
			@Override
			public Filter<Object> createFullTextFilter(String expression) {
				throw new RuntimeException("Full text search not implemented");
			}

			@Override
			public Filter<Object> createAttributeFilter(String operator, String attribute, String value) {
				return new Filter<Object>() {
					@Override
					public boolean test(Object input) {
						try {
							return value.equals(PropertyUtils.getProperty(input, attribute));
						} catch (IllegalAccessException | InvocationTargetException | NoSuchMethodException | NestedNullException e) {
							return false;
						}
					}
				};
			}
		});
	}

}