org.restlet.data
Class Language

java.lang.Object
  extended by org.restlet.data.Metadata
      extended by org.restlet.data.Language

public final class Language
extends Metadata

Language used in representations and preferences. A language tag is composed of one or more parts: A primary language tag and a possibly empty series of subtags. When formatted as a string, parts are separated by hyphens.

Author:
Jerome Louvel

Field Summary
static Language ALL
          All languages acceptable.
static Language ENGLISH
          English language.
static Language ENGLISH_US
          English language spoken in USA.
static Language FRENCH
          French language.
static Language FRENCH_FRANCE
          French language spoken in France.
static Language SPANISH
          Spanish language.
 
Constructor Summary
Language(java.lang.String name)
          Constructor.
Language(java.lang.String name, java.lang.String description)
          Constructor.
 
Method Summary
 boolean equals(java.lang.Object object)
          
 java.lang.String getPrimaryTag()
          Returns the primary tag.
 java.util.List<java.lang.String> getSubTags()
          Returns the modifiable list of subtags.
 int hashCode()
          
static Language valueOf(java.lang.String name)
          Returns the language associated to a name.
 
Methods inherited from class org.restlet.data.Metadata
getDescription, getName, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

ALL

public static final Language ALL
All languages acceptable.


ENGLISH

public static final Language ENGLISH
English language.


ENGLISH_US

public static final Language ENGLISH_US
English language spoken in USA.


FRENCH

public static final Language FRENCH
French language.


FRENCH_FRANCE

public static final Language FRENCH_FRANCE
French language spoken in France.


SPANISH

public static final Language SPANISH
Spanish language.

Constructor Detail

Language

public Language(java.lang.String name)
Constructor.

Parameters:
name - The name.

Language

public Language(java.lang.String name,
                java.lang.String description)
Constructor.

Parameters:
name - The name.
description - The description.
Method Detail

valueOf

public static Language valueOf(java.lang.String name)
Returns the language associated to a name. If an existing constant exists then it is returned, otherwise a new instance is created.

Parameters:
name - The name.
Returns:
The associated language.

equals

public boolean equals(java.lang.Object object)

Overrides:
equals in class Metadata

getPrimaryTag

public java.lang.String getPrimaryTag()
Returns the primary tag.

Returns:
The primary tag.

getSubTags

public java.util.List<java.lang.String> getSubTags()
Returns the modifiable list of subtags. This list can be empty.

Returns:
The list of subtags for this language Tag.

hashCode

public int hashCode()

Overrides:
hashCode in class Metadata


Copyright © 2005-2008 Noelios Technologies.