@Override public boolean equals (Object obj) { if (obj == null) { return false; } if (!(obj instanceof CsdlCast)) { return false; } CsdlCast csdlCast = (CsdlCast) obj; return (this.getValue() == null ? csdlCast.getValue() == null : this.getValue().equals(csdlCast.getValue())) && (this.getType() == null ? csdlCast.getType() == null : this.getType().equals(csdlCast.getType())) && (this.getMaxLength() == null ? csdlCast.getMaxLength() == null : this.getMaxLength().equals(csdlCast.getMaxLength())) && (this.getPrecision() == null ? csdlCast.getPrecision() == null : this.getPrecision().equals(csdlCast.getPrecision())) && (this.getScale() == null ? csdlCast.getScale() == null : this.getScale().equals(csdlCast.getScale())) && (this.getSrid() == null ? csdlCast.getSrid() == null : String.valueOf(this.getSrid()).equals(String.valueOf(csdlCast.getSrid()))) && (this.getAnnotations() == null ? csdlCast.getAnnotations() == null : checkAnnotations(csdlCast.getAnnotations())); }
@Override public Integer getPrecision() { return cast.getPrecision(); }
@Override public EdmType getType() { if (type == null) { if (cast.getType() == null) { throw new EdmException("Must specify a type for a Cast expression."); } final EdmTypeInfo typeInfo = new EdmTypeInfo.Builder().setEdm(edm).setTypeExpression(cast.getType()).build(); type = typeInfo.getType(); } return type; }
@Override public Integer getMaxLength() { return cast.getMaxLength(); }
@Override public SRID getSrid() { return cast.getSrid(); }
@Override public Integer getScale() { return cast.getScale(); }
private boolean checkAnnotations(List<CsdlAnnotation> csdlCastAnnotations) { if (csdlCastAnnotations == null) { return false; } if (this.getAnnotations().size() == csdlCastAnnotations.size()) { for (int i = 0; i < this.getAnnotations().size(); i++) { if (!this.getAnnotations().get(i).equals(csdlCastAnnotations.get(i))) { return false; } } } else { return false; } return true; }
@Override public Integer getPrecision() { return cast.getPrecision(); }
@Override public EdmType getType() { if (type == null) { if (cast.getType() == null) { throw new EdmException("Must specify a type for a Cast expression."); } final EdmTypeInfo typeInfo = new EdmTypeInfo.Builder().setEdm(edm).setTypeExpression(cast.getType()).build(); type = typeInfo.getType(); } return type; }
@Override public Integer getMaxLength() { return cast.getMaxLength(); }
@Override public SRID getSrid() { return cast.getSrid(); }
@Override public Integer getScale() { return cast.getScale(); }