public class DefaultRecord extends Object implements Record, Serializable
DefaultRecord
instantiation are unspecified. Some may be null, or some may be zero.
DefaultRecord
instances are not thread-safe.
Synchronization, if needed, shall be done externally by the caller.RecordType
and all
values are also serializable. Note in particular that DefaultRecordSchema
is currently
not serializable, so users wanting serialization may need to define their own
schema implementation.DefaultRecordType
,
DefaultRecordSchema
,
Serialized FormDefined in the sis-utility
module
Constructor and Description |
---|
DefaultRecord(RecordType type)
Creates a new record for the given record type.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object object)
Compares this record with the given object for equality.
|
Map<MemberName,Object> |
getAttributes()
Returns the dictionary of all (name, value) pairs in this record.
|
RecordType |
getRecordType()
Returns the type definition of this record.
|
int |
hashCode()
Returns a hash code value for this record.
|
Object |
locate(MemberName name)
Returns the value for an attribute of the specified name.
|
void |
set(MemberName name,
Object value)
Sets the value for the attribute of the specified name.
|
void |
setAll(Object... newValues)
Sets all attribute values in this record, in attribute order.
|
String |
toString()
Returns a string representation of this record.
|
public DefaultRecord(RecordType type)
setAll(Object[])
.type
- The type definition of the new record.public RecordType getRecordType()
getRecordType
in interface Record
public Map<MemberName,Object> getAttributes()
get
and pt
operations to
the locate(MemberName)
and set(MemberName, Object)
methods respectively.getAttributes
in interface Record
RecordType.getMemberTypes()
public Object locate(MemberName name)
public void set(MemberName name, Object value)
set
in interface Record
name
- The name of the attribute to modify.value
- The new value for the attribute.IllegalArgumentException
- if the given name is not a member of this record.ClassCastException
- if the given value is not an instance of the expected type for this record.public void setAll(Object... newValues)
newValues
- The attribute values.IllegalArgumentException
- if the given number of values does not match the expected number.ClassCastException
- if a value is not an instance of the expected type for this record.public boolean equals(Object object)
public int hashCode()
Copyright © 2010–2015 The Apache Software Foundation. All rights reserved.