This function compares two variables referencing the same value.
FreeMarker can be used to compare two Number/String/Date/Time/Date-time or Boolean-type variables, but cannot compare two Sequences or Hashes.
It returns "true" if the two variables passed as a parameter reference the same value, "false" if not.
Parameters
All types |
valRef1 |
Variable to compare |
Mandatory |
All types |
valRef2 |
Variable to compare |
Mandatory |
For example
<#-- Return false -->${ hardisCore.sameObjectReference(1, 1) }<#assign aHash = {"attr1": true} aHash2 = {"attr2": false} /><#-- Return false -->${ hardisCore.sameObjectReference(aHash, aHash2) }<#assign aHash2 = aHash /><#-- Return true -->${ hardisCore.sameObjectReference(aHash, aHash2) }<#assign aHash2 = {"attr1": true} /><#-- Return false -->${ hardisCore.sameObjectReference(aHash, aHash2) }