@@ -274,7 +274,10 @@ func (msg *MessageImpl) GetApplName() string {
274
274
return applName
275
275
}
276
276
277
- // TODO documentation
277
+ // SetStringProperty enables an application to set a string-type message property.
278
+ //
279
+ // value is *string which allows a nil value to be specified, to unset an individual
280
+ // property.
278
281
func (msg * MessageImpl ) SetStringProperty (name string , value * string ) jms20subset.JMSException {
279
282
var retErr jms20subset.JMSException
280
283
@@ -306,7 +309,8 @@ func (msg *MessageImpl) SetStringProperty(name string, value *string) jms20subse
306
309
return retErr
307
310
}
308
311
309
- // TODO documentation
312
+ // GetStringProperty returns the string value of a named message property.
313
+ // Returns nil if the named property is not set.
310
314
func (msg * MessageImpl ) GetStringProperty (name string ) * string {
311
315
312
316
var valueStr string
@@ -337,26 +341,28 @@ func (msg *MessageImpl) GetStringProperty(name string) *string {
337
341
return & valueStr
338
342
}
339
343
340
- // TODO documentation
344
+ // PropertyExists returns true if the named message property exists on this message.
341
345
func (msg * MessageImpl ) PropertyExists (name string ) (bool , jms20subset.JMSException ) {
342
346
343
- found , _ , retErr := msg .getPropertyInternal (name )
347
+ found , _ , retErr := msg .getPropertiesInternal (name )
344
348
return found , retErr
345
349
346
350
}
347
351
348
- // TODO documentation
352
+ // GetPropertyNames returns a slice of strings containing the name of every message
353
+ // property on this message.
354
+ // Returns a zero length slice if no message properties are defined.
349
355
func (msg * MessageImpl ) GetPropertyNames () ([]string , jms20subset.JMSException ) {
350
356
351
- _ , propNames , retErr := msg .getPropertyInternal ("" )
357
+ _ , propNames , retErr := msg .getPropertiesInternal ("" )
352
358
return propNames , retErr
353
359
}
354
360
355
- // TODO documentation
356
- // Two modes of operation ;
357
- // - supply non-empty name parameter to check whether that property exists
358
- // - supply empty name parameter to get a []string of all property names
359
- func (msg * MessageImpl ) getPropertyInternal (name string ) (bool , []string , jms20subset.JMSException ) {
361
+ // getPropertiesInternal is an internal helper function that provides a largely
362
+ // identical implication for two application-facing functions ;
363
+ // - PropertyExists supplies a non-empty name parameter to check whether that property exists
364
+ // - GetPropertyNames supplies an empty name parameter to get a []string of all property names
365
+ func (msg * MessageImpl ) getPropertiesInternal (name string ) (bool , []string , jms20subset.JMSException ) {
360
366
361
367
impo := ibmmq .NewMQIMPO ()
362
368
pd := ibmmq .NewMQPD ()
@@ -398,7 +404,7 @@ func (msg *MessageImpl) getPropertyInternal(name string) (bool, []string, jms20s
398
404
return false , propNames , nil
399
405
}
400
406
401
- // TODO documentation
407
+ // ClearProperties removes all message properties from this message.
402
408
func (msg * MessageImpl ) ClearProperties () jms20subset.JMSException {
403
409
404
410
// Get the list of all property names, as we have to delete
0 commit comments