@Override
	public boolean equals(Object o) {
		if (!(o instanceof Token)) {
			return false;
		}
		Token token = (Token) o;
		boolean basicmatch = this.kind == token.kind &&
				this.startpos == token.startpos && this.endpos == token.endpos;
		if (!basicmatch)
			return false;
		if (this.kind.hasPayload()) {
			if (!this.data.equals(token.data)) {
				return false;
			}
		}
		return true;
	}
Constructor for use when there is extra data to associate with a token. For example the text for an identifier
token.
spring-xd-dirt/src/main/java/org/springframework/xd/dirt/stream/dsl/Token.java