Skip to content

Commit

Permalink
toString on parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
Schmoho committed Aug 15, 2024
1 parent dfafe97 commit 294b3bc
Show file tree
Hide file tree
Showing 8 changed files with 192 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
import de.zbit.util.prefs.SBProperties;
import edu.ucsd.sbrg.db.adb.AnnotateDBOptions;

import java.util.Objects;

public class ADBAnnotationParameters {

@JsonProperty("annotate-with-adb")
Expand Down Expand Up @@ -37,4 +39,25 @@ public boolean annotateWithAdb() {
public DBParameters dbParameters() {
return dbParameters;
}

@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
ADBAnnotationParameters that = (ADBAnnotationParameters) o;
return annotateWithAdb == that.annotateWithAdb && Objects.equals(dbParameters, that.dbParameters);
}

@Override
public int hashCode() {
return Objects.hash(annotateWithAdb, dbParameters);
}

@Override
public String toString() {
return "ADBAnnotationParameters{" +
"annotateWithAdb=" + annotateWithAdb +
", dbParameters=" + dbParameters +
'}';
}
}
24 changes: 24 additions & 0 deletions src/main/java/edu/ucsd/sbrg/parameters/AnnotationParameters.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
import com.fasterxml.jackson.annotation.JsonProperty;
import de.zbit.util.prefs.SBProperties;

import java.util.Objects;

public class AnnotationParameters {

@JsonProperty("annotatedb")
Expand All @@ -25,4 +27,26 @@ public ADBAnnotationParameters adbAnnotationParameters() {
public BiGGAnnotationParameters biggAnnotationParameters() {
return biGGAnnotationParameters;
}

@Override
public String toString() {
return "AnnotationParameters{" +
"adbAnnotationParameters=" + adbAnnotationParameters +
", biGGAnnotationParameters=" + biGGAnnotationParameters +
'}';
}

@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
AnnotationParameters that = (AnnotationParameters) o;
return Objects.equals(adbAnnotationParameters, that.adbAnnotationParameters) && Objects.equals(biGGAnnotationParameters, that.biGGAnnotationParameters);
}

@Override
public int hashCode() {
return Objects.hash(adbAnnotationParameters, biGGAnnotationParameters);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
import de.zbit.util.prefs.SBProperties;
import edu.ucsd.sbrg.db.bigg.BiGGDBOptions;

import java.util.Objects;

public class BiGGAnnotationParameters {

@JsonProperty("annotate-with-bigg")
Expand Down Expand Up @@ -64,4 +66,29 @@ public BiGGNotesParameters notesParameters() {
public DBParameters dbParameters() {
return dbParameters;
}

@Override
public String toString() {
return "BiGGAnnotationParameters{" +
"annotateWithBiGG=" + annotateWithBiGG +
", includeAnyURI=" + includeAnyURI +
", documentTitlePattern='" + documentTitlePattern + '\'' +
", notesParameters=" + notesParameters +
", dbParameters=" + dbParameters +
'}';
}

@Override
public boolean equals(Object o) {

if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
BiGGAnnotationParameters that = (BiGGAnnotationParameters) o;
return annotateWithBiGG == that.annotateWithBiGG && includeAnyURI == that.includeAnyURI && Objects.equals(documentTitlePattern, that.documentTitlePattern) && Objects.equals(notesParameters, that.notesParameters) && Objects.equals(dbParameters, that.dbParameters);
}

@Override
public int hashCode() {
return Objects.hash(annotateWithBiGG, includeAnyURI, documentTitlePattern, notesParameters, dbParameters);
}
}
27 changes: 27 additions & 0 deletions src/main/java/edu/ucsd/sbrg/parameters/DBParameters.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
import com.fasterxml.jackson.annotation.JsonProperty;
import edu.ucsd.sbrg.db.bigg.BiGGDBOptions;

import java.util.Objects;


public class DBParameters {

Expand Down Expand Up @@ -47,4 +49,29 @@ public Integer port() {
public String user() {
return user;
}

@Override
public String toString() {
return "DBParameters{" +
"dbName='" + dbName + '\'' +
", host='" + host + '\'' +
", passwd='" + passwd + '\'' +
", port=" + port +
", user='" + user + '\'' +
'}';
}

@Override
public boolean equals(Object o) {

if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
DBParameters that = (DBParameters) o;
return Objects.equals(dbName, that.dbName) && Objects.equals(host, that.host) && Objects.equals(passwd, that.passwd) && Objects.equals(port, that.port) && Objects.equals(user, that.user);
}

@Override
public int hashCode() {
return Objects.hash(dbName, host, passwd, port, user);
}
}
26 changes: 26 additions & 0 deletions src/main/java/edu/ucsd/sbrg/parameters/Parameters.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

import com.fasterxml.jackson.annotation.JsonProperty;

import java.util.Objects;

public class Parameters {

@JsonProperty("polishing")
Expand Down Expand Up @@ -36,4 +38,28 @@ public boolean sbmlValidation() {
public ModelPolisherOptions.OutputType outputType() {
return outputType;
}

@Override
public String toString() {
return "Parameters{" +
"polishing=" + polishing +
", annotation=" + annotation +
", sboTerms=" + sboTerms +
", sbmlValidation=" + sbmlValidation +
", outputType=" + outputType +
'}';
}

@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Parameters that = (Parameters) o;
return sbmlValidation == that.sbmlValidation && Objects.equals(polishing, that.polishing) && Objects.equals(annotation, that.annotation) && Objects.equals(sboTerms, that.sboTerms) && outputType == that.outputType;
}

@Override
public int hashCode() {
return Objects.hash(polishing, annotation, sboTerms, sbmlValidation, outputType);
}
}
23 changes: 23 additions & 0 deletions src/main/java/edu/ucsd/sbrg/parameters/PolishingParameters.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
import com.fasterxml.jackson.annotation.JsonProperty;
import de.zbit.util.prefs.SBProperties;

import java.util.Objects;

public class PolishingParameters {

@JsonProperty("reactions")
Expand Down Expand Up @@ -30,4 +32,25 @@ public ReactionPolishingParameters reactionPolishingParameters() {
public FluxObjectivesPolishingParameters fluxObjectivesPolishingParameters() {
return fluxObjectivesPolishingParameters;
}

@Override
public String toString() {
return "PolishingParameters{" +
"reactionPolishingParameters=" + reactionPolishingParameters +
", fluxObjectivesPolishingParameters=" + fluxObjectivesPolishingParameters +
'}';
}

@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
PolishingParameters that = (PolishingParameters) o;
return Objects.equals(reactionPolishingParameters, that.reactionPolishingParameters) && Objects.equals(fluxObjectivesPolishingParameters, that.fluxObjectivesPolishingParameters);
}

@Override
public int hashCode() {
return Objects.hash(reactionPolishingParameters, fluxObjectivesPolishingParameters);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import de.zbit.util.prefs.SBProperties;

import java.util.Map;
import java.util.Objects;

public class ReactionPolishingParameters {

Expand All @@ -28,6 +29,23 @@ public boolean checkMassBalance() {
return checkMassBalance;
}

@Override
public String toString() {
return "ReactionPolishingParameters{" +
"checkMassBalance=" + checkMassBalance +
'}';
}

@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
ReactionPolishingParameters that = (ReactionPolishingParameters) o;
return checkMassBalance == that.checkMassBalance;
}

@Override
public int hashCode() {
return Objects.hashCode(checkMassBalance);
}
}
27 changes: 24 additions & 3 deletions src/main/java/edu/ucsd/sbrg/parameters/SBOParameters.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,41 @@
import com.fasterxml.jackson.annotation.JsonProperty;
import de.zbit.util.prefs.SBProperties;

import java.util.Objects;

public class SBOParameters {

@JsonProperty("omit-generic-terms")
protected boolean omitGenericTerms = ModelPolisherOptions.ADD_GENERIC_TERMS.getDefaultValue();
protected boolean addGenericTerms = ModelPolisherOptions.ADD_GENERIC_TERMS.getDefaultValue();

public SBOParameters() {
}

public SBOParameters(SBProperties args) {
omitGenericTerms = args.getBooleanProperty(ModelPolisherOptions.ADD_GENERIC_TERMS);
addGenericTerms = args.getBooleanProperty(ModelPolisherOptions.ADD_GENERIC_TERMS);
}

public boolean addGenericTerms() {
return omitGenericTerms;
return addGenericTerms;
}

@Override
public String toString() {
return "SBOParameters{" +
"addGenericTerms=" + addGenericTerms +
'}';
}

@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
SBOParameters that = (SBOParameters) o;
return addGenericTerms == that.addGenericTerms;
}

@Override
public int hashCode() {
return Objects.hashCode(addGenericTerms);
}
}

0 comments on commit 294b3bc

Please sign in to comment.