com.brightcove.proserve.mediaapi.wrapper.apiobjects
Class Image

java.lang.Object
  extended by com.brightcove.proserve.mediaapi.wrapper.apiobjects.Image

public class Image
extends java.lang.Object

Represents an Image object to/from the Media API.

From the Brightcove documentation on 2009/08/18 (http://support.brightcove.com/en/docs/media-api-objects-reference):
This object represents metadata about an image file in your account. Images are associated with videos as thumbnail images or video still images. An image can be a JPEG, GIF, or PNG-formatted image. Note that when creating a new image asset, the only property that is required is type. If you are not uploading a file, the remoteUrl property is also required. For more information, see Adding Images to Videos with the Media API.

property name type read only? description
id long yes A number that uniquely identifies this Image. This id is automatically assigned by Brightcove when the Image is created.
referenceId String no A user-specified id that uniquely identifies this Image.
type ImageTypeEnum no THUMBNAIL or VIDEO_STILL. The type is writable and required when you create an Image; it cannot subsequently be changed.
remoteUrl String no The URL of a remote image file. This property is required if you are not uploading a file for the image asset.
displayName String no The name of the asset, which will be displayed in the Media module.

Author:
Sander Gates

Constructor Summary
Image()
          Default Constructor.
Image(JSONObject jsonObj)
          Constructor using JSON object.
Image(java.lang.String json)
          Constructor using JSON string.
 
Method Summary
 java.lang.String getDisplayName()
          Gets the display name for this Image.
 java.lang.Long getId()
          Gets the id for this Image.
 java.lang.String getReferenceId()
          Gets the reference id for this Image.
 java.lang.String getRemoteUrl()
          Gets the remote URL for this Image.
 ImageTypeEnum getType()
          Gets the type for this Image.
 void initAll()
          Fully initializes the video object by setting all fields to null
 void setDisplayName(java.lang.String displayName)
          Sets the display name for this Image.
 void setId(java.lang.Long id)
          Sets the id for this Image.
 void setReferenceId(java.lang.String referenceId)
          Sets the reference id for this Image.
 void setRemoteUrl(java.lang.String remoteUrl)
          Sets the remote URL for this Image.
 void setType(ImageTypeEnum type)
          Sets the type for this Image.
 JSONObject toJson()
          Converts the image into a JSON object suitable for use with the Media API
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Image

public Image()

Default Constructor.

All fields set to null to start - required fields must be set before calling Write Media API.


Image

public Image(java.lang.String json)
      throws JSONException

Constructor using JSON string.

Given a JSON string from the Media API, attempts to construct a new Image object and fill out all of the fields defined. All other fields will be null.

Throws:
JSONException

Image

public Image(JSONObject jsonObj)
      throws JSONException

Constructor using JSON object.

Given a JSON object from the Media API, attempts to construct a new Image object and fill out all of the fields defined. All other fields will be null.

Throws:
JSONException
Method Detail

initAll

public void initAll()

Fully initializes the video object by setting all fields to null


getId

public java.lang.Long getId()

Gets the id for this Image.

A number that uniquely identifies this Image. This id is automatically assigned by Brightcove when the Image is created.

Returns:
The id for this Image

getReferenceId

public java.lang.String getReferenceId()

Gets the reference id for this Image.

A user-specified id that uniquely identifies this Image.

Returns:
Reference id for this Image

getType

public ImageTypeEnum getType()

Gets the type for this Image.

THUMBNAIL or VIDEO_STILL. The type is writable and required when you create an Image; it cannot subsequently be changed.

Returns:
Type for this Image

getRemoteUrl

public java.lang.String getRemoteUrl()

Gets the remote URL for this Image.

The URL of a remote image file. This property is required if you are not uploading a file for the image asset.

Returns:
Remote URL for this Image

getDisplayName

public java.lang.String getDisplayName()

Gets the display name for this Image.

The name of the asset, which will be displayed in the Media module.

Returns:
Display name for this Image

setId

public void setId(java.lang.Long id)

Sets the id for this Image.

A number that uniquely identifies this Image. This id is automatically assigned by Brightcove when the Image is created.

Parameters:
id - The id for this Image

setReferenceId

public void setReferenceId(java.lang.String referenceId)

Sets the reference id for this Image.

A user-specified id that uniquely identifies this Image.

Parameters:
referenceId - Reference id for this Image

setType

public void setType(ImageTypeEnum type)

Sets the type for this Image.

THUMBNAIL or VIDEO_STILL. The type is writable and required when you create an Image; it cannot subsequently be changed.

Parameters:
type - Type for this Image

setRemoteUrl

public void setRemoteUrl(java.lang.String remoteUrl)

Sets the remote URL for this Image.

The URL of a remote image file. This property is required if you are not uploading a file for the image asset.

Parameters:
remoteUrl - Remote URL for this Image

setDisplayName

public void setDisplayName(java.lang.String displayName)

Sets the display name for this Image.

The name of the asset, which will be displayed in the Media module.

Parameters:
displayName - Display name for this Image

toJson

public JSONObject toJson()
                  throws JSONException

Converts the image into a JSON object suitable for use with the Media API

Returns:
JSON object representing the image
Throws:
JSONException

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object