org.davesag.generica.core
Class Media

java.lang.Object
  extended byorg.davesag.generica.core.AbstractDateStamped
      extended byorg.davesag.generica.core.AbstractContent
          extended byorg.davesag.generica.core.AbstractExtensibleContent
              extended byorg.davesag.generica.core.Media
All Implemented Interfaces:
Content, DateStamped, Extensible, Localisable, Persistable, Serializable

public class Media
extends AbstractExtensibleContent
implements Serializable

The Media bean represents some very basic information about a piece of media. Note that we don't keen the actual binary data in this object.

Since:
Visuality Lite 1.0.0
Version:
CVS Revision $Id: Media.java,v 1.7 2004/04/08 13:19:08 davesag Exp $
Author:
Dave Sag http://www.davesag.com
See Also:
Serialized Form

Field Summary
protected  String theFilePath
          The media's file path.
protected  String theLinkBackURL
          The media's linkback url.
protected  MediaType theMediaType
          The medias's type.
protected  String theSourceURL
          The media's source url.
protected  String theTitle
          The media's title.
 
Fields inherited from class org.davesag.generica.core.AbstractExtensibleContent
theMetaData
 
Fields inherited from class org.davesag.generica.core.AbstractContent
theCountryCode, theLanguageCode
 
Fields inherited from class org.davesag.generica.core.AbstractDateStamped
theCreated, theId, theLastModified
 
Constructor Summary
Media()
          Null constructor required by hibernate.
Media(String title, String sourceurl, String linkbackurl, String filepath)
          Constructor takes a title and source url and populates a simple media object.
 
Method Summary
 boolean equals(Object o)
          Tests if the supplied object is equal to this Media, ie do they have the same Id?
 String getFilePath()
          get the path on disk of the actual media file.
 String getLinkBackURL()
          get the linkback url, ie the url that any links back should point to.
 MediaType getMediaType()
          get the type of media.
 String getSourceURL()
          get the source url of this media, ie where the media file actually is.
 String getTitle()
          the title of this media
 int hashcode()
          Objects must override the hashcode if they override the equals method.
 void setFilePath(String filepath)
          set the file path.
 void setLinkBackURL(String linkback)
          set the linkback url.
 void setMediaType(MediaType mediatype)
          set the media type.
 void setSourceURL(String sourceurl)
          set the source url.
 void setTitle(String title)
          set the title
 String toString()
          a simple string representation of this media.
 
Methods inherited from class org.davesag.generica.core.AbstractExtensibleContent
addMetaData, getMetaData, getMetaData, removeMetaData, setMetaData
 
Methods inherited from class org.davesag.generica.core.AbstractContent
getCountryCode, getLanguageCode, getLocale, setCountryCode, setLanguageCode, setLocale
 
Methods inherited from class org.davesag.generica.core.AbstractDateStamped
getCreated, getId, getLastModified, setCreated, setId, setLastModified, setTemplateId
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.davesag.generica.core.DateStamped
getCreated, getLastModified, setCreated, setLastModified
 

Field Detail

theTitle

protected String theTitle
The media's title.


theSourceURL

protected String theSourceURL
The media's source url. Used to link to the actual media file.


theLinkBackURL

protected String theLinkBackURL
The media's linkback url. Used to link to the media owner's containing page.


theFilePath

protected String theFilePath
The media's file path.


theMediaType

protected MediaType theMediaType
The medias's type.

Constructor Detail

Media

public Media()
Null constructor required by hibernate.


Media

public Media(String title,
             String sourceurl,
             String linkbackurl,
             String filepath)
Constructor takes a title and source url and populates a simple media object. This will be extended shortly.

Parameters:
title - The title of the Media.
sourceurl - The url of the actual piece of media.
linkbackurl - The optional url of the web page containing the media.
filepath - The path to a copy of the actual media file if sotred locally.
Method Detail

getTitle

public String getTitle()
the title of this media

Returns:
the title
Hibernate Property:
length = "255" not-null="true"

setTitle

public void setTitle(String title)
set the title

Parameters:
title - the title.

getSourceURL

public String getSourceURL()
get the source url of this media, ie where the media file actually is.

Returns:
The source url.
Hibernate Property:
length = "255"

setSourceURL

public void setSourceURL(String sourceurl)
set the source url.

Parameters:
sourceurl - the source url.

getLinkBackURL

public String getLinkBackURL()
get the linkback url, ie the url that any links back should point to.

Returns:
The linkback url.
Hibernate Property:
length = "255"

setLinkBackURL

public void setLinkBackURL(String linkback)
set the linkback url.

Parameters:
linkback - the linkback url.

getFilePath

public String getFilePath()
get the path on disk of the actual media file.

Returns:
The file path.
Hibernate Property:
length = "255"

setFilePath

public void setFilePath(String filepath)
set the file path.

Parameters:
filepath - the relative file path.

getMediaType

public MediaType getMediaType()
get the type of media.

Returns:
The media type.

setMediaType

public void setMediaType(MediaType mediatype)
set the media type.

Parameters:
mediatype - the relative media type.

equals

public boolean equals(Object o)
Tests if the supplied object is equal to this Media, ie do they have the same Id?

Overrides:
equals in class AbstractExtensibleContent
Parameters:
o - The object to test against this Media. Must also be a Media to make sense.
Returns:
true if the two Medias have the same id.

hashcode

public int hashcode()
Objects must override the hashcode if they override the equals method.

Specified by:
hashcode in class AbstractContent
Returns:
a valid hashcode for this Merchant.

toString

public String toString()
a simple string representation of this media.

Specified by:
toString in class AbstractContent
Returns:
string description of media


Dave Sag Generica API version 0.5.9 - (prerelease) Copyright 2003 - 2004 Dave Sag.