sogoc Member since 2017 6 posts
Posted: 2 years ago
Last activity: 2 years 6 months ago

String comparisons in Pega

Within data transforms, is there any difference in using @equals and == between string properties and/or string literals?

I understand that in Java, using == will compare the object reference even if the contents are identical. But in Pega (and correct me if I'm wrong) it will always compare contents and never the object reference.

I've had LSA/SSA's strongly believe that I should never use == to compare strings in data transforms, and others who believe it is perfectly fine.

Any thoughts on why I would use one over another? On looking at the Java code of @equals I can use it to avoid having to check whether the property has been set (null). It always returns false when one is null. Other than that, am I missing anything else when using == ?

Low-Code App Development Case Management
Moderation Team has archived post
Share this page LinkedIn