atg.endeca.index.record
Class Record

java.lang.Object
  extended by atg.endeca.index.record.Record

public class Record
extends java.lang.Object

A simple record class that represents an Endeca-like record.

Created: November 16 2011


Field Summary
static java.lang.String CLASS_VERSION
          Class version string
 
Constructor Summary
Record()
           
 
Method Summary
 void addPropertyValue(java.lang.String pPropertyName, java.lang.String pPropertyValue)
          Add a value for the specified property name.
 boolean exactlyEquals(Record pRecord)
          Returns true if this record is exactly equal to the specified record.
 java.lang.String getAsXMLString(ApplicationLogging pLogging)
          Get our records as an XMLString.
 java.util.Map<java.lang.String,java.util.List<java.lang.String>> getNameToValuesMap()
          Return an unmodifiable version of our name/values.
 java.lang.String getOnlyValueForPropertyName(java.lang.String pPropertyName)
          Return the value for the specified property name.
 java.util.Set<java.lang.String> getPropertyNames()
          Return the known property names.
 java.util.List<java.lang.String> getValueListForPropertyName(java.lang.String pPropertyName)
          Return the value list for the specified property name.
 java.util.List<java.lang.String> getValueListForPropertyName(java.lang.String pPropertyName, boolean pCreate)
          Return the value list for the specified property name.
 void setPropertyValue(java.lang.String pPropertyName, java.util.List<java.lang.String> pPropertyValues)
          Set the property to the specified list of values.
 void setPropertyValue(java.lang.String pPropertyName, java.lang.String pPropertyValue)
          Set the value for the specified property name.
 java.lang.String toString()
           
 void writeAsXML(atg.repository.search.indexing.XMLWriter pWriter)
          Write the record out as XML.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

CLASS_VERSION

public static java.lang.String CLASS_VERSION
Class version string

Constructor Detail

Record

public Record()
Method Detail

addPropertyValue

public void addPropertyValue(java.lang.String pPropertyName,
                             java.lang.String pPropertyValue)
Add a value for the specified property name. This value is appended on to the existing values.

Parameters:
pPropertyName - the name of the property whose value to append to.
pPropertyValue - the property value to append.

setPropertyValue

public void setPropertyValue(java.lang.String pPropertyName,
                             java.lang.String pPropertyValue)
Set the value for the specified property name. This clears any existing value, and results in a value list with a single value.

Parameters:
pPropertyName - the name of the property whose value to set.
pPropertyValue - the property value to set.

setPropertyValue

public void setPropertyValue(java.lang.String pPropertyName,
                             java.util.List<java.lang.String> pPropertyValues)
Set the property to the specified list of values. No reference is retained to pPropertyValues.

Parameters:
pPropertyName - the property name to set.
pPropertyValues - the property values to set.

getValueListForPropertyName

public java.util.List<java.lang.String> getValueListForPropertyName(java.lang.String pPropertyName)
Return the value list for the specified property name.


getOnlyValueForPropertyName

public java.lang.String getOnlyValueForPropertyName(java.lang.String pPropertyName)
Return the value for the specified property name. Throws an exception if there is more than value.


getValueListForPropertyName

public java.util.List<java.lang.String> getValueListForPropertyName(java.lang.String pPropertyName,
                                                                    boolean pCreate)
Return the value list for the specified property name.


getPropertyNames

public java.util.Set<java.lang.String> getPropertyNames()
Return the known property names.


getNameToValuesMap

public java.util.Map<java.lang.String,java.util.List<java.lang.String>> getNameToValuesMap()
Return an unmodifiable version of our name/values.


writeAsXML

public void writeAsXML(atg.repository.search.indexing.XMLWriter pWriter)
                throws java.io.IOException,
                       atg.repository.search.indexing.XMLWriterException
Write the record out as XML.

Parameters:
pWriter - the writer to write to.
Throws:
java.io.IOException
atg.repository.search.indexing.XMLWriterException

exactlyEquals

public boolean exactlyEquals(Record pRecord)
Returns true if this record is exactly equal to the specified record.

Parameters:
pRecord - the record to compare ourself to.

getAsXMLString

public java.lang.String getAsXMLString(ApplicationLogging pLogging)
Get our records as an XMLString. Meant for debugging.

Parameters:
pLogging - the logger to if any exceptions are encountered.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object