Skip to content

Commit

Permalink
Added additional Jackson annotations to customize JSON annotation.
Browse files Browse the repository at this point in the history
  • Loading branch information
nilshoffmann committed Oct 20, 2023
1 parent 51f97cb commit 974bfc9
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
*/
package org.lifstools.jgoslin.domain;

import com.fasterxml.jackson.annotation.JsonGetter;
import com.fasterxml.jackson.annotation.JsonIgnore;
import java.util.ArrayList;
import java.util.Arrays;
Expand Down Expand Up @@ -148,6 +149,7 @@ public static String getClassString(int _lipid_class) {
return ClassString.containsKey(_lipid_class) ? ClassString.get(_lipid_class) : "UNDEFINED";
}

@JsonGetter("lipidClass")
public String getClassName() {
return LipidClasses.getInstance().get(lipidClass).lipidClassName;
}
Expand Down Expand Up @@ -234,6 +236,7 @@ public ElementTable getElements() {
return elements;
}

@JsonGetter("name")
public String getHeadgroup() {
return headgroup;
}
Expand All @@ -250,6 +253,7 @@ public void setLipidCategory(LipidCategory lipidCategory) {
this.lipidCategory = lipidCategory;
}

@JsonIgnore
public int getLipidClass() {
return lipidClass;
}
Expand Down

0 comments on commit 974bfc9

Please sign in to comment.