public boolean equals(Object obj) { if (!super.equals(obj)) return false; if (!(obj instanceof SearchedCaseExpression)) return false; return when.equals(((SearchedCaseExpression)obj).when); } }
public boolean equals(Object obj) { if (obj == this) return true; if (!(obj instanceof AbstractCaseExpression)) return false; AbstractCaseExpression other = (AbstractCaseExpression)obj; return (getThen().equals(other.getThen()) && EquivalenceUtil.areEqual(getElseExpression(), other.getElseExpression()) && EquivalenceUtil.areEqual(getType(), other.getType())); }
public static void setTypeIfNull(Expression symbol, Class<?> replacement) { if(!DataTypeManager.DefaultDataClasses.NULL.equals(symbol.getType()) && symbol.getType() != null) { return; } symbol = SymbolMap.getExpression(symbol); if(symbol instanceof Constant) { ((Constant)symbol).setType(replacement); } else if (symbol instanceof AbstractCaseExpression) { ((AbstractCaseExpression)symbol).setType(replacement); } else if (symbol instanceof ScalarSubquery) { ((ScalarSubquery)symbol).setType(replacement); } else if(symbol instanceof ElementSymbol) { ElementSymbol elementSymbol = (ElementSymbol)symbol; elementSymbol.setType(replacement); } else { try { ResolverUtil.setDesiredType(symbol, replacement, symbol); } catch (QueryResolverException e) { //cannot happen } } }
public static void helpTestThenExpressions(AbstractCaseExpression caseExpr, int expectedThens) { assertEquals(expectedThens, caseExpr.getWhenCount()); for (int i = 0; i < expectedThens; i++) { assertEquals(new Constant(new Integer(i)), caseExpr.getThenExpression(i)); } }
public static void setTypeIfNull(Expression symbol, Class<?> replacement) { if(!DataTypeManager.DefaultDataClasses.NULL.equals(symbol.getType()) && symbol.getType() != null) { return; } symbol = SymbolMap.getExpression(symbol); if(symbol instanceof Constant) { ((Constant)symbol).setType(replacement); } else if (symbol instanceof AbstractCaseExpression) { ((AbstractCaseExpression)symbol).setType(replacement); } else if (symbol instanceof ScalarSubquery) { ((ScalarSubquery)symbol).setType(replacement); } else if(symbol instanceof ElementSymbol) { ElementSymbol elementSymbol = (ElementSymbol)symbol; elementSymbol.setType(replacement); } else { try { ResolverUtil.setDesiredType(symbol, replacement, symbol); } catch (QueryResolverException e) { //cannot happen } } }
public boolean equals(Object obj) { if (obj == this) return true; if (!(obj instanceof AbstractCaseExpression)) return false; AbstractCaseExpression other = (AbstractCaseExpression)obj; return (getThen().equals(other.getThen()) && EquivalenceUtil.areEqual(getElseExpression(), other.getElseExpression()) && EquivalenceUtil.areEqual(getType(), other.getType())); }
public boolean equals(Object obj) { if (!super.equals(obj)) return false; if (!(obj instanceof SearchedCaseExpression)) return false; return when.equals(((SearchedCaseExpression)obj).when); } }
public static void setTypeIfNull(Expression symbol, Class<?> replacement) { if(!DataTypeManager.DefaultDataClasses.NULL.equals(symbol.getType()) && symbol.getType() != null) { return; } symbol = SymbolMap.getExpression(symbol); if(symbol instanceof Constant) { ((Constant)symbol).setType(replacement); } else if (symbol instanceof AbstractCaseExpression) { ((AbstractCaseExpression)symbol).setType(replacement); } else if (symbol instanceof ScalarSubquery) { ((ScalarSubquery)symbol).setType(replacement); } else if(symbol instanceof ElementSymbol) { ElementSymbol elementSymbol = (ElementSymbol)symbol; elementSymbol.setType(replacement); } else { try { ResolverUtil.setDesiredType(symbol, replacement, symbol); } catch (QueryResolverException e) { //cannot happen } } }
public boolean equals(Object obj) { if (obj == this) return true; if (!(obj instanceof AbstractCaseExpression)) return false; AbstractCaseExpression other = (AbstractCaseExpression)obj; return (getThen().equals(other.getThen()) && EquivalenceUtil.areEqual(getElseExpression(), other.getElseExpression()) && EquivalenceUtil.areEqual(getType(), other.getType())); }
public boolean equals(Object obj) { if (!super.equals(obj)) return false; if (!(obj instanceof SearchedCaseExpression)) return false; return when.equals(((SearchedCaseExpression)obj).when); } }
public boolean equals(Object obj) { if (!super.equals(obj)) return false; if (!(obj instanceof CaseExpression)) return false; CaseExpression other = (CaseExpression)obj; return getExpression().equals(other.getExpression()) && when.equals(other.when); } }
public boolean equals(Object obj) { if (!super.equals(obj)) return false; if (!(obj instanceof CaseExpression)) return false; CaseExpression other = (CaseExpression)obj; return getExpression().equals(other.getExpression()) && when.equals(other.when); } }
public boolean equals(Object obj) { if (!super.equals(obj)) return false; if (!(obj instanceof CaseExpression)) return false; CaseExpression other = (CaseExpression)obj; return getExpression().equals(other.getExpression()) && when.equals(other.when); } }