package org.f1x;

import org.f1x.util.ByteSequence;
import org.f1x.util.ByteSequenceWrapper;


public class SessionID {

    protected ByteSequence senderCompId;
    protected ByteSequence senderSubId;
    protected ByteSequence targetCompId;
    protected ByteSequence targetSubId;

    public SessionID(ByteSequence senderCompId, ByteSequence targetCompId) {
        this.senderCompId = senderCompId;
        this.targetCompId = targetCompId;
    }

    public SessionID(ByteSequence senderCompId, ByteSequence senderSubId, ByteSequence targetCompId, ByteSequence targetSubId) {
        this.senderCompId = senderCompId;
        this.senderSubId = senderSubId;
        this.targetCompId = targetCompId;
        this.targetSubId = targetSubId;
    }

    public SessionID(String senderCompId, String targetCompId) {
        senderCompId(senderCompId);
        targetCompId(targetCompId);
    }

    public SessionID(String senderCompId, String senderSubId, String targetCompId, String targetSubId) {
        senderCompId(senderCompId);
        senderSubId(senderSubId);
        targetCompId(targetCompId);
        targetSubId(targetSubId);
    }

    public ByteSequence senderCompId() {
        return senderCompId;
    }

    public ByteSequence senderSubId() {
        return senderSubId;
    }

    public ByteSequence targetCompId() {
        return targetCompId;
    }

    public ByteSequence targetSubId() {
        return targetSubId;
    }

    public SessionID senderCompId(ByteSequence senderCompId) {
        this.senderCompId = senderCompId;
        return this;
    }

    public SessionID senderSubId(ByteSequence senderSubId) {
        this.senderSubId = senderSubId;
        return this;
    }

    public SessionID targetCompId(ByteSequence targetCompId) {
        this.targetCompId = targetCompId;
        return this;
    }

    public SessionID targetSubId(ByteSequence targetSubId) {
        this.targetSubId = targetSubId;
        return this;
    }

    public SessionID senderCompId(String senderCompId) {
        this.senderCompId = ByteSequenceWrapper.of(senderCompId);
        return this;
    }

    public SessionID senderSubId(String senderSubId) {
        this.senderSubId = ByteSequenceWrapper.of(senderSubId);
        return this;
    }

    public SessionID targetCompId(String targetCompId) {
        this.targetCompId = ByteSequenceWrapper.of(targetCompId);
        return this;
    }

    public SessionID targetSubId(String targetSubId) {
        this.targetSubId = ByteSequenceWrapper.of(targetSubId);
        return this;
    }

    @Override
    public String toString() {
        return "senderCompId=" + senderCompId +
                ", senderSubId=" + senderSubId +
                ", targetCompId=" + targetCompId +
                ", targetSubId=" + targetSubId;
    }

}

@@ -2046,33 +2046,33 @@
 .senderCompId = 
-B
+b
 yteSequenceWrapp
@@ -2062,34 +2062,24 @@
 byteSequence
-Wrapper.of
 (senderCompI
@@ -2184,33 +2184,33 @@
 s.senderSubId = 
-B
+b
 yteSequenceWrapp
@@ -2204,26 +2204,16 @@
 Sequence
-Wrapper.of
 (senderS
@@ -2328,25 +2328,25 @@
 getCompId = 
-B
+b
 yteSequenceW
@@ -2340,34 +2340,24 @@
 byteSequence
-Wrapper.of
 (targetCompI
@@ -2470,17 +2470,17 @@
 SubId = 
-B
+b
 yteSeque
@@ -2486,18 +2486,8 @@
 ence
-Wrapper.of
 (tar
@@ -2710,32 +2710,32 @@
  targetCompId +%0A
-
                 
@@ -2773,10 +2773,159 @@
 %0A    %7D%0A%0A
+    protected static ByteSequenceWrapper byteSequence(String string) %7B%0A        return string == null ? null : ByteSequenceWrapper.of(string);%0A    %7D%0A%0A
 %7D%0A

fix for null values