Search code examples
jenkinsgroovydevopsjenkins-groovycicd

Hi any Jenkins Groovy expert here can calrify what does left shift operator << mean


Hi any Jenkins Groovy expert here can calrify what does left shift operator mean in this sentence

[sb_mail_Filename << props.LinkVarVariant << '_#' << env.BUILD_NUMBER << 'cp' << CPNUM_PARAM << '.log']


Solution

  • in groovy a << b corresponds to a.leftShift(b) method call.

    so, it depends on type of a - in your case type of sb_mail_Filename.

    for example if sb_mail_Filename is a StringBuilder then here is description of leftShift for it: https://docs.groovy-lang.org/latest/html/groovy-jdk/java/lang/StringBuffer.html#leftShift(java.lang.Object)