it.tidalwave.role.spi
Class DefaultDisplayable

Package class diagram package DefaultDisplayable
java.lang.Object
  extended by it.tidalwave.role.spi.DefaultDisplayable
All Implemented Interfaces:
Displayable, LocalizedDisplayable, Serializable

public class DefaultDisplayable
extends Object
implements LocalizedDisplayable, Serializable

A default implementation of LocalizedDisplayable which a single, immutable display name in Locale.ENGLISH language.

Version:
$Id$
Author:
Fabrizio Giudici
See Also:
Serialized Form
Status: stable API

Field Summary
 
Fields inherited from interface it.tidalwave.role.LocalizedDisplayable
LocalizedDisplayable
 
Fields inherited from interface it.tidalwave.role.Displayable
DEFAULT, Displayable
 
Constructor Summary
DefaultDisplayable(String displayName)
          Creates an instance with a given display name.
DefaultDisplayable(String displayName, String toStringName)
          Creates an instance with a given display name in Locale.ENGLISH and an explicit identifier for toString().
 
Method Summary
 String getDisplayName()
          Returns the display name in the current Locale.
 String getDisplayName(Locale locale)
          Returns the display name in the given Locale.
 Map<Locale,String> getDisplayNames()
          Returns all the display names in Map where they are indexed by Locale.
 SortedSet<Locale> getLocales()
          Returns the supported Locales.
 String toString()
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DefaultDisplayable

public DefaultDisplayable(@Nonnull
                          String displayName)
Creates an instance with a given display name.

Parameters:
displayName - the display name

DefaultDisplayable

public DefaultDisplayable(@Nonnull
                          String displayName,
                          @Nonnull
                          String toStringName)
Creates an instance with a given display name in Locale.ENGLISH and an explicit identifier for toString().

Parameters:
displayName - the display name
toStringName - the name to be rendered when toString() is called
Method Detail

getDisplayName

@Nonnull
public String getDisplayName()
Returns the display name in the current Locale.

Specified by:
getDisplayName in interface Displayable

getDisplayName

@Nonnull
public String getDisplayName(@Nonnull
                                     Locale locale)
Returns the display name in the given Locale.

Specified by:
getDisplayName in interface LocalizedDisplayable
Parameters:
locale - the Locale
Returns:
the display name

getLocales

@Nonnull
public SortedSet<Locale> getLocales()
Returns the supported Locales.

Specified by:
getLocales in interface LocalizedDisplayable
Returns:
the available Locales

getDisplayNames

@Nonnull
public Map<Locale,String> getDisplayNames()
Returns all the display names in Map where they are indexed by Locale.

Specified by:
getDisplayNames in interface LocalizedDisplayable
Returns:
the display names

toString

@Nonnull
public String toString()

Overrides:
toString in class Object


Copyright © 2009-2012 Tidalwave s.a.s.. All Rights Reserved.