Examples of LibraryImpl


Examples of ma.glasnost.orika.test.common.types.TestCaseClasses.LibraryImpl

 
  @Test
  @Concurrent(20)
  public void testGenerateMappers() {
    BookImpl book = new BookImpl("The Book Title", new AuthorImpl("The Author Name"));
    Library lib = new LibraryImpl("The Library", Arrays.<Book>asList(book));
   
    LibraryDTO mappedLib = mapper.map(lib, LibraryDTO.class);
   
    // Just to be sure things mapped as expected
    Assert.assertEquals(lib.getTitle(),mappedLib.getTitle());
    Assert.assertEquals(book.getTitle(),mappedLib.getBooks().get(0).getTitle());
    Assert.assertEquals(book.getAuthor().getName(),mappedLib.getBooks().get(0).getAuthor().getName());
 
  }
View Full Code Here

Examples of ma.glasnost.orika.test.common.types.TestCaseClasses.LibraryImpl

      books.add(new BookImpl("Book #1", author1));
      books.add(new BookImpl("Book #2", author1));
      books.add(new BookImpl("Book #3", author2));
      books.add(new BookImpl("Book #4", author2));
     
      Library library = new LibraryImpl("Library #1", books);
     
      MapperFactory factory = MappingUtil.getMapperFactory();
      MapperFacade mapper = factory.getMapperFacade();
     
      LibraryDTO mapped = mapper.map(library, LibraryDTO.class);
View Full Code Here

Examples of ma.glasnost.orika.test.common.types.TestCaseClasses.LibraryImpl

      books.add(new BookImpl("Book #1", author1));
      books.add(new BookImpl("Book #2", author1));
      books.add(new BookImpl("Book #3", author2));
      books.add(new BookImpl("Book #4", author2));
     
      Library library = new LibraryImpl("Library #1", books);
     
      MapperFactory factory = MappingUtil.getMapperFactory();
      MapperFacade mapper = factory.getMapperFacade();
     
      LibraryDTO mapped = mapper.map(library, LibraryDTO.class);
View Full Code Here

Examples of org.apache.stanbol.ontologymanager.registry.impl.model.LibraryImpl

        this.cache = provider;
    }

    @Override
    public Library createLibrary(OWLNamedObject ind) {
        return new LibraryImpl(ind.getIRI(), ind.getIRI().getFragment(), cache);
    }
View Full Code Here

Examples of org.apache.stanbol.ontologymanager.registry.impl.model.LibraryImpl

        this.cache = provider;
    }

    @Override
    public Library createLibrary(OWLNamedObject ind) {
        return new LibraryImpl(ind.getIRI(), ind.getIRI().getFragment(), cache);
    }
View Full Code Here

Examples of uk.ac.bbsrc.tgac.miso.core.data.impl.LibraryImpl

              String type = j.getString("libraryType");
              String selectionType = j.getString("selectionType");
              String strategyType = j.getString("strategyType");
              String locationBarcode = j.getString("locationBarcode");

              Library library = new LibraryImpl();
              library.setSample(sample);

              String libAlias = libraryNamingScheme.generateNameFor("alias", library);

              library.setAlias(libAlias);
              library.setSecurityProfile(sp);
              library.setDescription(descr);
              library.setPlatformName(platform);
              library.setCreationDate(new Date());
              library.setLocationBarcode(locationBarcode);
              library.setQcPassed(false);
              library.setLibraryType(requestManager.getLibraryTypeByDescription(type));
              library.setLibrarySelectionType(requestManager.getLibrarySelectionTypeByName(selectionType));
              library.setLibraryStrategyType(requestManager.getLibraryStrategyTypeByName(strategyType));

              boolean paired = false;
              if (!"".equals(j.getString("paired"))) {
                paired = j.getBoolean("paired");
              }
              library.setPaired(paired);

              if (j.has("tagBarcodes") && !"".equals(j.getString("tagBarcodes")) && !j.getString("tagBarcodes").contains("Select")) {
                String[] codes = j.getString("tagBarcodes").split(Pattern.quote("|"));
                HashMap<Integer, TagBarcode> barcodes = new HashMap<Integer, TagBarcode>();
                int count = 1;
                for (String code : codes) {
                  try {
                    long cl = Long.parseLong(code);
                    barcodes.put(count, requestManager.getTagBarcodeById(cl));
                  }
                  catch (NumberFormatException e) {
                    e.printStackTrace();
                    return JSONUtils.SimpleJSONError("Cannot save Library. It looks like there are tag barcodes for the library of "+sample.getAlias()+", but they cannot be processed");
                  }
                  finally {
                     count++;
                  }
                }
                library.setTagBarcodes(barcodes);
              }

              saveSet.add(library);
            }
            else {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.