Esempio n. 1
0
  protected static Entry setStrainFields(StrainData strainData, Entry entry) {
    Strain strain = (Strain) entry;
    if (strainData == null) return entry;

    if (strainData.getHost() != null) strain.setHost(strainData.getHost());

    if (strainData.getGenotypePhenotype() != null)
      strain.setGenotypePhenotype(strainData.getGenotypePhenotype());

    return entry;
  }
Esempio n. 2
0
  private static Entry infoToStrainForField(Entry entry, String value, EntryField field) {
    if (!entry.getRecordType().equalsIgnoreCase(EntryType.STRAIN.toString())) return entry;

    Strain strain = (Strain) entry;

    switch (field) {
      case PARENTAL_STRAIN:
        strain.setHost(value);
        return strain;

      case GENOTYPE_OR_PHENOTYPE:
        strain.setGenotypePhenotype(value);
        return strain;

      case PLASMIDS:
        strain.setPlasmids(value);
        return strain;

      default:
        return strain;
    }
  }