org.apache.solr.common

## Class SolrDocumentBase<T,K>

- java.lang.Object
- - org.apache.solr.common.SolrDocumentBase<T,K>

All Implemented Interfaces:
  Serializable, Map<String,T>

Direct Known Subclasses:
  SolrDocument, SolrInputDocument

    public abstract class SolrDocumentBase<T,K>
    extends Object
    implements Map<String,T>, Serializable

See Also:
  Serialized Form

### Nested Class Summary

### Nested classes/interfaces inherited from interface java.util.Map

`Map.Entry<K,V>`

### Constructor Summary

Constructors
Constructor and Description
`SolrDocumentBase()`

### Method Summary

All Methods Instance Methods Abstract Methods
`abstract void` `addChildDocument(K child)`
`abstract void` `addChildDocuments(Collection<K> children)`
`abstract void` `addField(String name, Object value)` Add a field to the document.
`abstract int` `getChildDocumentCount()`
`abstract List<K>` `getChildDocuments()`
`abstract Collection<String>` `getFieldNames()` Get all field names.
`abstract Object` `getFieldValue(String name)` Get the first value or collection of values for a given field.
`abstract Collection` `getFieldValues(String name)` Get a collection of values for a given field name
`abstract boolean` `hasChildDocuments()`
`abstract void` `setField(String name, Object value)` Set a field with implied null value for boost.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Methods inherited from interface java.util.Map

`clear, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, equals, forEach, get, getOrDefault, hashCode, isEmpty, keySet, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values`

### Constructor Detail

#### SolrDocumentBase

    public SolrDocumentBase()

### Method Detail

#### getFieldNames

    public abstract Collection<String> getFieldNames()

Get all field names.

#### setField

    public abstract void setField(String name,
                                  Object value)

Set a field with implied null value for boost.

Parameters:
  `name` - name of the field to set
  `value` - value of the field

#### addField

    public abstract void addField(String name,
                                  Object value)

Add a field to the document.

Parameters:
  `name` - Name of the field, should match one of the field names defined under "fields" tag in schema.xml.
  `value` - Value of the field, should be of same class type as defined by "type" attribute of the corresponding field in schema.xml.

#### getFieldValue

    public abstract Object getFieldValue(String name)

Get the first value or collection of values for a given field.

#### getFieldValues

    public abstract Collection getFieldValues(String name)

Get a collection of values for a given field name

#### addChildDocument

    public abstract void addChildDocument(K child)

#### addChildDocuments

    public abstract void addChildDocuments(Collection<K> children)

#### getChildDocuments

    public abstract List<K> getChildDocuments()

#### hasChildDocuments

    public abstract boolean hasChildDocuments()

#### getChildDocumentCount

    public abstract int getChildDocumentCount()