Errai 3.0.1-SNAPSHOT

org.jboss.errai.ui.nav.client.local
Class HistoryToken

java.lang.Object
  extended by org.jboss.errai.ui.nav.client.local.HistoryToken

public class HistoryToken
extends Object

Represents the "history token" part of the location: the Errai UI Navigation page name plus the names and values of its state parameters.

A history token consists of a mandatory page name followed by optional key=value pairs. For example:

     MyPage;key1=value1&key2=value2&multiKey=value1&multiKey=value2
 
Keys are case-sensitive, so key and kEy are different keys.

Author:
Jonathan Fuerth

Method Summary
 boolean equals(Object obj)
           
 String getPageName()
          Returns the page name.
 com.google.common.collect.Multimap<String,String> getState()
          Returns an immutable map of the state information in this history token.
 int hashCode()
           
static HistoryToken of(String pageName, com.google.common.collect.Multimap<String,String> state)
          Returns a HistoryToken of the given page name and state encoded into the given string.
static HistoryToken parse(String token)
          Returns a HistoryToken that represents the page name and state encoded into the given string.
 String toString()
          Returns this history token's name and state parameters in the format that can be parsed by parse(String).
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

of

public static HistoryToken of(String pageName,
                              com.google.common.collect.Multimap<String,String> state)
Returns a HistoryToken of the given page name and state encoded into the given string.

Parameters:
pageName - the name of the page this History Token points to. Must not be null.
Returns:
a HistoryToken with the given parameters. Never null.

parse

public static HistoryToken parse(String token)
Returns a HistoryToken that represents the page name and state encoded into the given string.

Parameters:
token - A history token string (must not be null). The format is described in the class-level documentation.
Returns:
a HistoryToken. Never null.

toString

public String toString()
Returns this history token's name and state parameters in the format that can be parsed by parse(String).

Overrides:
toString in class Object

getPageName

public String getPageName()
Returns the page name. Guaranteed non-null.


getState

public com.google.common.collect.Multimap<String,String> getState()
Returns an immutable map of the state information in this history token.


hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

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

Errai 3.0.1-SNAPSHOT

Copyright © 2013-2014 JBoss, a division of Red Hat. All Rights Reserved.