Skip to content

Commit

Permalink
Implement Constraint.toString
Browse files Browse the repository at this point in the history
  • Loading branch information
findepi committed Mar 4, 2022
1 parent d102e33 commit b6eba77
Showing 1 changed file with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import java.util.Map;
import java.util.Optional;
import java.util.Set;
import java.util.StringJoiner;
import java.util.function.Predicate;

import static io.trino.spi.expression.Constant.TRUE;
Expand Down Expand Up @@ -134,4 +135,15 @@ public Optional<Set<ColumnHandle>> getPredicateColumns()
{
return predicateColumns;
}

@Override
public String toString()
{
StringJoiner stringJoiner = new StringJoiner(", ", Constraint.class.getSimpleName() + "[", "]");
stringJoiner.add("summary=" + summary);
stringJoiner.add("expression=" + expression);
predicate.ifPresent(predicate -> stringJoiner.add("predicate=" + predicate));
predicateColumns.ifPresent(predicateColumns -> stringJoiner.add("predicateColumns=" + predicateColumns));
return stringJoiner.toString();
}
}

0 comments on commit b6eba77

Please sign in to comment.