Skip to content

Commit 56b1fec

Browse files
committed
Make classes serializable for Spark
1 parent 1a0e5bd commit 56b1fec

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

biojava-core/src/main/java/org/biojava/nbio/core/sequence/compound/AminoAcidCompound.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,10 @@ public class AminoAcidCompound extends AbstractCompound implements Serializable
4040
/**
4141
*
4242
*/
43-
private static final long serialVersionUID = -1955116496725902319L;
43+
private static final long serialVersionUID = -1955116496725902319L;
4444
private final AminoAcidCompoundSet compoundSet;
4545

46+
4647
public AminoAcidCompound(AminoAcidCompoundSet compoundSet, String shortName,
4748
String longName, String description, Float molecularWeight) {
4849
super(shortName);

biojava-core/src/main/java/org/biojava/nbio/core/sequence/template/AbstractCompound.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,13 @@ public abstract class AbstractCompound implements Compound {
3535
private String description = null;
3636
private Float molecularWeight = null;
3737

38+
39+
// Added an empty constructor for Serialization
40+
public AbstractCompound(){
41+
this.base = null;
42+
this.upperedBase = null;
43+
}
44+
3845
public AbstractCompound(String base) {
3946
this.base = base;
4047
this.upperedBase = base.toUpperCase();

0 commit comments

Comments
 (0)