WebImage

public final class WebImage implements Parcelable


A class that represents an image that is located on a web server.

Summary

Constants

static final Parcelable.Creator<WebImage>

Public fields

final int
final Uri
final int

Public constructors

Constructs a new WebImage with the given URL.

WebImage(Uri url, int width, int height)

Constructs a new WebImage with the given URL and dimensions.

Public methods

boolean
int

Gets the image height, in pixels.

Uri

Gets the image URL.

int

Gets the image width, in pixels.

int
String

Returns a string representation of this object.

void
writeToParcel(Parcel out, int flags)

Inherited Constants

From android.os.Parcelable
static final int
static final int

Inherited methods

From android.os.Parcelable
abstract int

Constants

CREATOR

public static final Parcelable.Creator<WebImageCREATOR

Public fields

height

public final int height

url

public final Uri url

width

public final int width

Public constructors

WebImage

public WebImage(Uri url)

Constructs a new WebImage with the given URL.

Parameters
Uri url

The URL of the image.

Throws
java.lang.IllegalArgumentException

If the URL is null or empty.

WebImage

public WebImage(Uri url, int width, int height)

Constructs a new WebImage with the given URL and dimensions.

Parameters
Uri url

The URL of the image.

int width

The width of the image, in pixels.

int height

The height of the image, in pixels.

Throws
java.lang.IllegalArgumentException

If the URL is null or empty, or the dimensions are invalid.

Public methods

equals

public boolean equals(@Nullable Object other)

getHeight

public int getHeight()

Gets the image height, in pixels.

getUrl

public Uri getUrl()

Gets the image URL.

getWidth

public int getWidth()

Gets the image width, in pixels.

hashCode

public int hashCode()

toString

public String toString()

Returns a string representation of this object.

writeToParcel

public void writeToParcel(Parcel out, int flags)