Package org.geotools.api.util
Interface Record
public interface Record
A list of logically related elements as (name, value) pairs in a dictionary. A record may be
used as an implementation representation for features.
This class can be think as the equivalent of the Java Object
class.
- Since:
- GeoAPI 2.1
- Author:
- Bryce Nordgren (USDA), Martin Desruisseaux (IRD)
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionReturns the dictionary of all (name, value) pairs in this record.Returns the type definition of record.locate
(MemberName name) Returns the value for an attribute of the specified name.void
set
(MemberName name, Object value) Set the value for the attribute of the specified name.
-
Method Details
-
getRecordType
RecordType getRecordType()Returns the type definition of record. All attributes named in this record must be defined in the returned record type. In other words, the following relationship must holds:getRecordType().getAttributeTypes().keySet().containsAll(getAttributes().keySet())
This method can be think as the equivalent of the Java
Object.getClass()
method. -
getAttributes
Map<MemberName,Object> getAttributes()Returns the dictionary of all (name, value) pairs in this record. The returned map shall not allows key addition. It may allows the replacement of existing keys only.- See Also:
-
locate
Returns the value for an attribute of the specified name. This is functionnaly equivalent togetAttributes().get(name)
. The type of the returned object is given bygetRecordType().locate(name)
. -
set
Set the value for the attribute of the specified name. This is functionally equivalent togetAttributes().put(name,value)
. Remind thatname
keys are constrained to record type members only.- Parameters:
name
- The name of the attribute to modify.value
- The new value for the attribute.- Throws:
UnsupportedOperationException
- if this record is not modifiable.
-