Package org.apache.solr.common

# Class SolrInputField

java.lang.Object
org.apache.solr.common.SolrInputField

All Implemented Interfaces:
  `Serializable`, `Iterable<Object>`

public class SolrInputField extends Object implements Iterable<Object>, Serializable

Since:
  solr 1.3
See Also:
  - Serialized Form

## Constructor Summary

Constructors
Constructor
Description
`SolrInputField(String n)`

## Method Summary

Modifier and Type
Method
Description
`void`
`addValue(Object v)`
Add values to a field.
`SolrInputField`
`deepCopy()`
`Object`
`getFirstValue()`
`String`
`getName()`
`Object`
`getValue()`
`int`
`getValueCount()`
`Collection<Object>`
`getValues()`
`Iterator<Object>`
`iterator()`
`void`
`setName(String name)`
`void`
`setValue(Object v)`
Set the value for a field.
`String`
`toString()`

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

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

### Methods inherited from interface java.lang.Iterable

`forEach, spliterator`

## Constructor Details

### SolrInputField

public SolrInputField(String n)

## Method Details

### setValue

public void setValue(Object v)
Set the value for a field. Arrays will be converted to a collection. If a collection is given, then that collection will be used as the backing collection for the values.

### addValue

public void addValue(Object v)
Add values to a field. If the added value is a collection, each value will be added individually.

### getFirstValue

public Object getFirstValue()

### getValue

public Object getValue()

Returns:
  the value for this field. If the field has multiple values, this will be a collection.

### getValues

public Collection<Object> getValues()

Returns:
  the values for this field. This will return a collection even if the field is not multi-valued

### getValueCount

public int getValueCount()

Returns:
  the number of values for this field

### getName

public String getName()

### setName

public void setName(String name)

### iterator

public Iterator<Object> iterator()

Specified by:
  `iterator` in interface `Iterable<Object>`

### toString

public String toString()

Overrides:
  `toString` in class `Object`

### deepCopy

public SolrInputField deepCopy()