com.endeca.itl.record
Class Record

java.lang.Object
  extended by com.endeca.itl.record.Record

public final class Record
extends Object

Represents an Endeca Record that flows through the ITL process into the MDEX Engine. A Record consists of an unordered set of PropertyValue assignments e.g. [Endeca.Id=5, Name=Report.doc, LastModified=12/28/2009]. A Record may contain multiple PropertyValue assignments for a given property name e.g. [Endeca.Id=5, Name=Report.doc, LastModified=12/28/2009, AllowRead=Joe, AllowRead=Bob].

Records can have actions associated with them which are encoded in the Endeca.Action property. See RecordType for the set of valid actions.

See Also:
PropertyValue, RecordType

Constructor Summary
Record()
          Creates a Record with no PropertyValues.
Record(Collection<PropertyValue> propertyValues)
          Creates a Record with the give PropertyValues
Record(PropertyValue... propertyValues)
          Creates a Record with the give PropertyValues
Record(Record record)
          Creates a Record with the same PropertyValues as the given Record.
 
Method Summary
 void addPropertyValue(PropertyValue propertyValue)
          Adds the given PropertyValue to the Record.
 void addPropertyValues(Collection<PropertyValue> propertyValues)
          Adds the given PropertyValues to the Record.
 void addPropertyValues(PropertyValue... propertyValues)
          Adds the given PropertyValues to the Record.
 boolean equals(Object other)
          Equal iff both Records have the exact same PropertyValues.
 Set<String> getAllPropertyNames()
          Returns the names of PropertyValues contained in this Record.
 PropertyValue[] getAllPropertyValues()
          Returns all the PropertyValues contained by the Record.
 int getNumPropertyValues()
          Returns the number of PropertyValues contained in this Record.
 int getNumPropertyValues(String propertyName)
          Returns the number of PropertyValues with the given name.
 PropertyValue getPropertySingleValue(String propertyName)
          Returns the PropertyValue with the given name if exactly one exists in the Record.
 PropertyValue[] getPropertyValues(String propertyName)
          Returns all the PropertyValues with the given name.
 int hashCode()
           
 boolean hasProperty(String propertyName)
          Returns true if the Record contains a PropertyValue with the given name.
 boolean hasPropertyValue(PropertyValue propertyValue)
          Returns true if the Record contains the given PropertyValue.
 void removePropertyValue(PropertyValue propertyValue)
          Removes the given PropertyValue from the Record, if present.
 void removePropertyValues(String propertyName)
          Removes all PropertyValues with the given name from the Record.
 void renamePropertyValues(String oldPropertyName, String newPropertyName)
           
 void setAllPropertyValues(Collection<PropertyValue> properties)
          Set the Record's PropertyValues to the given PropertyValues.
 void setAllPropertyValues(PropertyValue... properties)
          Set the Record's PropertyValues to the given PropertyValues.
 String toString()
           
 String toTruncatedString(int maxStringLen)
          Return properties with values truncated (and appended with an ellipse) if the values exceed the specified maximum.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Record

public Record()
Creates a Record with no PropertyValues.


Record

public Record(Record record)
Creates a Record with the same PropertyValues as the given Record.

Throws:
NullPointerException - if the Record is null

Record

public Record(Collection<PropertyValue> propertyValues)
Creates a Record with the give PropertyValues

Throws:
NullPointerException - if the PropertyValues are null

Record

public Record(PropertyValue... propertyValues)
Creates a Record with the give PropertyValues

Throws:
NullPointerException - if the PropertyValues are null
Method Detail

removePropertyValues

public void removePropertyValues(String propertyName)
Removes all PropertyValues with the given name from the Record.

Throws:
NullPointerException - if the property name is null

removePropertyValue

public void removePropertyValue(PropertyValue propertyValue)
Removes the given PropertyValue from the Record, if present.

Throws:
NullPointerException - if the PropertyValue is null

addPropertyValue

public void addPropertyValue(PropertyValue propertyValue)
Adds the given PropertyValue to the Record.

Throws:
NullPointerException - if the property value is null

addPropertyValues

public void addPropertyValues(PropertyValue... propertyValues)
Adds the given PropertyValues to the Record.

Throws:
NullPointerException - if the property values are null

addPropertyValues

public void addPropertyValues(Collection<PropertyValue> propertyValues)
Adds the given PropertyValues to the Record.

Throws:
NullPointerException - if the property values are null

renamePropertyValues

public void renamePropertyValues(String oldPropertyName,
                                 String newPropertyName)

getAllPropertyValues

public PropertyValue[] getAllPropertyValues()
Returns all the PropertyValues contained by the Record.


setAllPropertyValues

public void setAllPropertyValues(PropertyValue... properties)
Set the Record's PropertyValues to the given PropertyValues.

Throws:
NullPointerException - if the property values are null

setAllPropertyValues

public void setAllPropertyValues(Collection<PropertyValue> properties)
Set the Record's PropertyValues to the given PropertyValues.

Throws:
NullPointerException - if the property values are null

getNumPropertyValues

public int getNumPropertyValues()
Returns the number of PropertyValues contained in this Record.


getNumPropertyValues

public int getNumPropertyValues(String propertyName)
Returns the number of PropertyValues with the given name.


getPropertyValues

public PropertyValue[] getPropertyValues(String propertyName)
Returns all the PropertyValues with the given name. Returns an empty array if there are no PropertyValues with the given name

Throws:
NullPointerException - if the property name is null

getAllPropertyNames

public Set<String> getAllPropertyNames()
Returns the names of PropertyValues contained in this Record.


hasProperty

public boolean hasProperty(String propertyName)
Returns true if the Record contains a PropertyValue with the given name.

Throws:
NullPointerException - if the property name is null

hasPropertyValue

public boolean hasPropertyValue(PropertyValue propertyValue)
Returns true if the Record contains the given PropertyValue.

Throws:
NullPointerException - if the PropertyValue is null

getPropertySingleValue

public PropertyValue getPropertySingleValue(String propertyName)
Returns the PropertyValue with the given name if exactly one exists in the Record.

Returns:
The PropertyValue with the given name if exactly one exists in the Record. Returns null if no PropertyValues exist in the Record with the given name.
Throws:
IllegalArgumentException - If the Record contains multiple PropertyValues with the given name
NullPointerException - if the property name is null

toString

public String toString()
Overrides:
toString in class Object

toTruncatedString

public String toTruncatedString(int maxStringLen)
Return properties with values truncated (and appended with an ellipse) if the values exceed the specified maximum.


equals

public boolean equals(Object other)
Equal iff both Records have the exact same PropertyValues.

Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object


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