Package io.servicetalk.http.api
Class CharSequences
- java.lang.Object
-
- io.servicetalk.http.api.CharSequences
-
@Deprecated public final class CharSequences extends java.lang.Object
Deprecated.This class is deprecated and will be removed in a future release. For a replacement, seeCharSequences
.Provides factory methods for creatingCharSequence
implementations.
-
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static boolean
contentEquals(java.lang.CharSequence a, java.lang.CharSequence b)
Deprecated.Returnstrue
if the content of bothCharSequence
's are equals.static boolean
contentEqualsIgnoreCase(java.lang.CharSequence a, java.lang.CharSequence b)
Deprecated.Perform a case-insensitive comparison of twoCharSequence
s.static java.lang.CharSequence
emptyAsciiString()
Deprecated.Get a reference to an unmodifiable emptyCharSequence
with the same properties asnewAsciiString(Buffer)
.static int
indexOf(java.lang.CharSequence sequence, char c, int fromIndex)
Deprecated.Find the index ofc
withinsequence
starting at indexfromIndex
.static boolean
isAsciiString(java.lang.CharSequence sequence)
Deprecated.Check if the providedCharSequence
is an AsciiString, result of a call tonewAsciiString(String)
.static java.lang.CharSequence
newAsciiString(Buffer input)
Deprecated.Create a newCharSequence
from the specifiedinput
, supporting only 8-bit ASCII characters, and with a case-insensitivehashCode
.static java.lang.CharSequence
newAsciiString(java.lang.String input)
Deprecated.Create a newCharSequence
from the specifiedinput
, supporting only 8-bit ASCII characters, and with a case-insensitivehashCode
.static boolean
regionMatches(java.lang.CharSequence cs, boolean ignoreCase, int csStart, java.lang.CharSequence string, int start, int length)
Deprecated.This methods make regionMatches operation correctly for any chars in strings.static java.util.List<java.lang.CharSequence>
split(java.lang.CharSequence input, char delimiter)
Deprecated.Split a givenCharSequence
to separate ones on the givendelimiter
.static Buffer
unwrapBuffer(java.lang.CharSequence cs)
Deprecated.Attempt to unwrap aCharSequence
and obtain the underlyingBuffer
if possible.
-
-
-
Method Detail
-
newAsciiString
public static java.lang.CharSequence newAsciiString(java.lang.String input)
Deprecated.Create a newCharSequence
from the specifiedinput
, supporting only 8-bit ASCII characters, and with a case-insensitivehashCode
.- Parameters:
input
- a string containing only 8-bit ASCII characters.- Returns:
- a
CharSequence
-
newAsciiString
public static java.lang.CharSequence newAsciiString(Buffer input)
Deprecated.Create a newCharSequence
from the specifiedinput
, supporting only 8-bit ASCII characters, and with a case-insensitivehashCode
.- Parameters:
input
- aBuffer
containing- Returns:
- a
CharSequence
.
-
emptyAsciiString
public static java.lang.CharSequence emptyAsciiString()
Deprecated.Get a reference to an unmodifiable emptyCharSequence
with the same properties asnewAsciiString(Buffer)
.- Returns:
- a reference to an unmodifiable empty
CharSequence
with the same properties asnewAsciiString(Buffer)
.
-
isAsciiString
public static boolean isAsciiString(java.lang.CharSequence sequence)
Deprecated.Check if the providedCharSequence
is an AsciiString, result of a call tonewAsciiString(String)
.- Parameters:
sequence
- TheCharSequence
to check.- Returns:
true
if the check passes.
-
unwrapBuffer
@Nullable public static Buffer unwrapBuffer(java.lang.CharSequence cs)
Deprecated.Attempt to unwrap aCharSequence
and obtain the underlyingBuffer
if possible.- Parameters:
cs
- theCharSequence
to unwrap.- Returns:
- the underlying
Buffer
ornull
.
-
contentEqualsIgnoreCase
public static boolean contentEqualsIgnoreCase(@Nullable java.lang.CharSequence a, @Nullable java.lang.CharSequence b)
Deprecated.Perform a case-insensitive comparison of twoCharSequence
s.NOTE: This only supports 8-bit ASCII.
- Parameters:
a
- firstCharSequence
to compare.b
- secondCharSequence
to compare.- Returns:
true
if bothCharSequence
's are equals when ignoring the case.
-
contentEquals
public static boolean contentEquals(java.lang.CharSequence a, java.lang.CharSequence b)
Deprecated.Returnstrue
if the content of bothCharSequence
's are equals. This only supports 8-bit ASCII.- Parameters:
a
- left hand side of comparison.b
- right hand side of comparison.- Returns:
true
ifa
's content equalsb
.
-
indexOf
public static int indexOf(java.lang.CharSequence sequence, char c, int fromIndex)
Deprecated.Find the index ofc
withinsequence
starting at indexfromIndex
.- Parameters:
sequence
- TheCharSequence
to search in.c
- The character to find.fromIndex
- The index to start searching (inclusive).- Returns:
- The index of
c
or-1
otherwise.
-
split
public static java.util.List<java.lang.CharSequence> split(java.lang.CharSequence input, char delimiter)
Deprecated.Split a givenCharSequence
to separate ones on the givendelimiter
. The returnedCharSequence
s are created by invoking theCharSequence.subSequence(int, int)
method on the main one. This method has no support for regex.- Parameters:
input
- The initialCharSequence
to split, this experiences no side effectsdelimiter
- The delimiter character- Returns:
- a
List
ofCharSequence
subsequences of the input with the separated values
-
regionMatches
public static boolean regionMatches(java.lang.CharSequence cs, boolean ignoreCase, int csStart, java.lang.CharSequence string, int start, int length)
Deprecated.This methods make regionMatches operation correctly for any chars in strings.- Parameters:
cs
- theCharSequence
to be processedignoreCase
- specifies if case should be ignored.csStart
- the starting offset in thecs
CharSequencestring
- theCharSequence
to compare.start
- the starting offset in the specifiedstring
.length
- the number of characters to compare.- Returns:
true
if the ranges of characters are equal,false
otherwise.
-
-