Package org.jasig.portlet.newsreader
Class NewsDefinition
java.lang.Object
org.jasig.portlet.newsreader.NewsDefinition
- All Implemented Interfaces:
Comparable<NewsDefinition>
- Direct Known Subclasses:
PredefinedNewsDefinition,UserDefinedNewsDefinition
NewsDefinition represents the base class for news registrations.
Information required to retrieve the news, such as the news's URL
or important default system-wide configuration information may be stored
in the parameters map. In order to add this news for a specific user,
a NewsConfiguration referencing this news definition must be
created.
- Since:
- 5.1.1
- Author:
- Anthony Colebourne, Jen Bourey
-
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor.NewsDefinition(Long id, String className, String name) Constructor for NewsDefinition. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddParameter(String name, String value) Add an individual news parameter.intcompareTo(NewsDefinition def) Returns the name of the adapter class for this news which will determine how the news is retrieved.getId()Return the unique id of this news.getName()Return the display name for this news.Return the map of news parameters.booleanisPredefined.voidsetClassName(String className) Set the name of the adapter class for this news which will determine how the news is retrieved.voidSet the unique id for this news.voidSet the display name for this news.voidsetParameters(Map<String, String> parameters) Set the map of news parameters.toString()
-
Constructor Details
-
Method Details
-
getId
Return the unique id of this news.- Returns:
- a
Longobject
-
setId
Set the unique id for this news.- Parameters:
id- aLongobject
-
getClassName
Returns the name of the adapter class for this news which will determine how the news is retrieved. This id must match a news adapter registered in the spring context files.- Returns:
- a
Stringobject
-
setClassName
Set the name of the adapter class for this news which will determine how the news is retrieved. This id must match a news adapter registered in the spring context files.- Parameters:
className- aStringobject
-
getName
Return the display name for this news.- Returns:
- a
Stringobject
-
setName
Set the display name for this news.- Parameters:
name- aStringobject
-
isPredefined
public boolean isPredefined()isPredefined.
- Returns:
- a boolean
-
getParameters
Return the map of news parameters. These parameters can hold any extra information needed by the particular adapter used by this news, such as a URL.- Returns:
- parameter map
-
setParameters
Set the map of news parameters. These parameters can hold any extra information needed by the particular adapter used by this news, such as a URL.- Parameters:
parameters- parameter map
-
addParameter
Add an individual news parameter. These parameters can hold any extra information needed by the particular adapter used by this news, such as a URL.- Parameters:
name- parameter name (key)value- value to be stored
-
toString
-
compareTo
- Specified by:
compareToin interfaceComparable<NewsDefinition>
-