@Test public void testAggregateAvgFilter() { try { agg = new AggregateAvgFilter(null); fail(); } catch (IllegalArgumentException e) { Assert.assertTrue(true); } try { agg = new AggregateAvgFilter(String.class); fail(); } catch (IllegalArgumentException e) { Assert.assertTrue(true); } }
public AggregateAvgFilter(Class< ? > type) { super(type); if (null == type) { String msg = "Type is null."; LOG.error(msg); throw new IllegalArgumentException(msg); } if (!StreamClassUtil.isNumberic(type)) { String msg = "Type is not numberic type."; LOG.error(msg); throw new IllegalArgumentException(msg); } if ((type == Long.class) || (type == long.class)) { setResultType(Long.class); setConcreteAvg(new AggregateAvgLongFilter()); } if ((type == Integer.class) || (type == int.class)) { setResultType(Long.class); setConcreteAvg(new AggregateAvgLongFilter()); } if ((type == Double.class) || (type == double.class)) { setResultType(Double.class); setConcreteAvg(new AggregateAvgDoubleFilter()); } if ((type == Float.class) || (type == float.class)) { setResultType(Double.class); setConcreteAvg(new AggregateAvgDoubleFilter()); } if (type == BigDecimal.class) { setResultType(BigDecimal.class); setConcreteAvg(new AggregateAvgDecimalFilter()); } }
AggregateAvgFilter extends AggregateAvg { public AggregateAvgFilter(Class< ? > type) { super(type); if (null == type) { String msg = "Type is null."; LOG.error(msg); throw new IllegalArgumentException(msg); } if (!StreamClassUtil.isNumberic(type)) { String msg = "Type is not numberic type."; LOG.error(msg); throw new IllegalArgumentException(msg); } if ((type == Long.class) || (type == long.class)) { setResultType(Long.class); setConcreteAvg(new AggregateAvgLongFilter()); } if ((type == Integer.class) || (type == int.class)) { setResultType(Long.class); setConcreteAvg(new AggregateAvgLongFilter()); } if ((type == Double.class) || (type == double.class)) { setResultType(Double.class); setConcreteAvg(new AggregateAvgDoubleFilter()); } if ((type == Float.class) || (type == float.class)) { setResultType(Double.class); setConcreteAvg(new AggregateAvgDoubleFilter()); } if (type == BigDecimal.class) { setResultType(BigDecimal.class); setConcreteAvg(new AggregateAvgDecimalFilter()); } } }
AggregateAvgFilter extends AggregateAvg { public AggregateAvgFilter(Class< ? > type) { super(type); if (null == type) { String msg = "Type is null."; LOG.error(msg); throw new IllegalArgumentException(msg); } if (!StreamClassUtil.isNumberic(type)) { String msg = "Type is not numberic type."; LOG.error(msg); throw new IllegalArgumentException(msg); } if ((type == Long.class) || (type == long.class)) { setResultType(Long.class); setConcreteAvg(new AggregateAvgLongFilter()); } if ((type == Integer.class) || (type == int.class)) { setResultType(Long.class); setConcreteAvg(new AggregateAvgLongFilter()); } if ((type == Double.class) || (type == double.class)) { setResultType(Double.class); setConcreteAvg(new AggregateAvgDoubleFilter()); } if ((type == Float.class) || (type == float.class)) { setResultType(Double.class); setConcreteAvg(new AggregateAvgDoubleFilter()); } if (type == BigDecimal.class) { setResultType(BigDecimal.class); setConcreteAvg(new AggregateAvgDecimalFilter()); } } AggregateAvgFilter(Class< ? > type); }
AggregateAvgFilter extends AggregateAvg { public AggregateAvgFilter(Class< ? > type) { super(type); if (null == type) { String msg = "Type is null."; LOG.error(msg); throw new IllegalArgumentException(msg); } if (!StreamClassUtil.isNumberic(type)) { String msg = "Type is not numberic type."; LOG.error(msg); throw new IllegalArgumentException(msg); } if ((type == Long.class) || (type == long.class)) { setResultType(Long.class); setConcreteAvg(new AggregateAvgLongFilter()); } if ((type == Integer.class) || (type == int.class)) { setResultType(Long.class); setConcreteAvg(new AggregateAvgLongFilter()); } if ((type == Double.class) || (type == double.class)) { setResultType(Double.class); setConcreteAvg(new AggregateAvgDoubleFilter()); } if ((type == Float.class) || (type == float.class)) { setResultType(Double.class); setConcreteAvg(new AggregateAvgDoubleFilter()); } if (type == BigDecimal.class) { setResultType(BigDecimal.class); setConcreteAvg(new AggregateAvgDecimalFilter()); } } AggregateAvgFilter(Class< ? > type); IAggregate cloneAggregate(); }
AggregateAvgFilter extends AggregateAvg { public AggregateAvgFilter(Class< ? > type) { super(type); if (null == type) { String msg = "Type is null."; LOG.error(msg); throw new IllegalArgumentException(msg); } if (!StreamClassUtil.isNumberic(type)) { String msg = "Type is not numberic type."; LOG.error(msg); throw new IllegalArgumentException(msg); } if ((type == Long.class) || (type == long.class)) { setResultType(Long.class); setConcreteAvg(new AggregateAvgLongFilter()); } if ((type == Integer.class) || (type == int.class)) { setResultType(Long.class); setConcreteAvg(new AggregateAvgLongFilter()); } if ((type == Double.class) || (type == double.class)) { setResultType(Double.class); setConcreteAvg(new AggregateAvgDoubleFilter()); } if ((type == Float.class) || (type == float.class)) { setResultType(Double.class); setConcreteAvg(new AggregateAvgDoubleFilter()); } if (type == BigDecimal.class) { setResultType(BigDecimal.class); setConcreteAvg(new AggregateAvgDecimalFilter()); } } AggregateAvgFilter(Class< ? > type); IAggregate cloneAggregate();  }