@Test public void testGetMonomialsInName() { ScientificName name = new ScientificName(); name.setGenusOrMonomial("Larus"); name.setSpecificEpithet("argentatus"); name.setInfraspecificEpithet("argentatus"); name.setSubgenus("testSubGenus"); List<Monomial> actual = TransformUtil.getMonomialsInName(name); assertNotNull(actual); assertEquals("01","Larus", actual.get(0).getName()); assertEquals("02","genus", actual.get(0).getRank()); assertEquals("03","testSubGenus", actual.get(1).getName()); assertEquals("04","subgenus", actual.get(1).getRank()); assertEquals("05","argentatus", actual.get(2).getName()); assertEquals("06","species", actual.get(2).getRank()); assertEquals("07","argentatus", actual.get(3).getName()); assertEquals("08","subspecies", actual.get(3).getRank()); }
public static List<Monomial> getMonomialsInName(ScientificName sn) { List<Monomial> monomials = new ArrayList<>(3); if (sn.getGenusOrMonomial() != null) monomials.add(new Monomial(GENUS, sn.getGenusOrMonomial())); if (sn.getSubgenus() != null) monomials.add(new Monomial(SUBGENUS, sn.getSubgenus())); if (sn.getSpecificEpithet() != null) monomials.add(new Monomial(SPECIES, sn.getSpecificEpithet())); if (sn.getInfraspecificEpithet() != null) monomials.add(new Monomial(SUBSPECIES, sn.getInfraspecificEpithet())); if (monomials.size() == 0) { return null; } return monomials; }
TransformUtil { public static List<Monomial> getMonomialsInName(ScientificName sn) { List<Monomial> monomials = new ArrayList<>(3); if (sn.getGenusOrMonomial() != null) monomials.add(new Monomial(GENUS, sn.getGenusOrMonomial())); if (sn.getSubgenus() != null) monomials.add(new Monomial(SUBGENUS, sn.getSubgenus())); if (sn.getSpecificEpithet() != null) monomials.add(new Monomial(SPECIES, sn.getSpecificEpithet())); if (sn.getInfraspecificEpithet() != null) monomials.add(new Monomial(SUBSPECIES, sn.getInfraspecificEpithet())); if (monomials.size() == 0) { return null; } return monomials; } }
TransformUtil { public static List<Monomial> getMonomialsInName(ScientificName sn) { List<Monomial> monomials = new ArrayList<>(3); if (sn.getGenusOrMonomial() != null) monomials.add(new Monomial(GENUS, sn.getGenusOrMonomial())); if (sn.getSubgenus() != null) monomials.add(new Monomial(SUBGENUS, sn.getSubgenus())); if (sn.getSpecificEpithet() != null) monomials.add(new Monomial(SPECIES, sn.getSpecificEpithet())); if (sn.getInfraspecificEpithet() != null) monomials.add(new Monomial(SUBSPECIES, sn.getInfraspecificEpithet())); if (monomials.size() == 0) { return null; } return monomials; }  }
TransformUtil { public static List<Monomial> getMonomialsInName(ScientificName sn) { List<Monomial> monomials = new ArrayList<>(3); if (sn.getGenusOrMonomial() != null) monomials.add(new Monomial(GENUS, sn.getGenusOrMonomial())); if (sn.getSubgenus() != null) monomials.add(new Monomial(SUBGENUS, sn.getSubgenus())); if (sn.getSpecificEpithet() != null) monomials.add(new Monomial(SPECIES, sn.getSpecificEpithet())); if (sn.getInfraspecificEpithet() != null) monomials.add(new Monomial(SUBSPECIES, sn.getInfraspecificEpithet())); if (monomials.size() == 0) { return null; } return monomials; }  static void setScientificNameGroup(ScientificName sn); static DefaultClassification extractClassificiationFromName(ScientificName sn); static List<Monomial> getMonomialsInName(ScientificName sn); static ScientificName extractNameFromClassification(DefaultClassification dc); static void equalizeNameComponents(Taxon taxon); static void equalizeNameComponents(Specimen specimen); static void equalizeNameComponents(MultiMediaObject mmo); static void sortIdentificationsPreferredFirst(Specimen specimen); static List<Monomial> getSystemClassification(Element elem, ScientificName sn); static String guessMimeType(String imageUrl); }
TransformUtil { public static List<Monomial> getMonomialsInName(ScientificName sn) { List<Monomial> monomials = new ArrayList<>(3); if (sn.getGenusOrMonomial() != null) monomials.add(new Monomial(GENUS, sn.getGenusOrMonomial())); if (sn.getSubgenus() != null) monomials.add(new Monomial(SUBGENUS, sn.getSubgenus())); if (sn.getSpecificEpithet() != null) monomials.add(new Monomial(SPECIES, sn.getSpecificEpithet())); if (sn.getInfraspecificEpithet() != null) monomials.add(new Monomial(SUBSPECIES, sn.getInfraspecificEpithet())); if (monomials.size() == 0) { return null; } return monomials; }  static void setScientificNameGroup(ScientificName sn); static DefaultClassification extractClassificiationFromName(ScientificName sn); static List<Monomial> getMonomialsInName(ScientificName sn); static ScientificName extractNameFromClassification(DefaultClassification dc); static void equalizeNameComponents(Taxon taxon); static void equalizeNameComponents(Specimen specimen); static void equalizeNameComponents(MultiMediaObject mmo); static void sortIdentificationsPreferredFirst(Specimen specimen); static List<Monomial> getSystemClassification(Element elem, ScientificName sn); static String guessMimeType(String imageUrl);  }