org.apache.solr.util

## Class CommandOperation

- java.lang.Object
- - org.apache.solr.util.CommandOperation

-     public class CommandOperation
      extends Object

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `ERR_MSGS`
    `String` | `name`
    `static String` | `ROOT_OBJ`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `CommandOperation(String operationName, Object metaData)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addError(String s)`
    `static List<Map>` | `captureErrors(List<CommandOperation> ops)`
    `static List<CommandOperation>` | `clone(List<CommandOperation> ops)`
    `boolean` | `getBoolean(String key, boolean def)`
    `CommandOperation` | `getCopy()`
    `Map<String,Object>` | `getDataMap()`
    `List<String>` | `getErrors()`
    `Integer` | `getInt(String name)`
    `Integer` | `getInt(String name, Integer def)`
    `Map` | `getMap(String key, Map def)`
    `String` | `getStr(String key)` Get a required field.
    `String` | `getStr(String key, String def)`
    `List<String>` | `getStrs(String key)`
    `List<String>` | `getStrs(String key, List<String> def)` Get collection of values for a key.
    `Object` | `getVal(String key)`
    `Map<String,Object>` | `getValuesExcluding(String... keys)` Get all the values from the metadata for the command without the specified keys
    `boolean` | `hasError()`
    `static List<CommandOperation>` | `parse(Reader rdr)` Parse the command operations into command objects
    `static List<CommandOperation>` | `readCommands(Iterable<ContentStream> streams, SolrQueryResponse resp)`
    `void` | `setCommandData(Object o)`
    `String` | `toString()`
    `void` | `unknownOperation()`

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

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

- - ### Field Detail

    - #### name

          public final String name

    - #### ERR_MSGS

          public static final String ERR_MSGS

      See Also:
        Constant Field Values

    - #### ROOT_OBJ

          public static final String ROOT_OBJ

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### CommandOperation

          public CommandOperation(String operationName,
                                  Object metaData)

  - ### Method Detail

    - #### getStr

          public String getStr(String key,
                               String def)

    - #### getBoolean

          public boolean getBoolean(String key,
                                    boolean def)

    - #### setCommandData

          public void setCommandData(Object o)

    - #### getDataMap

          public Map<String,Object> getDataMap()

    - #### getVal

          public Object getVal(String key)

    - #### getStrs

          public List<String> getStrs(String key)

    - #### unknownOperation

          public void unknownOperation()

    - #### getStrs

          public List<String> getStrs(String key,
                                      List<String> def)

      Get collection of values for a key. If only one val is present a single value collection is returned

    - #### getStr

          public String getStr(String key)

      Get a required field. If missing it adds to the errors

    - #### hasError

          public boolean hasError()

    - #### addError

          public void addError(String s)

    - #### getValuesExcluding

          public Map<String,Object> getValuesExcluding(String... keys)

      Get all the values from the metadata for the command without the specified keys

    - #### getErrors

          public List<String> getErrors()

    - #### captureErrors

          public static List<Map> captureErrors(List<CommandOperation> ops)

    - #### parse

          public static List<CommandOperation> parse(Reader rdr)
                                              throws IOException

      Parse the command operations into command objects
      Throws:
        `IOException`

    - #### getCopy

          public CommandOperation getCopy()

    - #### getMap

          public Map getMap(String key,
                            Map def)

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

    - #### readCommands

          public static List<CommandOperation> readCommands(Iterable<ContentStream> streams,
                                                            SolrQueryResponse resp)
                                                     throws IOException

      Throws:
        `IOException`

    - #### clone

          public static List<CommandOperation> clone(List<CommandOperation> ops)

    - #### getInt

          public Integer getInt(String name,
                                Integer def)

    - #### getInt

          public Integer getInt(String name)

Copyright © 2000-2016 Apache Software Foundation. All Rights Reserved.