com.endeca.infront.navigation
Interface RecordState


public interface RecordState

The RecordState interface represents a request state that consists of a record spec and a collection of URL parameters.

The interface provides methods for the following operations

Before updating a record, it is important to call inform(ENEQueryResults)


Method Summary
 RecordState clearParameters()
          Create a new RecordState relative to this one, clearing the parameters map.
 String getCanonicalLink()
          Retrieves the canonical link relative to this RecordState.
 String getEncoding()
          Returns the character encoding that is used when marshaling parameters and strings contained within this UrlState.
 String getParameter(String name)
          Returns the value of the parameter with the given name, or null.
 String getRecordSpec()
           
 void inform(com.endeca.navigation.ENEQueryResults results)
          Informs this class of important meta-information.
 boolean isAggregateRecord()
           
 RecordState putAllParameters(Map<String,String> parameters)
          Create a new RecordState relative to this one, updating all of the specified parameters.
 RecordState putParameter(String name, String value)
          Create a new RecordState relative to this one, updating the specified parameter.
 RecordState removeParameter(String name)
          Create a new RecordState relative to this one, removing the specified parameter.
 RecordState updateParameters(Map<String,String> parameters)
          Create a new RecordState relative to this one, replacing the entire existing parameter map with the given one.
 RecordState updateRecordSpec(String recordSpec, boolean isAggregateRecord)
          Create a new RecordState relative to this one, updating just the record spec and the aggregate record property.
 

Method Detail

updateParameters

RecordState updateParameters(Map<String,String> parameters)
Create a new RecordState relative to this one, replacing the entire existing parameter map with the given one.

Parameters:
parameters - the new parameter map
Returns:
the new RecordState

removeParameter

RecordState removeParameter(String name)
Create a new RecordState relative to this one, removing the specified parameter.

Parameters:
name - the name of the parameter to remove
Returns:
the new RecordState

putParameter

RecordState putParameter(String name,
                         String value)
Create a new RecordState relative to this one, updating the specified parameter.

Parameters:
name - the name of the parameter to update
value - the value to update the parameter to
Returns:
the new RecordState

putAllParameters

RecordState putAllParameters(Map<String,String> parameters)
Create a new RecordState relative to this one, updating all of the specified parameters.

This method is needed when adding more than one "remove always" parameter. Since such parameters have been configured to be removed whenever a new NavigationState is constructed from an existing one, they must be added all at once rather than one at a time. Otherwise, for example, the first would be removed when the second was added.

Parameters:
parameters - a map containing entries where the key corresponds to the name of the parameter to update and the value corresponds to the value to update it to
Returns:
the new RecordState

clearParameters

RecordState clearParameters()
Create a new RecordState relative to this one, clearing the parameters map.

Returns:
the new RecordState

getRecordSpec

String getRecordSpec()
Returns:
the record spec
See Also:
updateRecordSpec(String, boolean)

updateRecordSpec

RecordState updateRecordSpec(String recordSpec,
                             boolean isAggregateRecord)
Create a new RecordState relative to this one, updating just the record spec and the aggregate record property.

Parameters:
recordSpec - the new record spec
isAggregateRecord - whether the new RecordState represents an aggregate record
Returns:
the new RecordState

isAggregateRecord

boolean isAggregateRecord()
Returns:
whether this RecordState represents an aggregate record

inform

void inform(com.endeca.navigation.ENEQueryResults results)
Informs this class of important meta-information.

Parameters:
results - a Presentation API ENEQueryResults object containing the meta-information

getCanonicalLink

String getCanonicalLink()
Retrieves the canonical link relative to this RecordState. This should make a best attempt in the implementation of returning a canonical representation of the state.

Returns:
A canonical link representation of the record state.

getParameter

String getParameter(String name)
Returns the value of the parameter with the given name, or null.


getEncoding

String getEncoding()
Returns the character encoding that is used when marshaling parameters and strings contained within this UrlState.

Returns:
Returns the character encoding that is used when marshaling parameters and strings contained within this UrlState.


Copyright © 2012, Oracle and/or its affiliates. All rights reserved.