WebImage

public final classWebImageimplementsParcelable

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

Summary

Constants

static finalParcelable.Creator<WebImage>

Public fields

final int
finalUri
final int

Public constructors

Constructs a newWebImagewith the given URL.

WebImage(Uriurl, int width, int height)

Constructs a newWebImagewith 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(Parcelout, int flags)

Inherited Constants

Fromandroid.os.Parcelable
static final int
static final int

Inherited methods

Fromandroid.os.Parcelable
abstract int

Constants

CREATOR

public static finalParcelable.Creator<WebImage>CREATOR

Public fields

height

public final intheight

url

public finalUriurl

width

public final intwidth

Public constructors

WebImage

publicWebImage(Uriurl)

Constructs a newWebImagewith the given URL.

Parameters
Uriurl

The URL of the image.

Throws
java.lang.IllegalArgumentException

If the URL is null or empty.

WebImage

publicWebImage(Uriurl, int width, int height)

Constructs a newWebImagewith the given URL and dimensions.

Parameters
Uriurl

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 booleanequals(@NullableObjectother)

getHeight

public intgetHeight()

Gets the image height, in pixels.

getUrl

publicUrigetUrl()

Gets the image URL.

getWidth

public intgetWidth()

Gets the image width, in pixels.

hashCode

public inthashCode()

toString

publicStringtoString()

Returns a string representation of this object.

writeToParcel

public voidwriteToParcel(Parcelout, int flags)