Class DACEntitlementIDComposer

  • All Implemented Interfaces:
    EntitlementID

    public class DACEntitlementIDComposer
    extends EntitlementIDComposer<DACEntitlementIDComposer>

    Allows to store a set of binary entitlements in one field.

    Usage:

     final XXXMessage msg = ...
     final DACEntitlementIDComposer composer = new DACEntitlementIDComposer(msg);
    
     composer.start(140)
             .applyEntry(new byte[] {2, 0, 1, 2, 3, 4}, 1, 5)
             .applyEntry(new byte[] {1, 2, 3}, 0, 3)
             .commit();
     
     // Now msg.entitlementId is set.
     // Let's read it...
     
     int tacID140 = composer.read();
    
     System.out.println("TAC PlugIn ID: " + tacID140);
     System.out.println("Number of entries: " + composer.numberOfEntries());
    
     for (int i = 0; i < composer.numberOfEntries(); i++) {
          System.out.println("Entry " + i + " offset/length: " + composer.entryOffset(i) + '/' + composer.entryLength(i));
    
          // Get the next entry from composer.content() with its offset/length...
     }