package uk.ac.ebi.atlas.model.experiment.differential.microarray;

import com.google.common.base.MoreObjects;
import org.apache.commons.lang.ArrayUtils;
import uk.ac.ebi.atlas.model.experiment.differential.DifferentialProfile;

public class MicroarrayProfile extends DifferentialProfile<MicroarrayExpression> {

    // is part of the identity of the profile, ie: you can have two profiles for same
    // gene but different design element, eg: http://ves-hx-76:8080/gxa/experiments/E-MTAB-1066?geneQuery=Mbs
    private final String designElementName;

    public MicroarrayProfile(String geneId, String geneName, String designElementName) {
        super(geneId, geneName);
        this.designElementName = designElementName;
    }

    //It's used in jsp EL as well as serialization
    @Override
    public String getDesignElementName() {
        return designElementName;
    }

    @Override
    public String toString() {
        return MoreObjects.toStringHelper(this)
                .add("geneName", getName())
                .add("designElementName", designElementName)
                .add("expressions", expressionsByCondition)
                .toString();
    }

    @Override
    public String[] identifiers(){
        return (String[]) ArrayUtils.add(super.identifiers(), designElementName);
    }

}

@@ -103,16 +103,63 @@
 bjects;%0A
+import com.google.common.collect.ImmutableMap;%0A
 import o
@@ -193,16 +193,16 @@
 yUtils;%0A
-
 import u
@@ -268,16 +268,39 @@
 ofile;%0A%0A
+import java.util.Map;%0A%0A
 public c
@@ -801,157 +801,8 @@
  %7D%0A%0A
-    //It's used in jsp EL as well as serialization%0A    @Override%0A    public String getDesignElementName() %7B%0A        return designElementName;%0A    %7D%0A%0A
     
@@ -1140,16 +1140,16 @@
 iers()%7B%0A
-
         
@@ -1229,10 +1229,177 @@
 %0A    %7D%0A%0A
+    @Override%0A    public Map%3CString,String%3E properties()%7B%0A        return ImmutableMap.of(%22id%22, getId(), %22name%22, getName(), %22designElement%22, designElementName);%0A    %7D%0A%0A
 %7D%0A

Add designElement field when serializing microarray expressions to JSON [Fixes #143158723]