com.silverpeas.gallery.web
Class AbstractMediaEntity<T extends AbstractMediaEntity<T>>

java.lang.Object
  extended by com.silverpeas.gallery.web.AbstractMediaEntity<T>
All Implemented Interfaces:
com.silverpeas.web.Exposable, Serializable
Direct Known Subclasses:
PhotoEntity, SoundEntity, StreamingEntity, VideoEntity

public abstract class AbstractMediaEntity<T extends AbstractMediaEntity<T>>
extends Object
implements com.silverpeas.web.Exposable

Web entity abstraction which provides common media informations of the entity

Author:
Yohann Chastagnier
See Also:
Serialized Form

Constructor Summary
protected AbstractMediaEntity()
           
protected AbstractMediaEntity(Media media)
          Instantiating a new web entity from the corresponding data
 
Method Summary
 boolean equals(Object obj)
           
protected  String getAuthor()
           
protected  String getDescription()
           
 int getHeight()
           
protected  String getId()
           
protected  URI getParentURI()
           
 URI getThumbUrl()
           
protected  String getTitle()
           
 MediaType getType()
           
 URI getURI()
           
 URI getUrl()
           
 int getWidth()
           
 int hashCode()
           
protected  void setAuthor(String author)
           
protected  void setDescription(String description)
           
protected  void setId(String id)
           
protected  void setTitle(String title)
           
 void setType(MediaType type)
           
 T withHeight(int height)
           
 T withOriginalUrl(URI originalUrl)
           
 T withParentURI(URI parentURI)
          Sets a parentURI to this entity.
 T withThumbUrl(URI thumbUrl)
           
 T withURI(URI uri)
          Sets a URI to this entity.
 T withWidth(int width)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractMediaEntity

protected AbstractMediaEntity(Media media)
Instantiating a new web entity from the corresponding data

Parameters:
media - the media

AbstractMediaEntity

protected AbstractMediaEntity()
Method Detail

withURI

public T withURI(URI uri)
Sets a URI to this entity. With this URI, it can then be accessed through the Web.

Parameters:
uri - the web entity URI.
Returns:
itself.

withParentURI

public T withParentURI(URI parentURI)
Sets a parentURI to this entity.

Parameters:
parentURI - the parent web entity URI.
Returns:
itself.

withOriginalUrl

public T withOriginalUrl(URI originalUrl)

withThumbUrl

public T withThumbUrl(URI thumbUrl)

withWidth

public T withWidth(int width)

withHeight

public T withHeight(int height)

getURI

public URI getURI()
Specified by:
getURI in interface com.silverpeas.web.Exposable

getParentURI

protected URI getParentURI()

setType

public void setType(MediaType type)

getType

public MediaType getType()

setId

protected void setId(String id)

getId

protected String getId()

setTitle

protected void setTitle(String title)

getTitle

protected String getTitle()

setDescription

protected void setDescription(String description)

getDescription

protected String getDescription()

setAuthor

protected void setAuthor(String author)

getAuthor

protected String getAuthor()

getThumbUrl

public URI getThumbUrl()
Returns:
the thumbUrl

getUrl

public URI getUrl()
Returns:
the url

getHeight

public int getHeight()
Returns:
the height

getWidth

public int getWidth()
Returns:
the width

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object


Copyright © 2016 Silverpeas. All Rights Reserved.