Open topic with navigation

TIBCO Rendezvous® 8.8.0

# TibrvMsgView.get()

Method

## Declaration

    java.lang.Object get(
        final java.lang.String fieldName)
      throws TibrvException
    java.lang.Object get(
        final int fieldId)
      throws TibrvException
    java.lang.Object get(
        final java.lang.String fieldName,
        final int fieldId)
      throws TibrvException

## Purpose

Get the value of a specified field from a message view snapshot.

## Remarks

Programs specify the field to retrieve using the `fieldName` and `fieldId` parameters.

When the field contains a submessage, this method returns a copy of the submessage—that is, a Java message object corresponding to a an independent copy of the submessage in the C environment. You may access its fields as a message object, or you may explicitly extract the submessage into its own message view.

Programs can use a related method to loop through all the fields of a message; to retrieve each field by its integer index number, see TibrvMsg.getFieldByIndex().

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

## Field Search Algorithm

This method, and related methods that get fields from message views, use the same algorithm as TibrvMsg.get(). For complete details, see Field Search Algorithm.

## Method Forms

With only a field name, find the field by name. If the field name is not present in the message, return `null`. If several fields with that name are present in the message, this method returns the first one that it finds.

With only a field identifier, find the field with that identifier (since identifiers are unique, the message can contain at most one such field). If the identifier is not present in the message, return `null`.

With both a field name and a field identifier, search first by identifier, and then by field name. If neither are present in the message, return `null`. If identifier search succeeds, return the field value. If the name search succeeds, but the actual identifier in the field is non-zero (so it does not match the identifier supplied) then throw a TibrvException with status code TibrvStatus.ID_CONFLICT.

## See Also

TibrvMsgView

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.