-
- All Implemented Interfaces:
-
com.mobwith.imgmodule.load.Key
public class ImageUrl implements Key
A wrapper for strings representing http/https URLs responsible for ensuring URLs are properly escaped and avoiding unnecessary URL instantiations for loaders that require only string urls rather than URL objects.
Users wishing to replace the class for handling URLs must register a factory using ImageModuleUrl.
To obtain a properly escaped URL, call toURL. To obtain a properly escaped string URL, call toStringUrl. To obtain a less safe, but less expensive to calculate cache key, call getCacheKey.
This class can also optionally wrap com.mobwith.imgmodule.load.model.Headers for convenience.
-
-
Method Summary
Modifier and Type Method Description URLtoURL()StringtoStringUrl()Returns a properly escaped String url that can be used to make http/https requests. StringgetCacheKey()Returns an inexpensive to calculate String suitable for use as a disk cache key. StringtoString()voidupdateDiskCacheKey(@NonNull() MessageDigest messageDigest)Adds all uniquely identifying information to the given digest. booleanequals(Object o)inthashCode()-
-
Method Detail
-
toStringUrl
String toStringUrl()
Returns a properly escaped String url that can be used to make http/https requests.
-
getCacheKey
String getCacheKey()
Returns an inexpensive to calculate String suitable for use as a disk cache key.
This method does not include headers.
Unlike toStringUrl} and toURL, this method does not escape input.
-
updateDiskCacheKey
void updateDiskCacheKey(@NonNull() MessageDigest messageDigest)
Adds all uniquely identifying information to the given digest.
Note - Using reset inside of this method will resultin undefined behavior.
-
hashCode
int hashCode()
-
-
-
-