Open topic with navigation

TIBCO Rendezvous® 8.8.0

# Get Scalar from TibrvMsgView

Convenience Methods

## Declaration

    scalar_type getScalar_type(
        java.lang.String fieldName,
        int fieldId)
      throws TibrvException
    scalar_type getAsScalar_type(
        java.lang.String fieldName,
        int fieldId)
      throws TibrvException

## Purpose

Get the value of a field from a message view snapshot as a scalar value.

## Remarks

Each convenience method in this family retrieves a field and extracts its data. If the field’s type (as it exists) does not match the type of the convenience method, then the `get` `type` method throws an exception; in contrast, the `getAs` `type` method attempts to convert the data (see Decoding and Type Conversion, and Wire Format to Java Datatype Conversion Matrix). If conversion is not possible, the method throws an exception with status code TibrvStatus.CONVERSION_FAILED.

Parameter | Description
`fieldName` | Get a field with this name.
`fieldId` | Get the field with this identifier.

Method Name | Field Type | Java Type | Type Description
`get` `Boolean` `getAs` `Boolean` | `TibrvMsg.``BOOL` | `boolean` | boolean
`get` `Float` `getAs` `Float` | `TibrvMsg.``F32` | `float` | 32-bit floating point
`get` `Double` `getAs` `Double` | `TibrvMsg.``F64` | `double` | 64-bit floating point
`get` `Byte` `getAs` `Byte` | `TibrvMsg.``I8` | `byte` | 8-bit integer
`get` `Short` `getAs` `Short` | `TibrvMsg.``I16` | `short` | 16-bit integer
`get` `Int` `getAs` `Int` | `TibrvMsg.``I32` | `int` | 32-bit integer
`get` `Long` `getAs` `Long` | `TibrvMsg.``I64` | `long` | 64-bit integer

Did you find this helpful?

Yes No
Great!
Thanks for taking the time to give us some feedback.
Sorry about that

Why wasn't this helpful? (check all that apply)

Could not find what I was looking for
Instructions confusing or unclear
Instructions did not work

Want to tell us more?

Please select at least one option or provide details about the issue!!

Error occurred while submitting feedback.

Error2 occurred while submitting feedback.

TIBCO Rendezvous®

Copyright © 1997-2025. Cloud Software Group, Inc. All Rights Reserved.