## org.eclipse.datatools.sqltools.result.model
Class ResultItem

    java.lang.Object
      org.eclipse.datatools.sqltools.result.model.ResultItem

All Implemented Interfaces:
  java.io.Serializable

    public class ResultItem

extends java.lang.Object
implements java.io.Serializable

This class represents a result item. A result item can be one of the following types: update count, plain text, status text, result set.

Author:
  Dafan Yang
See Also:
  Serialized Form

Field Summary
`static int` `PLAIN_TEXT`
`static int` `RESULT_SET`
`static int` `STATUS_TEXT`
`static int` `UPDATE_COUNT`

Constructor Summary
`ResultItem(int updatecount)` Constructs an instance of `ResultItem` wrapping an update count message.
`ResultItem(IResultSetObject rs)` Constructs an instance of `ResultItem` wrapping a result set object.
`ResultItem(java.lang.String message, boolean isPlainText)` Constructs an instance of `ResultItem` wrapping a plain/status message.

Method Summary
`java.lang.Object` `getResultObject()` Returns the result object.
`int` `getResultType()` Returns result item's type.

Methods inherited from class java.lang.Object
`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### UPDATE_COUNT

    public static final int UPDATE_COUNT

See Also:
  Constant Field Values

### PLAIN_TEXT

    public static final int PLAIN_TEXT

See Also:
  Constant Field Values

### RESULT_SET

    public static final int RESULT_SET

See Also:
  Constant Field Values

### STATUS_TEXT

    public static final int STATUS_TEXT

See Also:
  Constant Field Values

Constructor Detail

### ResultItem

    public ResultItem(IResultSetObject rs)

  Constructs an instance of `ResultItem` wrapping a result set object.

  Parameters:
    `rs` - the result set object
  See Also:
    `IResultSetObject`

### ResultItem

    public ResultItem(int updatecount)

  Constructs an instance of `ResultItem` wrapping an update count message.

  Parameters:
    `updatecount` - the update count

### ResultItem

    public ResultItem(java.lang.String message,
                      boolean isPlainText)

  Constructs an instance of `ResultItem` wrapping a plain/status message.

  Parameters:
    `message` - the message
    `isPlainText` - is this message a plain message

Method Detail

### getResultType

    public int getResultType()

  Returns result item's type.

  Returns:
    the result item's type
  See Also:
    `UPDATE_COUNT`, `PLAIN_TEXT`, `RESULT_SET`, `STATUS_TEXT`

### getResultObject

    public java.lang.Object getResultObject()

  Returns the result object. The returning object's type depends on the result type if is `UPDATE_COUNT`, then is an `Integer`. if is `PLAIN_TEXT`, then is an `String` if is `STATUS_TEXT`, then is an `String`,if is `RESULT_SET`, then is `IResultSetObject`

  Returns:
    the result item object
  See Also:
    `IResultSetObject`