Package org.apache.pekko.http.impl.util
Class EnhancedString
java.lang.Object
scala.AnyVal
org.apache.pekko.http.impl.util.EnhancedString
public class EnhancedString
extends scala.AnyVal
INTERNAL API
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionbyte[]Returns the ASCII encoded bytes of this string.booleanendsWith(char c) Determines whether the underlying String ends with the given character.scala.collection.immutable.LinearSeq<String>fastSplit(char delimiter) Splits the underlying string into the segments that are delimited by the given character.voidgetAsciiBytes(byte[] array, int offset) Copies the ASCII encoded bytes of this string into the given byte array starting at theoffsetindex.If the underlying string is null the method returns the empty string, otherwise the underlying string.booleanstartsWith(char c) Determines whether the underlying String starts with the given character.stripMarginWithNewline(String newline) Strips margin and fixes the newline sequence to the given one preventing dependencies on the build platformscala.Option<String>toOption()Returns Some(String) if the underlying string is non-empty, None otherwiseProvides a default toLowerCase that doesn't suffer from the dreaded turkish-i problem.
- 
Constructor Details- 
EnhancedString
 
- 
- 
Method Details- 
underlying
- 
fastSplitSplits the underlying string into the segments that are delimited by the given character. The delimiter itself is never a part of any segment. If the string does not contain the delimiter the result is a List containing only the underlying string. Note that this implementation differs from the original String.split(...) method in that leading and trailing delimiters are NOT ignored, i.e. they trigger the inclusion of an empty leading or trailing empty string (respectively).- Parameters:
- delimiter- (undocumented)
- Returns:
- (undocumented)
 
- 
toOptionReturns Some(String) if the underlying string is non-empty, None otherwise- Returns:
- (undocumented)
 
- 
nullAsEmptyIf the underlying string is null the method returns the empty string, otherwise the underlying string.- Returns:
- (undocumented)
 
- 
asciiBytespublic byte[] asciiBytes()Returns the ASCII encoded bytes of this string. Truncates characters to 8-bit byte value.- Returns:
- (undocumented)
 
- 
getAsciiBytespublic void getAsciiBytes(byte[] array, int offset) Copies the ASCII encoded bytes of this string into the given byte array starting at theoffsetindex. Truncates characters to 8-bit byte value. If the array does not have enough space for the whole string only the portion that fits is copied.- Parameters:
- array- (undocumented)
- offset- (undocumented)
 
- 
startsWithpublic boolean startsWith(char c) Determines whether the underlying String starts with the given character.- Parameters:
- c- (undocumented)
- Returns:
- (undocumented)
 
- 
endsWithpublic boolean endsWith(char c) Determines whether the underlying String ends with the given character.- Parameters:
- c- (undocumented)
- Returns:
- (undocumented)
 
- 
stripMarginWithNewlineStrips margin and fixes the newline sequence to the given one preventing dependencies on the build platform
- 
toRootLowerCaseProvides a default toLowerCase that doesn't suffer from the dreaded turkish-i problem. See http://bugs.java.com/view_bug.do?bug_id=6208680- Returns:
- (undocumented)
 
 
-