Open topic with navigation

TIBCO Rendezvous® 8.7.0

# TibrvMsg.getField()

Method

## Declaration

    TibrvMsgField getField(
        java.lang.String  fieldName)
      throws TibrvException
    TibrvMsgField getField(
        int               fieldId)
      throws TibrvException
    TibrvMsgField getField(
        java.lang.String  fieldName,
        int               fieldId)
      throws TibrvException

## Purpose

Get a specified field from a message.

## Remarks

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

The method takes a snapshot of the field, and returns that information as a field object.

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.

## 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`.

## See Also

TibrvMsg.get()

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-2023. Cloud Software Group, Inc. All Rights Reserved.