code
stringlengths
73
34.1k
label
stringclasses
1 value
public static MozuUrl getRatesUrl(Boolean includeRawResponse, String responseFields) { UrlFormatter formatter = new UrlFormatter("/api/commerce/catalog/storefront/shipping/request-rates?responseFields={responseFields}"); formatter.formatUrl("includeRawResponse", includeRawResponse); formatter.formatUrl("responseFields", responseFields); return new MozuUrl(formatter.getResourceUrl(), MozuUrl.UrlLocation.TENANT_POD) ; }
java
public static MozuUrl deleteCustomRouteSettingsUrl() { UrlFormatter formatter = new UrlFormatter("/api/commerce/settings/general/customroutes"); return new MozuUrl(formatter.getResourceUrl(), MozuUrl.UrlLocation.TENANT_POD) ; }
java
public static MozuUrl getOrderUrl(Boolean draft, Boolean includeBin, String orderId, String responseFields) { UrlFormatter formatter = new UrlFormatter("/api/commerce/orders/{orderId}?draft={draft}&includeBin={includeBin}&responseFields={responseFields}"); formatter.formatUrl("draft", draft); formatter.formatUrl("includeBin", includeBin); formatter.formatUrl("orderId", orderId); formatter.formatUrl("responseFields", responseFields); return new MozuUrl(formatter.getResourceUrl(), MozuUrl.UrlLocation.TENANT_POD) ; }
java
public static MozuUrl priceOrderUrl(Boolean refreshShipping, String responseFields) { UrlFormatter formatter = new UrlFormatter("/api/commerce/orders/price?refreshShipping={refreshShipping}&responseFields={responseFields}"); formatter.formatUrl("refreshShipping", refreshShipping); formatter.formatUrl("responseFields", responseFields); return new MozuUrl(formatter.getResourceUrl(), MozuUrl.UrlLocation.TENANT_POD) ; }
java
public static MozuUrl deleteOrderDraftUrl(String orderId, String version) { UrlFormatter formatter = new UrlFormatter("/api/commerce/orders/{orderId}/draft?version={version}"); formatter.formatUrl("orderId", orderId); formatter.formatUrl("version", version); return new MozuUrl(formatter.getResourceUrl(), MozuUrl.UrlLocation.TENANT_POD) ; }
java
public WebElement find() { checkState(webDriver != null, "No WebDriver specified."); checkState(by != null, "No By instance for locating elements specified."); if (!noLogging) { log.info(toString()); } WebElement element; if (timeoutSeconds > 0L) { WebDriverWait wait = createWebDriverWait(); element = wait.until(new Function<WebDriver, WebElement>() { @Override public WebElement apply(final WebDriver input) { WebElement el = input.findElement(by); checkElement(el); if (condition != null && !condition.apply(el)) { throw new WebElementException(String.format("Condition not met for element %s: %s", el, condition)); } return el; } @Override public String toString() { return WebElementFinder.this.toString(); } }); } else { element = webDriver.findElement(by); checkElement(element); if (condition != null && !condition.apply(element)) { throw new WebElementException(String.format("Condition not met for element %s: %s", element, condition)); } } return element; }
java
public List<WebElement> findAll() { checkState(webDriver != null, "No WebDriver specified."); checkState(by != null, "No By instance for locating elements specified."); log.info(toString()); final List<WebElement> result = newArrayList(); try { if (timeoutSeconds > 0L) { WebDriverWait wait = createWebDriverWait(); wait.until(new Function<WebDriver, List<WebElement>>() { @Override public List<WebElement> apply(final WebDriver input) { doFindElements(result, input); if (result.isEmpty()) { // this means, we try again until the timeout occurs throw new WebElementException("No matching element found."); } return result; } @Override public String toString() { return WebElementFinder.this.toString(); } }); } else { doFindElements(result, webDriver); } return result; } catch (TimeoutException ex) { Throwable cause = ex.getCause(); for (Class<? extends Throwable> thClass : IGNORED_EXCEPTIONS) { if (thClass.isInstance(cause)) { return ImmutableList.of(); } } throw new WebElementException(ex); } }
java
public static MozuUrl getAddressSchemaUrl(String countryCode, String responseFields) { UrlFormatter formatter = new UrlFormatter("/api/platform/reference/addressschema/{countryCode}?responseFields={responseFields}"); formatter.formatUrl("countryCode", countryCode); formatter.formatUrl("responseFields", responseFields); return new MozuUrl(formatter.getResourceUrl(), MozuUrl.UrlLocation.HOME_POD) ; }
java
public static MozuUrl getAddressSchemasUrl(String responseFields) { UrlFormatter formatter = new UrlFormatter("/api/platform/reference/addressschemas?responseFields={responseFields}"); formatter.formatUrl("responseFields", responseFields); return new MozuUrl(formatter.getResourceUrl(), MozuUrl.UrlLocation.HOME_POD) ; }
java
public static MozuUrl getBehaviorUrl(Integer behaviorId, String responseFields) { UrlFormatter formatter = new UrlFormatter("/api/platform/reference/behaviors/{behaviorId}?responseFields={responseFields}"); formatter.formatUrl("behaviorId", behaviorId); formatter.formatUrl("responseFields", responseFields); return new MozuUrl(formatter.getResourceUrl(), MozuUrl.UrlLocation.HOME_POD) ; }
java
public static MozuUrl getBehaviorCategoryUrl(Integer categoryId, String responseFields) { UrlFormatter formatter = new UrlFormatter("/api/platform/reference/behaviors/categories/{categoryId}?responseFields={responseFields}"); formatter.formatUrl("categoryId", categoryId); formatter.formatUrl("responseFields", responseFields); return new MozuUrl(formatter.getResourceUrl(), MozuUrl.UrlLocation.HOME_POD) ; }
java
public static MozuUrl getBehaviorsUrl(String responseFields, String userType) { UrlFormatter formatter = new UrlFormatter("/api/platform/reference/behaviors?userType={userType}&responseFields={responseFields}"); formatter.formatUrl("responseFields", responseFields); formatter.formatUrl("userType", userType); return new MozuUrl(formatter.getResourceUrl(), MozuUrl.UrlLocation.HOME_POD) ; }
java
public static MozuUrl getUnitsOfMeasureUrl(String filter, String responseFields) { UrlFormatter formatter = new UrlFormatter("/api/platform/reference/unitsofmeasure?filter={filter}&responseFields={responseFields}"); formatter.formatUrl("filter", filter); formatter.formatUrl("responseFields", responseFields); return new MozuUrl(formatter.getResourceUrl(), MozuUrl.UrlLocation.HOME_POD) ; }
java
public boolean tryClick(final By by) { LOGGER.info("Trying to click on {}", by); List<WebElement> elements = wef.timeout(2L).by(by).findAll(); if (elements.size() > 0) { WebElement element = elements.get(0); checkTopmostElement(by); new Actions(webDriver).moveToElement(element).click().perform(); LOGGER.info("Click successful"); return true; } LOGGER.info("Click not successful"); return false; }
java
public Object executeScript(final String script, final Object... args) { LOGGER.info("executeScript: {}", new ToStringBuilder(this, LoggingToStringStyle.INSTANCE).append("script", script).append("args", args)); return ((JavascriptExecutor) webDriver).executeScript(script, args); }
java
public String openNewWindow(final String url, final long timeoutSeconds) { String oldHandle = openNewWindow(timeoutSeconds); get(url); return oldHandle; }
java
public void assertTopmostElement(By by) { if (!isTopmostElementCheckApplicable(by)) { LOGGER.warn("The element identified by '{}' is not a leaf node in the " + "document tree. Thus, it cannot be checked if the element is topmost. " + "The topmost element check cannot be performed and is skipped.", by); return; } LOGGER.info("Checking whether the element identified by '{}' is the topmost element.", by); WebElement topmostElement = findTopmostElement(by); WebElement element = findElement(by); if (!element.equals(topmostElement)) { throw new AssertionError(format("The element '%s' identified by '%s' is covered by '%s'.", outerHtmlPreview(element), by, outerHtmlPreview(topmostElement))); } }
java
public Boolean isTopmostElement(By by) { if (!isTopmostElementCheckApplicable(by)) { return null; } WebElement topmostElement = findTopmostElement(by); WebElement element = findElement(by); return element.equals(topmostElement); }
java
public static MozuUrl addProductUrl(String responseFields) { UrlFormatter formatter = new UrlFormatter("/api/commerce/catalog/admin/products/?responseFields={responseFields}"); formatter.formatUrl("responseFields", responseFields); return new MozuUrl(formatter.getResourceUrl(), MozuUrl.UrlLocation.TENANT_POD) ; }
java
public static MozuUrl addProductInCatalogUrl(String productCode, String responseFields) { UrlFormatter formatter = new UrlFormatter("/api/commerce/catalog/admin/products/{productCode}/ProductInCatalogs?responseFields={responseFields}"); formatter.formatUrl("productCode", productCode); formatter.formatUrl("responseFields", responseFields); return new MozuUrl(formatter.getResourceUrl(), MozuUrl.UrlLocation.TENANT_POD) ; }
java
public static MozuUrl renameProductCodesUrl() { UrlFormatter formatter = new UrlFormatter("/api/commerce/catalog/admin/products/Actions/RenameProductCodes"); return new MozuUrl(formatter.getResourceUrl(), MozuUrl.UrlLocation.TENANT_POD) ; }
java
public static MozuUrl updateProductInCatalogUrl(Integer catalogId, String productCode, String responseFields) { UrlFormatter formatter = new UrlFormatter("/api/commerce/catalog/admin/products/{productCode}/ProductInCatalogs/{catalogId}?responseFields={responseFields}"); formatter.formatUrl("catalogId", catalogId); formatter.formatUrl("productCode", productCode); formatter.formatUrl("responseFields", responseFields); return new MozuUrl(formatter.getResourceUrl(), MozuUrl.UrlLocation.TENANT_POD) ; }
java
public static MozuUrl deleteProductInCatalogUrl(Integer catalogId, String productCode) { UrlFormatter formatter = new UrlFormatter("/api/commerce/catalog/admin/products/{productCode}/ProductInCatalogs/{catalogId}"); formatter.formatUrl("catalogId", catalogId); formatter.formatUrl("productCode", productCode); return new MozuUrl(formatter.getResourceUrl(), MozuUrl.UrlLocation.TENANT_POD) ; }
java
protected List<ExcelFile> getExcelFiles() { if (excelFiles == null) { excelFiles = newArrayListWithCapacity(3); for (int i = 0;; ++i) { String baseKey = String.format("dataSource.%s.%d", getName(), i); String path = configuration.get(baseKey + ".path"); if (path == null) { break; } String doString = configuration.get(baseKey + ".dataOrientation", "rowbased"); DataOrientation dataOrientation = DataOrientation.valueOf(doString); log.info("Opening Excel file: {}", path); ExcelFile file = new ExcelFile(new File(path), dataOrientation, dataFormatter); try { file.load(); } catch (InvalidFormatException ex) { throw new JFunkException(ex.getMessage(), ex); } catch (IOException ex) { throw new JFunkException(ex.getMessage(), ex); } excelFiles.add(file); } } return excelFiles; }
java
@Override protected DataSet getNextDataSetImpl(final String dataSetKey) { for (ExcelFile excelFile : getExcelFiles()) { Map<String, List<Map<String, String>>> data = excelFile.getData(); List<Map<String, String>> dataList = data.get(dataSetKey); if (dataList != null) { MutableInt counter = dataSetIndices.get(dataSetKey); if (counter == null) { counter = new MutableInt(0); dataSetIndices.put(dataSetKey, counter); } if (counter.getValue() >= dataList.size()) { // no more data available return null; } // turn data map into a data set Map<String, String> dataMap = dataList.get(counter.getValue()); DataSet dataSet = new DefaultDataSet(dataMap); // advance the counter for the next dataset counter.increment(); return dataSet; } } return null; }
java
public ConceptLattice asConceptLattice(final Graph graph) { ConceptLattice lattice = new ConceptLattice(graph, attributes.size()); Iterator it = this.asCrossTable().iterator(); while(it.hasNext()) { CrossTable.Row row = (CrossTable.Row) it.next(); lattice.insert(row.asConcept(attributes.size())); } return lattice; }
java
public static <G extends Relatable<?>> Context down(final CompleteLattice lattice) { List<Object> elements = Arrays.asList(lattice.toArray()); return new Context(elements, elements, new LessOrEqual()); }
java
public static <G extends Relatable<?>> Context downset(final CompleteLattice lattice) { List<Object> elements = Arrays.asList(lattice.toArray()); return new Context(elements, elements, new NotGreaterOrEqual()); }
java
public static <G extends PartiallyOrdered<?>> Context powerset(final List<G> set) { return new Context(set, set, new NotEqual()); }
java
public static <G extends PartiallyOrdered<?>> Context antichain(final List<G> set) { return new Context(set, set, new Equal()); }
java
public static List<Long> indexes(final MutableBitSet bits) { List<Long> indexes = new ArrayList<>((int) bits.cardinality()); for (long i = bits.nextSetBit(0); i >= 0; i = bits.nextSetBit(i + 1)) { indexes.add(i); } return indexes; }
java
public static String messageAsText(final Message message, final boolean includeHeaders) { try { StrBuilder sb = new StrBuilder(300); if (includeHeaders) { @SuppressWarnings("unchecked") Enumeration<Header> headers = message.getAllHeaders(); while (headers.hasMoreElements()) { Header header = headers.nextElement(); sb.append(header.getName()).append('=').appendln(header.getValue()); } sb.appendln(""); } Object content = message.getContent(); if (content instanceof String) { String body = (String) content; sb.appendln(body); sb.appendln(""); } else if (content instanceof Multipart) { parseMultipart(sb, (Multipart) content); } return sb.toString(); } catch (MessagingException ex) { throw new MailException("Error getting mail content.", ex); } catch (IOException ex) { throw new MailException("Error getting mail content.", ex); } }
java
protected final Constraint getConstraint(final Element element) { Element constraintElement = element.getChild(XMLTags.CONSTRAINT); if (constraintElement != null) { return generator.getConstraintFactory().createModel(random, constraintElement); } constraintElement = element.getChild(XMLTags.CONSTRAINT_REF); if (constraintElement != null) { try { return generator.getConstraintFactory().getModel(constraintElement); } catch (IdNotFoundException e) { log.error("Could not find constraint in map. Maybe it has not been initialised;" + " in this case, try rearranging order of constraints in the xml file.", e); } } throw new IllegalStateException("No element constraint or constraint_ref could be found for " + this); }
java
protected final String getValue(final String key, final FieldCase ca) throws IdNotFoundException { ConstraintFactory f = generator.getConstraintFactory(); String value = f.getModel(key).initValues(ca); if (value == null) { return ""; } return value; }
java
public static BedRecord valueOf(final String value) { checkNotNull(value); List<String> tokens = Splitter.on("\t").trimResults().splitToList(value); if (tokens.size() < 3) { throw new IllegalArgumentException("value must have at least three fields (chrom, start, end)"); } String chrom = tokens.get(0); long start = Long.parseLong(tokens.get(1)); long end = Long.parseLong(tokens.get(2)); if (tokens.size() == 3) { return new BedRecord(chrom, start, end); } else { String name = tokens.get(3); if (tokens.size() == 4) { return new BedRecord(chrom, start, end, name); } else { String score = tokens.get(4); if (tokens.size() == 5) { return new BedRecord(chrom, start, end, name, score); } else { String strand = tokens.get(5); if (tokens.size() == 6) { return new BedRecord(chrom, start, end, name, score, strand); } if (tokens.size() != 12) { throw new IllegalArgumentException("value is not in BED3, BED4, BED5, BED6 or BED12 format"); } long thickStart = Long.parseLong(tokens.get(6)); long thickEnd = Long.parseLong(tokens.get(7)); String itemRgb = tokens.get(8); int blockCount = Integer.parseInt(tokens.get(9)); long[] blockSizes = parseLongArray(tokens.get(10)); long[] blockStarts = parseLongArray(tokens.get(11)); return new BedRecord(chrom, start, end, name, score, strand, thickStart, thickEnd, itemRgb, blockCount, blockSizes, blockStarts); } } } }
java
public static MozuUrl deletePriceListEntryUrl(String currencyCode, String priceListCode, String productCode, DateTime startDate) { UrlFormatter formatter = new UrlFormatter("/api/commerce/catalog/admin/pricelists/{priceListCode}/entries/{productCode}/{currencyCode}?startDate={startDate}"); formatter.formatUrl("currencyCode", currencyCode); formatter.formatUrl("priceListCode", priceListCode); formatter.formatUrl("productCode", productCode); formatter.formatUrl("startDate", startDate); return new MozuUrl(formatter.getResourceUrl(), MozuUrl.UrlLocation.TENANT_POD) ; }
java
public static MozuUrl getEventsUrl(String filter, Integer pageSize, String responseFields, String sortBy, Integer startIndex) { UrlFormatter formatter = new UrlFormatter("/api/event/pull/?startIndex={startIndex}&pageSize={pageSize}&sortBy={sortBy}&filter={filter}&responseFields={responseFields}"); formatter.formatUrl("filter", filter); formatter.formatUrl("pageSize", pageSize); formatter.formatUrl("responseFields", responseFields); formatter.formatUrl("sortBy", sortBy); formatter.formatUrl("startIndex", startIndex); return new MozuUrl(formatter.getResourceUrl(), MozuUrl.UrlLocation.HOME_POD) ; }
java
public static MozuUrl getEventUrl(String eventId, String responseFields) { UrlFormatter formatter = new UrlFormatter("/api/event/pull/{eventId}?responseFields={responseFields}"); formatter.formatUrl("eventId", eventId); formatter.formatUrl("responseFields", responseFields); return new MozuUrl(formatter.getResourceUrl(), MozuUrl.UrlLocation.HOME_POD) ; }
java
public void addToSms(final Sms sms) { if (null == getSms()) { setSms(new java.util.TreeSet<Sms>()); } getSms().add(sms); }
java
public void addToApplications(final Application application) { if (null == getApplications()) { setApplications(new java.util.TreeSet<Application>()); } getApplications().add(application); }
java
public static MozuUrl setFulFillmentInfoUrl(String orderId, String responseFields, String updateMode, String version) { UrlFormatter formatter = new UrlFormatter("/api/commerce/orders/{orderId}/fulfillmentinfo?updatemode={updateMode}&version={version}&responseFields={responseFields}"); formatter.formatUrl("orderId", orderId); formatter.formatUrl("responseFields", responseFields); formatter.formatUrl("updateMode", updateMode); formatter.formatUrl("version", version); return new MozuUrl(formatter.getResourceUrl(), MozuUrl.UrlLocation.TENANT_POD) ; }
java
public static MozuUrl deleteDocumentDraftsUrl(String documentLists) { UrlFormatter formatter = new UrlFormatter("/api/content/documentpublishing/draft?documentLists={documentLists}"); formatter.formatUrl("documentLists", documentLists); return new MozuUrl(formatter.getResourceUrl(), MozuUrl.UrlLocation.TENANT_POD) ; }
java
public static GTRPublicData read(final Reader reader) throws IOException { checkNotNull(reader); try { // todo: may want to cache some of this for performance reasons JAXBContext context = JAXBContext.newInstance(GTRPublicData.class); Unmarshaller unmarshaller = context.createUnmarshaller(); SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI); URL schemaURL = GtrReader.class.getResource("/org/nmdp/ngs/gtr/xsd/GTRPublicData.xsd"); Schema schema = schemaFactory.newSchema(schemaURL); unmarshaller.setSchema(schema); return (GTRPublicData) unmarshaller.unmarshal(reader); } catch (JAXBException | SAXException e) { throw new IOException("could not unmarshal GTRPublicData", e); } }
java
public static GTRPublicData read(final URL url) throws IOException { checkNotNull(url); try (BufferedReader reader = Resources.asCharSource(url, Charsets.UTF_8).openBufferedStream()) { return read(reader); } }
java
public static GTRPublicData read(final InputStream inputStream) throws IOException { checkNotNull(inputStream); try (BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream))) { return read(reader); } }
java
public static MozuUrl getShipmentUrl(String orderId, String responseFields, String shipmentId) { UrlFormatter formatter = new UrlFormatter("/api/commerce/orders/{orderId}/shipments/{shipmentId}?responseFields={responseFields}"); formatter.formatUrl("orderId", orderId); formatter.formatUrl("responseFields", responseFields); formatter.formatUrl("shipmentId", shipmentId); return new MozuUrl(formatter.getResourceUrl(), MozuUrl.UrlLocation.TENANT_POD) ; }
java
public static MozuUrl deleteShipmentUrl(String orderId, String shipmentId) { UrlFormatter formatter = new UrlFormatter("/api/commerce/orders/{orderId}/shipments/{shipmentId}"); formatter.formatUrl("orderId", orderId); formatter.formatUrl("shipmentId", shipmentId); return new MozuUrl(formatter.getResourceUrl(), MozuUrl.UrlLocation.TENANT_POD) ; }
java
public Allele doubleCrossover(final Allele right) throws IllegalSymbolException, IndexOutOfBoundsException, IllegalAlphabetException { if (this.overlaps(right)) { //System.out.println("this range" + this.toString() + " sequence = " + this.sequence.seqString() + "sequence length = " + sequence.length()); Locus homologue = intersection(right); //System.out.println("homologue = " + homologue); SymbolList copy = DNATools.createDNA(this.sequence.seqString()); int length = homologue.getEnd() - homologue.getStart(); int target = homologue.getStart() - right.getStart() + 1; int from = homologue.getStart() - this.getStart() + 1; //System.out.println("length = " + length); //System.out.println("target = " + target); //System.out.println("from = " + from); //System.out.println("copy = " + copy.seqString()); try { SymbolList replace = right.sequence.subList(target, target + length - 1); //System.out.println("replace = " + replace.seqString()); copy.edit(new Edit(from, length, replace)); } catch(ChangeVetoException e) { //System.out.println("CHANGE VETO EXCEPTON" + e.getMessage()); } //System.out.println("CROSSEDOVER SEQUENCE = " + copy.seqString()); //copy.edit(new Edit()); //Sequence left = this.sequence.subList(0, homologue.getStart()); //Sequence middle = right.sequence.subList(homologue.getStart() - right.getStart(), i1); return new Allele(this.name, this.contig, this.getStart(), this.getEnd(), copy, Lesion.UNKNOWN); } return new Allele(this.name, this.contig, this.getStart(), this.getEnd(), this.sequence, Lesion.UNKNOWN); }
java
public Allele merge(final Allele right, final long minimumOverlap) throws IllegalSymbolException, IndexOutOfBoundsException, IllegalAlphabetException, AlleleException { Allele.Builder builder = Allele.builder(); Locus overlap = intersection(right); // System.out.println("overlap = " + overlap); // System.out.println("overlap.length() " + overlap.length() + " < " + startimumOverlap + "??"); if (overlap.length() < minimumOverlap) { return builder.reset().build(); } Allele bit = builder .withContig(overlap.getContig()) .withStart(overlap.getStart()) .withEnd(overlap.getEnd()) .withSequence(SymbolList.EMPTY_LIST) .withLesion(Lesion.UNKNOWN) .build(); // System.out.println("bit = " + bit + " " + bit.sequence.seqString()); Allele a = bit.doubleCrossover(right); // System.out.println("a = " + a + " " + a.sequence.seqString()); Allele b = bit.doubleCrossover(this); // System.out.println("b = " + b + " " + b.sequence.seqString()); if (a.sequence.seqString().equals(b.sequence.seqString())) { Locus union = union(right); return builder .withName(right.getName()) .withContig(union.getContig()) .withStart(union.getStart()) .withEnd(union.getEnd()) .withSequence(SymbolList.EMPTY_LIST) .withLesion(Lesion.UNKNOWN) .build() .doubleCrossover(right) .doubleCrossover(this); } return builder.reset().build(); }
java
public static MozuUrl changePasswordUrl(Integer accountId, Boolean unlockAccount, String userId) { UrlFormatter formatter = new UrlFormatter("/api/commerce/customer/accounts/{accountId}/Change-Password?unlockAccount={unlockAccount}&userId={userId}"); formatter.formatUrl("accountId", accountId); formatter.formatUrl("unlockAccount", unlockAccount); formatter.formatUrl("userId", userId); return new MozuUrl(formatter.getResourceUrl(), MozuUrl.UrlLocation.TENANT_POD) ; }
java
public static MozuUrl setPasswordChangeRequiredUrl(Integer accountId, String userId) { UrlFormatter formatter = new UrlFormatter("/api/commerce/customer/accounts/{accountId}/Set-Password-Change-Required?userId={userId}"); formatter.formatUrl("accountId", accountId); formatter.formatUrl("userId", userId); return new MozuUrl(formatter.getResourceUrl(), MozuUrl.UrlLocation.TENANT_POD) ; }
java
public static MozuUrl getLoginStateByEmailAddressUrl(String customerSetCode, String emailAddress, String responseFields) { UrlFormatter formatter = new UrlFormatter("/api/commerce/customer/accounts/loginstatebyemailaddress?emailAddress={emailAddress}&responseFields={responseFields}"); formatter.formatUrl("customerSetCode", customerSetCode); formatter.formatUrl("emailAddress", emailAddress); formatter.formatUrl("responseFields", responseFields); return new MozuUrl(formatter.getResourceUrl(), MozuUrl.UrlLocation.TENANT_POD) ; }
java
public static MozuUrl getLoginStateByUserNameUrl(String customerSetCode, String responseFields, String userName) { UrlFormatter formatter = new UrlFormatter("/api/commerce/customer/accounts/loginstatebyusername?userName={userName}&customerSetCode={customerSetCode}&responseFields={responseFields}"); formatter.formatUrl("customerSetCode", customerSetCode); formatter.formatUrl("responseFields", responseFields); formatter.formatUrl("userName", userName); return new MozuUrl(formatter.getResourceUrl(), MozuUrl.UrlLocation.TENANT_POD) ; }
java
public static MozuUrl getCustomersPurchaseOrderAccountsUrl(String accountType, Integer pageSize, String responseFields, String sortBy, Integer startIndex) { UrlFormatter formatter = new UrlFormatter("/api/commerce/customer/accounts/purchaseOrderAccounts?startIndex={startIndex}&pageSize={pageSize}&sortBy={sortBy}&accountType={accountType}&responseFields={responseFields}"); formatter.formatUrl("accountType", accountType); formatter.formatUrl("pageSize", pageSize); formatter.formatUrl("responseFields", responseFields); formatter.formatUrl("sortBy", sortBy); formatter.formatUrl("startIndex", startIndex); return new MozuUrl(formatter.getResourceUrl(), MozuUrl.UrlLocation.TENANT_POD) ; }
java
public static MozuUrl resetPasswordUrl() { UrlFormatter formatter = new UrlFormatter("/api/commerce/customer/accounts/Reset-Password"); return new MozuUrl(formatter.getResourceUrl(), MozuUrl.UrlLocation.TENANT_POD) ; }
java
public static MozuUrl getSoftAllocationUrl(String responseFields, Integer softAllocationId) { UrlFormatter formatter = new UrlFormatter("/api/commerce/catalog/admin/softallocations/{softAllocationId}?responseFields={responseFields}"); formatter.formatUrl("responseFields", responseFields); formatter.formatUrl("softAllocationId", softAllocationId); return new MozuUrl(formatter.getResourceUrl(), MozuUrl.UrlLocation.TENANT_POD) ; }
java
public static MozuUrl addSoftAllocationsUrl() { UrlFormatter formatter = new UrlFormatter("/api/commerce/catalog/admin/softallocations/"); return new MozuUrl(formatter.getResourceUrl(), MozuUrl.UrlLocation.TENANT_POD) ; }
java
public static MozuUrl convertToProductReservationUrl() { UrlFormatter formatter = new UrlFormatter("/api/commerce/catalog/admin/softallocations/convert"); return new MozuUrl(formatter.getResourceUrl(), MozuUrl.UrlLocation.TENANT_POD) ; }
java
public static MozuUrl renewSoftAllocationsUrl() { UrlFormatter formatter = new UrlFormatter("/api/commerce/catalog/admin/softallocations/renew"); return new MozuUrl(formatter.getResourceUrl(), MozuUrl.UrlLocation.TENANT_POD) ; }
java
public static MozuUrl updateSoftAllocationsUrl() { UrlFormatter formatter = new UrlFormatter("/api/commerce/catalog/admin/softallocations/"); return new MozuUrl(formatter.getResourceUrl(), MozuUrl.UrlLocation.TENANT_POD) ; }
java
public static MozuUrl deleteSoftAllocationUrl(Integer softAllocationId) { UrlFormatter formatter = new UrlFormatter("/api/commerce/catalog/admin/softallocations/{softAllocationId}"); formatter.formatUrl("softAllocationId", softAllocationId); return new MozuUrl(formatter.getResourceUrl(), MozuUrl.UrlLocation.TENANT_POD) ; }
java
public static MozuUrl getDocumentTypeUrl(String documentTypeName, String responseFields) { UrlFormatter formatter = new UrlFormatter("/api/content/documenttypes/{documentTypeName}?responseFields={responseFields}"); formatter.formatUrl("documentTypeName", documentTypeName); formatter.formatUrl("responseFields", responseFields); return new MozuUrl(formatter.getResourceUrl(), MozuUrl.UrlLocation.TENANT_POD) ; }
java
public static MozuUrl bulkDeletePriceListEntriesUrl(Boolean invalidateCache, Boolean publishEvents) { UrlFormatter formatter = new UrlFormatter("/api/commerce/catalog/admin/pricelists/bulkdeleteentries?publishEvents={publishEvents}&invalidateCache={invalidateCache}"); formatter.formatUrl("invalidateCache", invalidateCache); formatter.formatUrl("publishEvents", publishEvents); return new MozuUrl(formatter.getResourceUrl(), MozuUrl.UrlLocation.TENANT_POD) ; }
java
public static MozuUrl deletePriceListUrl(Boolean cascadeDeleteEntries, String priceListCode) { UrlFormatter formatter = new UrlFormatter("/api/commerce/catalog/admin/pricelists/{priceListCode}?cascadeDeleteEntries={cascadeDeleteEntries}"); formatter.formatUrl("cascadeDeleteEntries", cascadeDeleteEntries); formatter.formatUrl("priceListCode", priceListCode); return new MozuUrl(formatter.getResourceUrl(), MozuUrl.UrlLocation.TENANT_POD) ; }
java
public static MozuUrl getEntityUrl(String entityListFullName, String id, String responseFields) { UrlFormatter formatter = new UrlFormatter("/api/platform/entitylists/{entityListFullName}/entities/{id}?responseFields={responseFields}"); formatter.formatUrl("entityListFullName", entityListFullName); formatter.formatUrl("id", id); formatter.formatUrl("responseFields", responseFields); return new MozuUrl(formatter.getResourceUrl(), MozuUrl.UrlLocation.TENANT_POD) ; }
java
public static MozuUrl deleteEntityUrl(String entityListFullName, String id) { UrlFormatter formatter = new UrlFormatter("/api/platform/entitylists/{entityListFullName}/entities/{id}"); formatter.formatUrl("entityListFullName", entityListFullName); formatter.formatUrl("id", id); return new MozuUrl(formatter.getResourceUrl(), MozuUrl.UrlLocation.TENANT_POD) ; }
java
public static MozuUrl getB2BAccountAttributeUrl(Integer accountId, String attributeFQN, String responseFields) { UrlFormatter formatter = new UrlFormatter("/api/commerce/customer/b2baccounts/{accountId}/attributes/{attributeFQN}?responseFields={responseFields}"); formatter.formatUrl("accountId", accountId); formatter.formatUrl("attributeFQN", attributeFQN); formatter.formatUrl("responseFields", responseFields); return new MozuUrl(formatter.getResourceUrl(), MozuUrl.UrlLocation.TENANT_POD) ; }
java
public static MozuUrl getUserRolesAsyncUrl(Integer accountId, String responseFields, String userId) { UrlFormatter formatter = new UrlFormatter("/api/commerce/customer/b2baccounts/{accountId}/user/{userId}/roles?responseFields={responseFields}"); formatter.formatUrl("accountId", accountId); formatter.formatUrl("responseFields", responseFields); formatter.formatUrl("userId", userId); return new MozuUrl(formatter.getResourceUrl(), MozuUrl.UrlLocation.TENANT_POD) ; }
java
public static MozuUrl deleteB2BAccountAttributeUrl(Integer accountId, String attributeFQN) { UrlFormatter formatter = new UrlFormatter("/api/commerce/customer/b2baccounts/{accountId}/attributes/{attributeFQN}"); formatter.formatUrl("accountId", accountId); formatter.formatUrl("attributeFQN", attributeFQN); return new MozuUrl(formatter.getResourceUrl(), MozuUrl.UrlLocation.TENANT_POD) ; }
java
public static MozuUrl removeUserRoleAsyncUrl(Integer accountId, Integer roleId, String userId) { UrlFormatter formatter = new UrlFormatter("/api/commerce/customer/b2baccounts/{accountId}/user/{userId}/roles/{roleId}"); formatter.formatUrl("accountId", accountId); formatter.formatUrl("roleId", roleId); formatter.formatUrl("userId", userId); return new MozuUrl(formatter.getResourceUrl(), MozuUrl.UrlLocation.TENANT_POD) ; }
java
public static MozuUrl getLocationTypesUrl() { UrlFormatter formatter = new UrlFormatter("/api/commerce/admin/locationtypes/"); return new MozuUrl(formatter.getResourceUrl(), MozuUrl.UrlLocation.TENANT_POD) ; }
java
public static MozuUrl getLocationTypeUrl(String locationTypeCode, String responseFields) { UrlFormatter formatter = new UrlFormatter("/api/commerce/admin/locationtypes/{locationTypeCode}?responseFields={responseFields}"); formatter.formatUrl("locationTypeCode", locationTypeCode); formatter.formatUrl("responseFields", responseFields); return new MozuUrl(formatter.getResourceUrl(), MozuUrl.UrlLocation.TENANT_POD) ; }
java
public static MozuUrl deleteLocationTypeUrl(String locationTypeCode) { UrlFormatter formatter = new UrlFormatter("/api/commerce/admin/locationtypes/{locationTypeCode}"); formatter.formatUrl("locationTypeCode", locationTypeCode); return new MozuUrl(formatter.getResourceUrl(), MozuUrl.UrlLocation.TENANT_POD) ; }
java
public static MozuUrl getMasterCatalogUrl(Integer masterCatalogId, String responseFields) { UrlFormatter formatter = new UrlFormatter("/api/commerce/catalog/admin/mastercatalogs/{masterCatalogId}?responseFields={responseFields}"); formatter.formatUrl("masterCatalogId", masterCatalogId); formatter.formatUrl("responseFields", responseFields); return new MozuUrl(formatter.getResourceUrl(), MozuUrl.UrlLocation.TENANT_POD) ; }
java
public static Sequence createSequence(final org.biojava.bio.seq.Sequence sequence) { checkNotNull(sequence); Sequence s = new Sequence(); if (!DNATools.getDNA().equals(sequence.getAlphabet())) { throw new IllegalArgumentException("alphabet must be DNA"); } s.setValue(sequence.seqString()); return s; }
java
public static Iterable<Sequence> createSequences(final BufferedReader reader) throws IOException { checkNotNull(reader); List<Sequence> sequences = new ArrayList<Sequence>(); for (SequenceIterator it = SeqIOTools.readFastaDNA(reader); it.hasNext(); ) { try { sequences.add(createSequence(it.nextSequence())); } catch (BioException e) { throw new IOException("could not read DNA sequences", e); } } return sequences; }
java
public static Iterable<Sequence> createSequences(final File file) throws IOException { checkNotNull(file); try (BufferedReader reader = new BufferedReader(new FileReader(file))) { return createSequences(reader); } }
java
public static Iterable<Sequence> createSequences(final URL url) throws IOException { checkNotNull(url); try (BufferedReader reader = Resources.asCharSource(url, Charsets.UTF_8).openBufferedStream()) { return createSequences(reader); } }
java
public static Iterable<Sequence> createSequences(final InputStream inputStream) throws IOException { checkNotNull(inputStream); try (BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream))) { return createSequences(reader); } }
java
public static SymbolList toDnaSymbolList(final Sequence sequence) throws IllegalSymbolException { checkNotNull(sequence); return DNATools.createDNA(sequence.getValue().replaceAll("\\s+", "")); }
java
public void refreshAppAuthTicket() { StringBuilder resourceUrl = new StringBuilder(MozuConfig.getBaseUrl()).append(AuthTicketUrl.refreshAppAuthTicketUrl(null).getUrl()); try { @SuppressWarnings("unchecked") MozuClient<AuthTicket> client = (MozuClient<AuthTicket>) MozuClientFactory.getInstance(AuthTicket.class); AuthTicketRequest authTicketRequest = new AuthTicketRequest(); authTicketRequest.setRefreshToken(appAuthTicket.getRefreshToken()); appAuthTicket = client.executePutRequest(authTicketRequest, resourceUrl.toString(), null); } catch (ApiException e) { logger.warn(e.getMessage(), e); throw e; } catch (Exception e) { logger.warn(e.getMessage(), e); throw new ApiException("Exception getting Mozu client: " + e.getMessage()); } logger.info("Setting app token refresh intervals"); setRefreshIntervals(false); logger.info("App Authentication Done"); }
java
public static MozuUrl deleteAccountContactUrl(Integer accountId, Integer contactId) { UrlFormatter formatter = new UrlFormatter("/api/commerce/customer/accounts/{accountId}/contacts/{contactId}"); formatter.formatUrl("accountId", accountId); formatter.formatUrl("contactId", contactId); return new MozuUrl(formatter.getResourceUrl(), MozuUrl.UrlLocation.TENANT_POD) ; }
java
@Override public int getMaxLength() { int max = 0; boolean found = false; for (Constraint c : constraints) { int cM = c.getMaxLength(); if (cM != -1) { max += cM; found = true; } } return found ? max : -1; }
java
@Override public String initValues(final FieldCase ca) { boolean found = false; buffer.setLength(0); for (Constraint c : constraints) { String cV = c.initValues(ca); if (cV != null) { found = true; buffer.append(cV); } } if (found) { return buffer.toString(); } return null; }
java
private Node createNode(final Iterable<Range<C>> ranges) { Range<C> span = Iterables.getFirst(ranges, null); if (span == null) { return null; } for (Range<C> range : ranges) { checkNotNull(range, "ranges must not contain null ranges"); span = range.span(span); } if (span.isEmpty()) { return null; } C center = Ranges.center(span); List<Range<C>> left = Lists.newArrayList(); List<Range<C>> right = Lists.newArrayList(); List<Range<C>> overlap = Lists.newArrayList(); for (Range<C> range : ranges) { if (Ranges.isLessThan(range, center)) { left.add(range); } else if (Ranges.isGreaterThan(range, center)) { right.add(range); } else { overlap.add(range); } } return new Node(center, createNode(left), createNode(right), overlap); }
java
private void depthFirstSearch(final Range<C> query, final Node node, final List<Range<C>> result, final Set<Node> visited) { if (node == null || visited.contains(node) || query.isEmpty()) { return; } if (node.left() != null && Ranges.isLessThan(query, node.center())) { depthFirstSearch(query, node.left(), result, visited); } else if (node.right() != null && Ranges.isGreaterThan(query, node.center())) { depthFirstSearch(query, node.right(), result, visited); } if (Ranges.isGreaterThan(query, node.center())) { for (Range<C> range : node.overlapByUpperEndpoint()) { if (Ranges.intersect(range, query)) { result.add(range); } if (Ranges.isGreaterThan(query, range.upperEndpoint())) { break; } } } else if (Ranges.isLessThan(query, node.center())) { for (Range<C> range : node.overlapByLowerEndpoint()) { if (Ranges.intersect(range, query)) { result.add(range); } if (Ranges.isLessThan(query, range.lowerEndpoint())) { break; } } } else { result.addAll(node.overlapByLowerEndpoint()); } visited.add(node); }
java
public static MozuUrl updateLocationInventoryUrl(String productCode) { UrlFormatter formatter = new UrlFormatter("/api/commerce/catalog/admin/products/{ProductCode}/LocationInventory"); formatter.formatUrl("productCode", productCode); return new MozuUrl(formatter.getResourceUrl(), MozuUrl.UrlLocation.TENANT_POD) ; }
java
public static MozuUrl getProductVariationLocalizedDeltaPricesUrl(String productCode, String variationKey) { UrlFormatter formatter = new UrlFormatter("/api/commerce/catalog/admin/products/{productCode}/variations/{variationKey}/localizedDeltaPrice"); formatter.formatUrl("productCode", productCode); formatter.formatUrl("variationKey", variationKey); return new MozuUrl(formatter.getResourceUrl(), MozuUrl.UrlLocation.TENANT_POD) ; }
java
public static MozuUrl addProductVariationLocalizedPriceUrl(String productCode, String responseFields, String variationKey) { UrlFormatter formatter = new UrlFormatter("/api/commerce/catalog/admin/products/{productCode}/variations/{variationKey}/localizedPrice?responseFields={responseFields}"); formatter.formatUrl("productCode", productCode); formatter.formatUrl("responseFields", responseFields); formatter.formatUrl("variationKey", variationKey); return new MozuUrl(formatter.getResourceUrl(), MozuUrl.UrlLocation.TENANT_POD) ; }
java
public static MozuUrl updateProductVariationLocalizedDeltaPriceUrl(String currencyCode, String productCode, String responseFields, String variationKey) { UrlFormatter formatter = new UrlFormatter("/api/commerce/catalog/admin/products/{productCode}/variations/{variationKey}/localizedDeltaPrice/{currencyCode}?responseFields={responseFields}"); formatter.formatUrl("currencyCode", currencyCode); formatter.formatUrl("productCode", productCode); formatter.formatUrl("responseFields", responseFields); formatter.formatUrl("variationKey", variationKey); return new MozuUrl(formatter.getResourceUrl(), MozuUrl.UrlLocation.TENANT_POD) ; }
java
public static MozuUrl deleteProductVariationLocalizedDeltaPriceUrl(String currencyCode, String productCode, String variationKey) { UrlFormatter formatter = new UrlFormatter("/api/commerce/catalog/admin/products/{productCode}/variations/{variationKey}/localizedDeltaPrice/{currencyCode}"); formatter.formatUrl("currencyCode", currencyCode); formatter.formatUrl("productCode", productCode); formatter.formatUrl("variationKey", variationKey); return new MozuUrl(formatter.getResourceUrl(), MozuUrl.UrlLocation.TENANT_POD) ; }
java
@Override public Set<String> getContainedIds() { Set<String> s = super.getContainedIds(); for (Constraint c : map.values()) { s.addAll(c.getContainedIds()); } return s; }
java
public static MozuUrl getShippingInclusionRuleUrl(String id, String profilecode, String responseFields) { UrlFormatter formatter = new UrlFormatter("/api/commerce/shipping/admin/profiles/{profilecode}/rules/shippinginclusions/{id}?responseFields={responseFields}"); formatter.formatUrl("id", id); formatter.formatUrl("profilecode", profilecode); formatter.formatUrl("responseFields", responseFields); return new MozuUrl(formatter.getResourceUrl(), MozuUrl.UrlLocation.TENANT_POD) ; }
java
public static MozuUrl getShippingInclusionRulesUrl(String profilecode, String responseFields) { UrlFormatter formatter = new UrlFormatter("/api/commerce/shipping/admin/profiles/{profilecode}/rules/shippinginclusions?responseFields={responseFields}"); formatter.formatUrl("profilecode", profilecode); formatter.formatUrl("responseFields", responseFields); return new MozuUrl(formatter.getResourceUrl(), MozuUrl.UrlLocation.TENANT_POD) ; }
java
public static MozuUrl deleteShippingInclusionRuleUrl(String id, String profilecode) { UrlFormatter formatter = new UrlFormatter("/api/commerce/shipping/admin/profiles/{profilecode}/rules/shippinginclusions/{id}"); formatter.formatUrl("id", id); formatter.formatUrl("profilecode", profilecode); return new MozuUrl(formatter.getResourceUrl(), MozuUrl.UrlLocation.TENANT_POD) ; }
java
public static void write(final HighScoringPair hsp, final PrintWriter writer) { checkNotNull(hsp); checkNotNull(writer); writer.println(hsp.toString()); }
java
public static void write(final Iterable<HighScoringPair> hsps, final PrintWriter writer) { checkNotNull(hsps); checkNotNull(writer); for (HighScoringPair hsp : hsps) { writer.println(hsp.toString()); } }
java
@Override public void setFixedValue(final String dataSetKey, final String entryKey, final String value) { Map<String, String> map = fixedValues.get(dataSetKey); if (map == null) { map = Maps.newHashMap(); fixedValues.put(dataSetKey, map); } map.put(entryKey, value); DataSet dataSet = getCurrentDataSet(dataSetKey); if (dataSet != null) { dataSet.setFixedValue(entryKey, value); } }
java
public static MozuUrl getPriceListUrl(String priceListCode, String responseFields) { UrlFormatter formatter = new UrlFormatter("/api/commerce/catalog/storefront/pricelists/{priceListCode}?responseFields={responseFields}"); formatter.formatUrl("priceListCode", priceListCode); formatter.formatUrl("responseFields", responseFields); return new MozuUrl(formatter.getResourceUrl(), MozuUrl.UrlLocation.TENANT_POD) ; }
java
public static MozuUrl getResolvedPriceListUrl(Integer customerAccountId, String responseFields) { UrlFormatter formatter = new UrlFormatter("/api/commerce/catalog/storefront/pricelists/resolved?customerAccountId={customerAccountId}&responseFields={responseFields}"); formatter.formatUrl("customerAccountId", customerAccountId); formatter.formatUrl("responseFields", responseFields); return new MozuUrl(formatter.getResourceUrl(), MozuUrl.UrlLocation.TENANT_POD) ; }
java