blob: 668187015d5e133d4ba30fb83d1b4dd6653e3396 [file] [log] [blame]
Andreas Wundsam661a2222013-11-05 17:18:59 -08001//:: import re
2 public ${prop.java_type.public_type} getCanonical() {
3 //:: if not msg.member_by_name("masked").value == "true":
4 // exact match OXM is always canonical
5 return this;
6 //:: else:
7 //:: mask_type = msg.member_by_name("mask").java_type.public_type
8 if (${mask_type}.NO_MASK.equals(mask)) {
9 //:: unmasked = re.sub(r'(.*)Masked(Ver.*)', r'\1\2', msg.name)
10 return new ${unmasked}(value);
11 } else if(${mask_type}.FULL_MASK.equals(mask)) {
12 return null;
13 } else {
14 return this;
15 }
16 //:: #endif
17 }