org.springframework.data.relational.core.sql

## Interface Segment

All Superinterfaces:
  Visitable

All Known Subinterfaces:
  Assignment, Condition, Delete, Expression, Insert, Select, Update

All Known Implementing Classes:
  AndCondition, AssignValue, AsteriskFromTable, Between, BindMarker, BooleanLiteral, Column, Comparison, Expressions.SimpleExpression, FalseCondition, From, In, Into, IsNull, Join, Like, Literal, MultipleCondition, NestedCondition, Not, NumericLiteral, OrCondition, OrderByField, SelectList, SimpleCondition, SimpleFunction, SimpleSegment, StringLiteral, SubselectExpression, Table, TrueCondition, Values, Where

    public interface Segment
    extends Visitable

Supertype of all Abstract Syntax Tree (AST) segments. Segments are typically immutable and mutator methods return new instances instead of changing the called instance.

Since:
  1.1
Author:
  Mark Paluch

### Method Summary

All Methods Instance Methods Abstract Methods
`boolean` `equals(Object other)` Check whether this `Segment` is equal to another `Segment`.
`int` `hashCode()` Generate a hash code from this`Segment`.
`String` `toString()` Return a SQL string representation of this `Segment`.

### Methods inherited from interface org.springframework.data.relational.core.sql.Visitable

`visit`

### Method Detail

#### equals

    boolean equals(Object other)

Check whether this `Segment` is equal to another `Segment`.

Equality is typically given if the `toString()` representation matches.

Overrides:
  `equals` in class `Object`
Parameters:
  `other` - the reference object with which to compare.
Returns:
  true if this object is the same as the `other` argument; false otherwise.

#### hashCode

    int hashCode()

Generate a hash code from this`Segment`.

Hashcode typically derives from the `toString()` representation so two `Segment`s yield the same `hashCode()` if their `toString()` representation matches.

Overrides:
  `hashCode` in class `Object`
Returns:
  a hash code value for this object.

#### toString

    String toString()

Return a SQL string representation of this `Segment`.

The representation is intended for debugging purposes and an approximation to the generated SQL. While it might work in the context of a specific dialect, you should not that the `toString()` representation works across multiple databases.

Overrides:
  `toString` in class `Object`
Returns:
  a SQL string representation of this `Segment`.