com.endeca.infront.cartridge.model
Class Record

java.lang.Object
  extended by com.endeca.infront.cartridge.model.Record

public class Record
extends Object

A generic data record that could represent a single record or an aggregate record.

A single record has attribute values and potentially a RecordAction to make a record detail request.

An aggregate record is composed of multiple single Records that have the same roll-up key (a property or dimension name). Records in the aggregate record can be accessed by getRecords(). The "representative" record attributes and details action can be accessed by getAttributes() and getDetailsAction() respectively.

See Also:
RecordDetailsHandler, RecordSpotlightHandler

Constructor Summary
Record()
           
 
Method Summary
 Map<String,Attribute> getAttributes()
          Record attribute (property and dimension) values, indexed by name string.
 RecordAction getDetailsAction()
           
 long getNumRecords()
          If aggregate record is enabled, gets the total number of records in the aggregate.
 List<Record> getRecords()
          If aggregate records is enabled, retrieves the list of Records in this aggregate.
 void setAttributes(Map<String,Attribute> attributes)
          Sets the attributes for this record.
 void setDetailsAction(RecordAction detailsAction)
          Sets the detail action of this record.
 void setNumRecords(long numRecsInAggregate)
          Sets the number of aggregate records of this record.
 void setRecords(List<Record> records)
          Sets the list containing the children of this record.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Record

public Record()
Method Detail

getAttributes

public Map<String,Attribute> getAttributes()
Record attribute (property and dimension) values, indexed by name string. The contained AttributeValue objects may have single or multiple assignments, e.g Color = Red, Color = Blue.

For aggregate records, returns the representative and derived attributes. If a derived attribute name overlaps with an existing representative record attribute, the attribute value is overridden by the derived attribute. If zero sub records per representative record have been requested (see ResultsListConfig.setSubRecordsPerAggregateRecord(com.endeca.infront.navigation.model.SubRecordsPerAggregateRecord)), then only derived attributes will be returned.


setAttributes

public void setAttributes(Map<String,Attribute> attributes)
Sets the attributes for this record.

Parameters:
attributes - a map containing the attributes of this record

getDetailsAction

public RecordAction getDetailsAction()
Returns:
The action that can be used to retrieve the full record detail. If aggregate record is enabled, the whole aggregate record may be retrieved. If this object already represents the full aggregate then null is returned.

setDetailsAction

public void setDetailsAction(RecordAction detailsAction)
Sets the detail action of this record.

Parameters:
detailsAction - the details action

getRecords

public List<Record> getRecords()
If aggregate records is enabled, retrieves the list of Records in this aggregate.

Returns:
List of child Record objects or null if aggregate records is not enabled.

setRecords

public void setRecords(List<Record> records)
Sets the list containing the children of this record.

Parameters:
records - the list with the children of this record

getNumRecords

public long getNumRecords()
If aggregate record is enabled, gets the total number of records in the aggregate. This number could be higher than the number of records from getRecords() depending on query parameters.

Returns:
If aggregate records is enabled, the number of records in this aggregate. Else returns 0.

setNumRecords

public void setNumRecords(long numRecsInAggregate)
Sets the number of aggregate records of this record.

Parameters:
numRecsInAggregate - the total number of records in the aggregate


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