Package io.debezium.text
Class TokenStream.CaseSensitiveToken
- java.lang.Object
-
- io.debezium.text.TokenStream.CaseSensitiveToken
-
- All Implemented Interfaces:
TokenStream.Token
- Direct Known Subclasses:
TokenStream.CaseInsensitiveToken
- Enclosing class:
- TokenStream
@Immutable protected class TokenStream.CaseSensitiveToken extends Object implements TokenStream.Token
An immutableTokenStream.Tokenthat implements matching using case-sensitive logic.
-
-
Field Summary
Fields Modifier and Type Field Description private intendIndexprivate Positionpositionprivate intstartIndexprivate inttype
-
Constructor Summary
Constructors Constructor Description CaseSensitiveToken(int startIndex, int endIndex, int type, Position position)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intendIndex()Get the index in the raw stream past the last character in the token.intlength()Get the length of the token, which is equivalent toendIndex() - startIndex().booleanmatches(char expected)Determine if the token matches the supplied character.booleanmatches(int expectedType)Determine if the token matches the supplied type.booleanmatches(String expected)Determine if the token matches the supplied string.protected StringmatchString()Positionposition()Get the position of this token, which includes the line number and column number of the first character in the token.intstartIndex()Get the index in the raw stream for the first character in the token.StringtoString()inttype()Get the type of the token.Stringvalue()Get the value of the token, in actual case.TokenStream.TokenwithType(int typeMask)Bitmask ORed with existing type value.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface io.debezium.text.TokenStream.Token
matches
-
-
-
-
Field Detail
-
startIndex
private final int startIndex
-
endIndex
private final int endIndex
-
type
private final int type
-
position
private final Position position
-
-
Constructor Detail
-
CaseSensitiveToken
public CaseSensitiveToken(int startIndex, int endIndex, int type, Position position)
-
-
Method Detail
-
withType
public TokenStream.Token withType(int typeMask)
Description copied from interface:TokenStream.TokenBitmask ORed with existing type value.- Specified by:
withTypein interfaceTokenStream.Token- Parameters:
typeMask- the mask of types- Returns:
- copy of Token with new type
-
type
public final int type()
Description copied from interface:TokenStream.TokenGet the type of the token.- Specified by:
typein interfaceTokenStream.Token- Returns:
- the token's type
-
startIndex
public final int startIndex()
Description copied from interface:TokenStream.TokenGet the index in the raw stream for the first character in the token.- Specified by:
startIndexin interfaceTokenStream.Token- Returns:
- the starting index of the token
-
endIndex
public final int endIndex()
Description copied from interface:TokenStream.TokenGet the index in the raw stream past the last character in the token.- Specified by:
endIndexin interfaceTokenStream.Token- Returns:
- the ending index of the token, which is past the last character
-
length
public final int length()
Description copied from interface:TokenStream.TokenGet the length of the token, which is equivalent toendIndex() - startIndex().- Specified by:
lengthin interfaceTokenStream.Token- Returns:
- the length
-
matches
public final boolean matches(char expected)
Description copied from interface:TokenStream.TokenDetermine if the token matches the supplied character.- Specified by:
matchesin interfaceTokenStream.Token- Parameters:
expected- the expected character value- Returns:
- true if the token's value matches the supplied character value, or false otherwise
-
matches
public boolean matches(String expected)
Description copied from interface:TokenStream.TokenDetermine if the token matches the supplied string.- Specified by:
matchesin interfaceTokenStream.Token- Parameters:
expected- the expected value- Returns:
- true if the token's value matches the supplied value, or false otherwise
-
matches
public final boolean matches(int expectedType)
Description copied from interface:TokenStream.TokenDetermine if the token matches the supplied type.- Specified by:
matchesin interfaceTokenStream.Token- Parameters:
expectedType- the expected integer type- Returns:
- true if the token's value matches the supplied integer type, or false otherwise
-
value
public final String value()
Description copied from interface:TokenStream.TokenGet the value of the token, in actual case.- Specified by:
valuein interfaceTokenStream.Token- Returns:
- the value
-
position
public Position position()
Description copied from interface:TokenStream.TokenGet the position of this token, which includes the line number and column number of the first character in the token.- Specified by:
positionin interfaceTokenStream.Token- Returns:
- the position; never null
-
matchString
protected String matchString()
-
-