Class StringExtensionsKt
-
- All Implemented Interfaces:
public final class StringExtensionsKt
-
-
Method Summary
Modifier and Type Method Description final static StringsnakeToLowerCamelCase(String $self)Converts string written in snake case to String in camel case with the first symbol in lower case. final static StringlowerCamelCaseToGetter(String $self)Converts a string written in lower camel case to a getter method name. final static Pair<String, String>cidToTypeAndId(String $self)Parses CID of channel to channelType and channelId. final static StreamCdnOriginalImageDimensionsgetStreamCdnHostedImageDimensions(String $self)Returns StreamCdnOriginalImageDimensions if the image is hosted by Stream's CDN and is resizable, otherwise returns null. final static StringcreateResizedStreamCdnImageUrl(String $self, @FloatRange(from = 0.0, to = 1.0, fromInclusive = false) Float resizedWidthPercentage, @FloatRange(from = 0.0, to = 1.0, fromInclusive = false) Float resizedHeightPercentage, StreamCdnResizeImageMode resizeMode, StreamCdnCropImageMode cropMode)Generates a string URL with Stream CDN image resizing query parameters added to it. -
-
Method Detail
-
snakeToLowerCamelCase
final static String snakeToLowerCamelCase(String $self)
Converts string written in snake case to String in camel case with the first symbol in lower case. For example string "created_at_some_time" is converted to "createdAtSomeTime".
-
lowerCamelCaseToGetter
final static String lowerCamelCaseToGetter(String $self)
Converts a string written in lower camel case to a getter method name. Ex: "camelCase" -> "getCamelCase".
-
cidToTypeAndId
final static Pair<String, String> cidToTypeAndId(String $self)
Parses CID of channel to channelType and channelId.
- Returns:
Pair<String, String> Pair with channelType and channelId.
-
getStreamCdnHostedImageDimensions
final static StreamCdnOriginalImageDimensions getStreamCdnHostedImageDimensions(String $self)
Returns StreamCdnOriginalImageDimensions if the image is hosted by Stream's CDN and is resizable, otherwise returns null.
- Returns:
Class containing the original width and height dimensions of the image or null.
-
createResizedStreamCdnImageUrl
final static String createResizedStreamCdnImageUrl(String $self, @FloatRange(from = 0.0, to = 1.0, fromInclusive = false) Float resizedWidthPercentage, @FloatRange(from = 0.0, to = 1.0, fromInclusive = false) Float resizedHeightPercentage, StreamCdnResizeImageMode resizeMode, StreamCdnCropImageMode cropMode)
Generates a string URL with Stream CDN image resizing query parameters added to it. Once this URL is called, Stream's CDN will generate a resized image which is accessible using the link returned by this function.
- Parameters:
resizedWidthPercentage- The percentage of the original image width the resized image width will be.resizedHeightPercentage- The percentage of the original image height the resized image height will be.resizeMode- Sets the image resizing mode.cropMode- Sets the image crop mode.
-
-
-
-