idx int64 0 165k | question stringlengths 73 4.15k | target stringlengths 5 918 | len_question int64 21 890 | len_target int64 3 255 |
|---|---|---|---|---|
142,100 | 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 ) ; } | Get Resource Url for GetMasterCatalog | 131 | 8 |
142,101 | 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 ; } | Create and return a new HML Sequence from the specified sequence . | 94 | 13 |
142,102 | 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 ; } | Create and return zero or more DNA HML Sequences read from the specified reader in FASTA format . | 122 | 22 |
142,103 | public static Iterable < Sequence > createSequences ( final File file ) throws IOException { checkNotNull ( file ) ; try ( BufferedReader reader = new BufferedReader ( new FileReader ( file ) ) ) { return createSequences ( reader ) ; } } | Create and return zero or more DNA HML Sequences read from the specified file in FASTA format . | 57 | 22 |
142,104 | 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 ) ; } } | Create and return zero or more DNA HML Sequences read from the specified URL in FASTA format . | 68 | 22 |
142,105 | public static Iterable < Sequence > createSequences ( final InputStream inputStream ) throws IOException { checkNotNull ( inputStream ) ; try ( BufferedReader reader = new BufferedReader ( new InputStreamReader ( inputStream ) ) ) { return createSequences ( reader ) ; } } | Create and return zero or more DNA HML Sequences read from the specified input stream in FASTA format . | 62 | 23 |
142,106 | public static SymbolList toDnaSymbolList ( final Sequence sequence ) throws IllegalSymbolException { checkNotNull ( sequence ) ; return DNATools . createDNA ( sequence . getValue ( ) . replaceAll ( "\\s+" , "" ) ) ; } | Convert the specified HML Sequence element into a DNA symbol list . | 57 | 14 |
142,107 | 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" ) ; } | jh the application auth ticket using the refresh token | 274 | 10 |
142,108 | 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 ) ; } | Get Resource Url for DeleteAccountContact | 119 | 8 |
142,109 | @ 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 ; } | Returns the sum of all maximum lengths of the sub - constraints | 72 | 12 |
142,110 | @ 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 ; } | Initializes all sub - constraints . Returns a character string composed of all character strings of the constraints contained in it . If all sub - constraints return null null is returned . | 89 | 34 |
142,111 | 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 ) ; } | Create and return a new node for the specified ranges . | 253 | 11 |
142,112 | 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 ) ; } | Depth first search . | 358 | 4 |
142,113 | 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 ) ; } | Get Resource Url for UpdateLocationInventory | 99 | 9 |
142,114 | 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 ) ; } | Get Resource Url for GetProductVariationLocalizedDeltaPrices | 134 | 14 |
142,115 | 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 ) ; } | Get Resource Url for AddProductVariationLocalizedPrice | 161 | 12 |
142,116 | 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 ) ; } | Get Resource Url for UpdateProductVariationLocalizedDeltaPrice | 187 | 13 |
142,117 | 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 ) ; } | Get Resource Url for DeleteProductVariationLocalizedDeltaPrice | 156 | 13 |
142,118 | @ Override public Set < String > getContainedIds ( ) { Set < String > s = super . getContainedIds ( ) ; for ( Constraint c : map . values ( ) ) { s . addAll ( c . getContainedIds ( ) ) ; } return s ; } | Returns the set union of all id set of the contained constraints plus its own . | 67 | 16 |
142,119 | 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 ) ; } | Get Resource Url for GetShippingInclusionRule | 154 | 10 |
142,120 | 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 ) ; } | Get Resource Url for GetShippingInclusionRules | 134 | 10 |
142,121 | 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 ) ; } | Get Resource Url for DeleteShippingInclusionRule | 123 | 10 |
142,122 | public static void write ( final HighScoringPair hsp , final PrintWriter writer ) { checkNotNull ( hsp ) ; checkNotNull ( writer ) ; writer . println ( hsp . toString ( ) ) ; } | Write the specified high - scoring segment pair with the specified print writer . | 49 | 14 |
142,123 | public static void write ( final Iterable < HighScoringPair > hsps , final PrintWriter writer ) { checkNotNull ( hsps ) ; checkNotNull ( writer ) ; for ( HighScoringPair hsp : hsps ) { writer . println ( hsp . toString ( ) ) ; } } | Write zero or more high - scoring segment pairs with the specified print writer . | 71 | 15 |
142,124 | @ 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 ) ; } } | Sets a fixed value . | 121 | 6 |
142,125 | 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 ) ; } | Get Resource Url for GetPriceList | 132 | 8 |
142,126 | 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 ) ; } | Get Resource Url for GetResolvedPriceList | 143 | 10 |
142,127 | @ Provides @ Singleton @ JFunkVersion protected String providePerfLoadVersion ( ) { ClassLoader loader = Thread . currentThread ( ) . getContextClassLoader ( ) ; InputStream is = loader . getResourceAsStream ( "com/mgmtp/jfunk/common/version.txt" ) ; try { return IOUtils . toString ( is , "UTF-8" ) ; } catch ( IOException ex ) { throw new IllegalStateException ( "Could not read jFunk version." , ex ) ; } finally { IOUtils . closeQuietly ( is ) ; } } | Provides the version of perfLoad as specified in the Maven pom . | 133 | 16 |
142,128 | public static PairwiseAlignment create ( final int threads , final SubstitutionMatrix substitutionMatrix ) { return new ParallelBiojavaPairwiseAlignment ( Executors . newFixedThreadPool ( threads ) , substitutionMatrix ) ; } | Create and return a new pairwise alignment implementation configured with a fixed thread pool and the specified substitution matrix . | 48 | 21 |
142,129 | public static MozuUrl getStatesUrl ( String profileCode ) { UrlFormatter formatter = new UrlFormatter ( "/api/commerce/shipping/admin/profiles/{profilecode}/shippingstates" ) ; formatter . formatUrl ( "profileCode" , profileCode ) ; return new MozuUrl ( formatter . getResourceUrl ( ) , MozuUrl . UrlLocation . TENANT_POD ) ; } | Get Resource Url for GetStates | 98 | 7 |
142,130 | public static MozuUrl updateStatesUrl ( String profilecode ) { UrlFormatter formatter = new UrlFormatter ( "/api/commerce/shipping/admin/profiles/{profilecode}/shippingstates" ) ; formatter . formatUrl ( "profilecode" , profilecode ) ; return new MozuUrl ( formatter . getResourceUrl ( ) , MozuUrl . UrlLocation . TENANT_POD ) ; } | Get Resource Url for UpdateStates | 98 | 7 |
142,131 | public static MozuUrl getPackageLabelUrl ( String packageId , Boolean returnAsBase64Png , String returnId ) { UrlFormatter formatter = new UrlFormatter ( "/api/commerce/returns/{returnId}/packages/{packageId}/label?returnAsBase64Png={returnAsBase64Png}" ) ; formatter . formatUrl ( "packageId" , packageId ) ; formatter . formatUrl ( "returnAsBase64Png" , returnAsBase64Png ) ; formatter . formatUrl ( "returnId" , returnId ) ; return new MozuUrl ( formatter . getResourceUrl ( ) , MozuUrl . UrlLocation . TENANT_POD ) ; } | Get Resource Url for GetPackageLabel | 163 | 8 |
142,132 | public static Iterable < HighScoringPair > read ( final Readable readable ) throws IOException { checkNotNull ( readable ) ; Collect collect = new Collect ( ) ; stream ( readable , collect ) ; return collect . hsps ( ) ; } | Read zero or more high - scoring segment pairs from the specified readable . | 54 | 14 |
142,133 | public static void stream ( final Readable readable , final HspListener listener ) throws IOException { checkNotNull ( readable ) ; checkNotNull ( listener ) ; HspLineProcessor lineProcessor = new HspLineProcessor ( listener ) ; CharStreams . readLines ( readable , lineProcessor ) ; } | Stream zero or more high - scoring segment pairs from the specified readable . | 69 | 14 |
142,134 | public static MozuUrl getTreeDocumentUrl ( String documentListName , String documentName , Boolean includeInactive , String responseFields ) { UrlFormatter formatter = new UrlFormatter ( "/api/content/documentlists/{documentListName}/documentTree/{documentName}?includeInactive={includeInactive}&responseFields={responseFields}" ) ; formatter . formatUrl ( "documentListName" , documentListName ) ; formatter . formatUrl ( "documentName" , documentName ) ; formatter . formatUrl ( "includeInactive" , includeInactive ) ; formatter . formatUrl ( "responseFields" , responseFields ) ; return new MozuUrl ( formatter . getResourceUrl ( ) , MozuUrl . UrlLocation . TENANT_POD ) ; } | Get Resource Url for GetTreeDocument | 182 | 8 |
142,135 | public static MozuUrl updateTreeDocumentContentUrl ( String documentListName , String documentName ) { UrlFormatter formatter = new UrlFormatter ( "/api/content/documentlists/{documentListName}/documentTree/{documentName}/content?folderPath={folderPath}&folderId={folderId}" ) ; formatter . formatUrl ( "documentListName" , documentListName ) ; formatter . formatUrl ( "documentName" , documentName ) ; return new MozuUrl ( formatter . getResourceUrl ( ) , MozuUrl . UrlLocation . TENANT_POD ) ; } | Get Resource Url for UpdateTreeDocumentContent | 137 | 9 |
142,136 | public void manageAck ( final Acknowledgment acknowledgment ) { final int smid = acknowledgment . getSmsId ( ) ; final SmsStatus smsStatus = acknowledgment . getSmsStatus ( ) ; if ( logger . isDebugEnabled ( ) ) { logger . debug ( "Manage ack with : " + " - smid : " + smid + " - ack status : " + smsStatus ) ; } final Sms sms = daoService . getSms ( smid ) ; if ( sms != null ) { manageAck ( sms , smsStatus ) ; } else { logger . error ( "unable to find in db sms with : " + " - sms_id : " + smid + "In order to update is state in DB" + smid ) ; } } | Business layer to mange ack . | 179 | 8 |
142,137 | private void putPhoneNumberInBlackList ( final String phoneNumber , final Application application ) { // if phone number is not already in the bl (it should not append) put the phone number // put the phone number in the black list if ( daoService . isPhoneNumberInBlackList ( phoneNumber ) ) return ; logger . debug ( "Adding to black list : \n" + " - Phone number : " + phoneNumber + "\n" + " - Application id : " + application . getId ( ) + "\n" ) ; final Date currentDate = new Date ( System . currentTimeMillis ( ) ) ; daoService . addBlacklist ( new Blacklist ( application , currentDate , phoneNumber ) ) ; } | Put a number in black list . | 155 | 7 |
142,138 | @ RobotKeyword public boolean jsonElementShouldMatch ( String source , String jsonPath , Object value , String method , String data , String contentType ) throws Exception { boolean match = false ; if ( value == null ) { throw new IllegalArgumentException ( "Given value was null" ) ; } String found = String . valueOf ( findJsonElement ( source , jsonPath , method , data , contentType ) ) ; if ( found . equals ( value ) ) { System . out . println ( "*DEBUG* The values '" + found + "' and '" + value + "' did match" ) ; match = true ; } else { System . out . println ( "*ERROR* The values '" + found + "' and '" + value + "' did not match" ) ; throw new JsonNotEqualException ( "The found value did not match, found '" + found + "', expected '" + value + "'" ) ; } return match ; } | Checks if the given value matches the one found by the jsonPath from the source . | 207 | 18 |
142,139 | @ RobotKeyword public boolean jsonShouldBeEqual ( String from , String to ) throws Exception { return jsonShouldBeEqual ( from , to , false ) ; } | Checks if the given JSON contents are equal . See Json Should Be Equal for more details | 36 | 19 |
142,140 | @ RobotKeyword public boolean jsonShouldBeEqual ( String from , String to , boolean useExactMatch , String method , String data , String contentType ) throws Exception { System . out . println ( "*DEBUG* Comparing JSON sources" ) ; boolean equal = false ; String fromJson = requestUtil . readSource ( from , method , data , contentType ) ; String toJson = requestUtil . readSource ( to , method , data , contentType ) ; if ( StringUtils . isNotBlank ( fromJson ) && StringUtils . isNotBlank ( toJson ) ) { if ( useExactMatch ) { if ( fromJson . equals ( toJson ) ) { System . out . println ( "*DEBUG* JSON strings are equal by exact compare" ) ; equal = true ; } else { System . out . println ( "*ERROR* JSON strings are NOT equal by exact compare" ) ; equal = false ; throw new JsonNotEqualException ( "JSON strings are NOT equal by exact compare" ) ; } } else { equal = diff . compare ( fromJson , toJson ) ; if ( ! equal ) { throw new JsonNotEqualException ( "JSON strings are NOT equal by compare" ) ; } } } else { System . out . println ( "*ERROR* Either from or to JSON was empty" ) ; throw new JsonNotValidException ( "One of the JSON strings is empty" ) ; } return equal ; } | Checks if the given JSON contents are equal . The third parameter specifies whether exact string match should be used or diffing by the JSON objects ie . the order of the attributes does not matter . | 323 | 39 |
142,141 | @ RobotKeyword public Object findJsonElement ( String source , String jsonPath , String method , String data , String contentType ) throws Exception { System . out . println ( "*DEBUG* Reading jsonPath: " + jsonPath ) ; String json = requestUtil . readSource ( source , method , data , contentType ) ; Object value ; try { value = JsonPath . read ( json , jsonPath ) ; } catch ( PathNotFoundException e ) { throw new JsonElementNotFoundException ( "Path '" + jsonPath + "' was not found in JSON" ) ; } return value ; } | Find JSON element by jsonPath from the source and return its value if found . | 131 | 16 |
142,142 | @ SuppressWarnings ( "unchecked" ) @ RobotKeyword public boolean jsonShouldHaveElementCount ( String source , String jsonPath , Integer count , String method , String data , String contentType ) throws Exception { boolean match = false ; System . out . println ( "*DEBUG* Reading jsonPath: " + jsonPath ) ; String json = requestUtil . readSource ( source , method , data , contentType ) ; List < Object > elements = null ; Object object = null ; try { object = JsonPath . read ( json , jsonPath ) ; } catch ( PathNotFoundException e ) { throw new JsonElementNotFoundException ( "Path '" + jsonPath + "' was not found in JSON" ) ; } if ( object != null ) { // TODO: Find a way to do this without suppressing the warning if ( object instanceof List < ? > ) { elements = ( List < Object > ) object ; if ( CollectionUtils . isNotEmpty ( elements ) ) { match = ( elements . size ( ) == count ) ; if ( ! match ) { System . out . println ( "*ERROR* Element counts did not match. Expected '" + count + "', got '" + elements . size ( ) + "'" ) ; throw new JsonNotEqualException ( "Element counts did not match. Expected '" + count + "', got '" + elements . size ( ) + "'" ) ; } } else { // In practice, it's impossible to end here. System . out . println ( "*ERROR* Could not find elements from '" + jsonPath + "'" ) ; throw new JsonElementNotFoundException ( "Could not find elements from '" + jsonPath + "'" ) ; } } else if ( count == 1 ) { System . out . println ( "*DEBUG* Found 1 item as expected from '" + jsonPath + "'" ) ; match = true ; } else { System . out . println ( "*ERROR* Found 1 item, but expected '" + count + "'" ) ; throw new JsonElementNotFoundException ( "Found 1 item, but expected '" + count + "'" ) ; } } else { System . out . println ( "*ERROR* Could not find elements from '" + jsonPath + "'" ) ; throw new JsonElementNotFoundException ( "Could not find elements from '" + jsonPath + "'" ) ; } return match ; } | Find JSON element by jsonPath from the source and check if the amount of found elements matches the given count . | 527 | 22 |
142,143 | public static MozuUrl getFileUrl ( String applicationKey , String fileName ) { UrlFormatter formatter = new UrlFormatter ( "/api/platform/appdev/filebasedpackage/packages/{applicationKey}?fileName={fileName}" ) ; formatter . formatUrl ( "applicationKey" , applicationKey ) ; formatter . formatUrl ( "fileName" , fileName ) ; return new MozuUrl ( formatter . getResourceUrl ( ) , MozuUrl . UrlLocation . HOME_POD ) ; } | Get Resource Url for GetFile | 118 | 7 |
142,144 | public static MozuUrl executeUrl ( String cardType , String responseFields ) { UrlFormatter formatter = new UrlFormatter ( "/api/commerce/payments/tokens/{cardType}/execute?responseFields={responseFields}" ) ; formatter . formatUrl ( "cardType" , cardType ) ; formatter . formatUrl ( "responseFields" , responseFields ) ; return new MozuUrl ( formatter . getResourceUrl ( ) , MozuUrl . UrlLocation . TENANT_POD ) ; } | Get Resource Url for Execute | 124 | 7 |
142,145 | public static MozuUrl getPublishSetUrl ( String publishSetCode , String responseFields ) { UrlFormatter formatter = new UrlFormatter ( "/api/commerce/catalog/admin/publishing/publishsets/{publishSetCode}?responseFields={responseFields}" ) ; formatter . formatUrl ( "publishSetCode" , publishSetCode ) ; formatter . formatUrl ( "responseFields" , responseFields ) ; return new MozuUrl ( formatter . getResourceUrl ( ) , MozuUrl . UrlLocation . TENANT_POD ) ; } | Get Resource Url for GetPublishSet | 136 | 9 |
142,146 | public static MozuUrl discardDraftsUrl ( ) { UrlFormatter formatter = new UrlFormatter ( "/api/commerce/catalog/admin/publishing/discarddrafts" ) ; return new MozuUrl ( formatter . getResourceUrl ( ) , MozuUrl . UrlLocation . TENANT_POD ) ; } | Get Resource Url for DiscardDrafts | 77 | 9 |
142,147 | public static MozuUrl publishDraftsUrl ( ) { UrlFormatter formatter = new UrlFormatter ( "/api/commerce/catalog/admin/publishing/publishdrafts" ) ; return new MozuUrl ( formatter . getResourceUrl ( ) , MozuUrl . UrlLocation . TENANT_POD ) ; } | Get Resource Url for PublishDrafts | 77 | 9 |
142,148 | public static MozuUrl getOrderItemViaLineIdUrl ( Boolean draft , Integer lineId , String orderId , String responseFields ) { UrlFormatter formatter = new UrlFormatter ( "/api/commerce/orders/{orderId}/items/{lineId}?draft={draft}&responseFields={responseFields}" ) ; formatter . formatUrl ( "draft" , draft ) ; formatter . formatUrl ( "lineId" , lineId ) ; formatter . formatUrl ( "orderId" , orderId ) ; formatter . formatUrl ( "responseFields" , responseFields ) ; return new MozuUrl ( formatter . getResourceUrl ( ) , MozuUrl . UrlLocation . TENANT_POD ) ; } | Get Resource Url for GetOrderItemViaLineId | 169 | 11 |
142,149 | public static MozuUrl createOrderItemUrl ( String orderId , String responseFields , Boolean skipInventoryCheck , String updateMode , String version ) { UrlFormatter formatter = new UrlFormatter ( "/api/commerce/orders/{orderId}/items?updatemode={updateMode}&version={version}&skipInventoryCheck={skipInventoryCheck}&responseFields={responseFields}" ) ; formatter . formatUrl ( "orderId" , orderId ) ; formatter . formatUrl ( "responseFields" , responseFields ) ; formatter . formatUrl ( "skipInventoryCheck" , skipInventoryCheck ) ; formatter . formatUrl ( "updateMode" , updateMode ) ; formatter . formatUrl ( "version" , version ) ; return new MozuUrl ( formatter . getResourceUrl ( ) , MozuUrl . UrlLocation . TENANT_POD ) ; } | Get Resource Url for CreateOrderItem | 206 | 8 |
142,150 | public static MozuUrl updateOrderItemDiscountUrl ( Integer discountId , String orderId , String orderItemId , String responseFields , String updateMode , String version ) { UrlFormatter formatter = new UrlFormatter ( "/api/commerce/orders/{orderId}/items/{orderItemId}/discounts/{discountId}?updatemode={updateMode}&version={version}&responseFields={responseFields}" ) ; formatter . formatUrl ( "discountId" , discountId ) ; formatter . formatUrl ( "orderId" , orderId ) ; formatter . formatUrl ( "orderItemId" , orderItemId ) ; formatter . formatUrl ( "responseFields" , responseFields ) ; formatter . formatUrl ( "updateMode" , updateMode ) ; formatter . formatUrl ( "version" , version ) ; return new MozuUrl ( formatter . getResourceUrl ( ) , MozuUrl . UrlLocation . TENANT_POD ) ; } | Get Resource Url for UpdateOrderItemDiscount | 230 | 10 |
142,151 | public static MozuUrl updateItemProductPriceUrl ( String orderId , String orderItemId , Double price , String responseFields , String updateMode , String version ) { UrlFormatter formatter = new UrlFormatter ( "/api/commerce/orders/{orderId}/items/{orderItemId}/price/{price}?updatemode={updateMode}&version={version}&responseFields={responseFields}" ) ; formatter . formatUrl ( "orderId" , orderId ) ; formatter . formatUrl ( "orderItemId" , orderItemId ) ; formatter . formatUrl ( "price" , price ) ; formatter . formatUrl ( "responseFields" , responseFields ) ; formatter . formatUrl ( "updateMode" , updateMode ) ; formatter . formatUrl ( "version" , version ) ; return new MozuUrl ( formatter . getResourceUrl ( ) , MozuUrl . UrlLocation . TENANT_POD ) ; } | Get Resource Url for UpdateItemProductPrice | 221 | 9 |
142,152 | public static MozuUrl updateItemQuantityUrl ( String orderId , String orderItemId , Integer quantity , String responseFields , String updateMode , String version ) { UrlFormatter formatter = new UrlFormatter ( "/api/commerce/orders/{orderId}/items/{orderItemId}/quantity/{quantity}?updatemode={updateMode}&version={version}&responseFields={responseFields}" ) ; formatter . formatUrl ( "orderId" , orderId ) ; formatter . formatUrl ( "orderItemId" , orderItemId ) ; formatter . formatUrl ( "quantity" , quantity ) ; formatter . formatUrl ( "responseFields" , responseFields ) ; formatter . formatUrl ( "updateMode" , updateMode ) ; formatter . formatUrl ( "version" , version ) ; return new MozuUrl ( formatter . getResourceUrl ( ) , MozuUrl . UrlLocation . TENANT_POD ) ; } | Get Resource Url for UpdateItemQuantity | 223 | 8 |
142,153 | public static void write ( final BedRecord record , final PrintWriter writer ) { checkNotNull ( record ) ; checkNotNull ( writer ) ; writer . println ( record . toString ( ) ) ; } | Write the specified BED record with the specified print writer . | 43 | 12 |
142,154 | public static void write ( final Iterable < BedRecord > records , final PrintWriter writer ) { checkNotNull ( records ) ; checkNotNull ( writer ) ; for ( BedRecord record : records ) { writer . println ( record . toString ( ) ) ; } } | Write zero or more BED records with the specified print writer . | 57 | 13 |
142,155 | public static MozuUrl updateAccountCardUrl ( Integer accountId , String cardId , String responseFields ) { UrlFormatter formatter = new UrlFormatter ( "/api/commerce/customer/accounts/{accountId}/cards/{cardId}?responseFields={responseFields}" ) ; formatter . formatUrl ( "accountId" , accountId ) ; formatter . formatUrl ( "cardId" , cardId ) ; formatter . formatUrl ( "responseFields" , responseFields ) ; return new MozuUrl ( formatter . getResourceUrl ( ) , MozuUrl . UrlLocation . TENANT_POD ) ; } | Get Resource Url for UpdateAccountCard | 149 | 8 |
142,156 | public static MozuUrl deleteAccountCardUrl ( Integer accountId , String cardId ) { UrlFormatter formatter = new UrlFormatter ( "/api/commerce/customer/accounts/{accountId}/cards/{cardId}" ) ; formatter . formatUrl ( "accountId" , accountId ) ; formatter . formatUrl ( "cardId" , cardId ) ; return new MozuUrl ( formatter . getResourceUrl ( ) , MozuUrl . UrlLocation . TENANT_POD ) ; } | Get Resource Url for DeleteAccountCard | 118 | 8 |
142,157 | public < T > T get ( final Object key ) { @ SuppressWarnings ( "unchecked" ) // cast is not safe but convenient T value = ( T ) additionalData . get ( key ) ; return value ; } | Returns the value stored under the specified key in the internal map of additional meta data . For convenience the value is internally cast to the generic type . It is the caller s responsibility to make sure the cast is safe . | 49 | 43 |
142,158 | public static MozuUrl getReturnNoteUrl ( String noteId , String responseFields , String returnId ) { UrlFormatter formatter = new UrlFormatter ( "/api/commerce/returns/{returnId}/notes/{noteId}?responseFields={responseFields}" ) ; formatter . formatUrl ( "noteId" , noteId ) ; formatter . formatUrl ( "responseFields" , responseFields ) ; formatter . formatUrl ( "returnId" , returnId ) ; return new MozuUrl ( formatter . getResourceUrl ( ) , MozuUrl . UrlLocation . TENANT_POD ) ; } | Get Resource Url for GetReturnNote | 146 | 8 |
142,159 | public static MozuUrl deleteReturnNoteUrl ( String noteId , String returnId ) { UrlFormatter formatter = new UrlFormatter ( "/api/commerce/returns/{returnId}/notes/{noteId}" ) ; formatter . formatUrl ( "noteId" , noteId ) ; formatter . formatUrl ( "returnId" , returnId ) ; return new MozuUrl ( formatter . getResourceUrl ( ) , MozuUrl . UrlLocation . TENANT_POD ) ; } | Get Resource Url for DeleteReturnNote | 115 | 8 |
142,160 | public static MozuUrl getAssignedDiscountsUrl ( String couponSetCode ) { UrlFormatter formatter = new UrlFormatter ( "/api/commerce/catalog/admin/couponsets/{couponSetCode}/assigneddiscounts" ) ; formatter . formatUrl ( "couponSetCode" , couponSetCode ) ; return new MozuUrl ( formatter . getResourceUrl ( ) , MozuUrl . UrlLocation . TENANT_POD ) ; } | Get Resource Url for GetAssignedDiscounts | 114 | 11 |
142,161 | public static MozuUrl unAssignDiscountUrl ( String couponSetCode , Integer discountId ) { UrlFormatter formatter = new UrlFormatter ( "/api/commerce/catalog/admin/couponsets/{couponSetCode}/assigneddiscounts/{discountId}" ) ; formatter . formatUrl ( "couponSetCode" , couponSetCode ) ; formatter . formatUrl ( "discountId" , discountId ) ; return new MozuUrl ( formatter . getResourceUrl ( ) , MozuUrl . UrlLocation . TENANT_POD ) ; } | Get Resource Url for UnAssignDiscount | 138 | 10 |
142,162 | public static MozuUrl getDiscountContentUrl ( Integer discountId , String responseFields ) { UrlFormatter formatter = new UrlFormatter ( "/api/commerce/catalog/admin/discounts/{discountId}/content?responseFields={responseFields}" ) ; formatter . formatUrl ( "discountId" , discountId ) ; formatter . formatUrl ( "responseFields" , responseFields ) ; return new MozuUrl ( formatter . getResourceUrl ( ) , MozuUrl . UrlLocation . TENANT_POD ) ; } | Get Resource Url for GetDiscountContent | 131 | 9 |
142,163 | public static MozuUrl deleteDiscountUrl ( Integer discountId ) { UrlFormatter formatter = new UrlFormatter ( "/api/commerce/catalog/admin/discounts/{discountId}" ) ; formatter . formatUrl ( "discountId" , discountId ) ; return new MozuUrl ( formatter . getResourceUrl ( ) , MozuUrl . UrlLocation . TENANT_POD ) ; } | Get Resource Url for DeleteDiscount | 97 | 8 |
142,164 | public long initMathRandom ( final Long seed ) { if ( seed == null ) { mathRandom = new MathRandom ( ) ; } else { mathRandom = new MathRandom ( seed ) ; } return mathRandom . getSeed ( ) ; } | Intializes the MathRandom instance . | 52 | 8 |
142,165 | @ Override protected String initValuesImpl ( final FieldCase c ) { double d = 0.0 ; String v = source . initValues ( c ) ; if ( v != null && v . length ( ) > 0 ) { d = 0.0 ; try { Number n = format . parse ( v ) ; d = n . doubleValue ( ) ; } catch ( ParseException e ) { log . debug ( "Could not parse string " + v + " to a number; setting value 0.0" ) ; } } d *= factor ; return format . format ( d ) ; } | Initializes the source constraint first . Then the source constraint s value is parsed with the format object of this constraint to a double number and this value is subsequently multiplied with the configurable factor . The multiplied value is finally formatted to a string using the the format object again and stored as a value . | 126 | 59 |
142,166 | public static MozuUrl getDocumentListTypeUrl ( String documentListTypeFQN , String responseFields ) { UrlFormatter formatter = new UrlFormatter ( "/api/content/documentlistTypes/{documentListTypeFQN}?responseFields={responseFields}" ) ; formatter . formatUrl ( "documentListTypeFQN" , documentListTypeFQN ) ; formatter . formatUrl ( "responseFields" , responseFields ) ; return new MozuUrl ( formatter . getResourceUrl ( ) , MozuUrl . UrlLocation . TENANT_POD ) ; } | Get Resource Url for GetDocumentListType | 138 | 9 |
142,167 | public static void write ( final VcfHeader header , final List < VcfSample > samples , final List < VcfRecord > records , final PrintWriter writer ) { writeHeader ( header , writer ) ; writeColumnHeader ( samples , writer ) ; writeRecords ( samples , records , writer ) ; } | Write VCF with the specified print writer . | 64 | 9 |
142,168 | public static void writeHeader ( final VcfHeader header , final PrintWriter writer ) { checkNotNull ( header ) ; checkNotNull ( writer ) ; for ( String meta : header . getMeta ( ) ) { writer . println ( meta ) ; } } | Write VCF header with the specified print writer . | 54 | 10 |
142,169 | public static void writeColumnHeader ( final List < VcfSample > samples , final PrintWriter writer ) { checkNotNull ( samples ) ; checkNotNull ( writer ) ; StringBuilder sb = new StringBuilder ( "#CHROM\tPOS\tID\tREF\tALT\tQUAL\tFILTER\tINFO" ) ; if ( ! samples . isEmpty ( ) ) { sb . append ( "\tFORMAT" ) ; } for ( VcfSample sample : samples ) { sb . append ( "\t" ) ; sb . append ( sample . getId ( ) ) ; } writer . println ( sb . toString ( ) ) ; } | Write VCF column header with the specified print writer . | 146 | 11 |
142,170 | public static void writeRecords ( final List < VcfSample > samples , final List < VcfRecord > records , final PrintWriter writer ) { checkNotNull ( samples ) ; checkNotNull ( records ) ; checkNotNull ( writer ) ; for ( VcfRecord record : records ) { writeRecord ( samples , record , writer ) ; } } | Write VCF records with the specified print writer . | 74 | 10 |
142,171 | public static void writeRecord ( final List < VcfSample > samples , final VcfRecord record , final PrintWriter writer ) { checkNotNull ( samples ) ; checkNotNull ( record ) ; checkNotNull ( writer ) ; StringBuilder sb = new StringBuilder ( ) ; sb . append ( record . getChrom ( ) ) ; sb . append ( "\t" ) ; sb . append ( record . getPos ( ) ) ; sb . append ( "\t" ) ; if ( record . getId ( ) . length == 0 ) { sb . append ( "." ) ; } else { sb . append ( Joiner . on ( ";" ) . join ( record . getId ( ) ) ) ; } sb . append ( "\t" ) ; sb . append ( record . getRef ( ) ) ; sb . append ( "\t" ) ; sb . append ( Joiner . on ( "," ) . join ( record . getAlt ( ) ) ) ; sb . append ( "\t" ) ; if ( Double . isNaN ( record . getQual ( ) ) ) { sb . append ( "." ) ; } else { sb . append ( ( int ) record . getQual ( ) ) ; } sb . append ( "\t" ) ; sb . append ( Joiner . on ( ";" ) . join ( record . getFilter ( ) ) ) ; sb . append ( "\t" ) ; if ( record . getInfo ( ) . isEmpty ( ) ) { sb . append ( "." ) ; } else { sb . append ( Joiner . on ( ";" ) . withKeyValueSeparator ( "=" ) . join ( record . getInfo ( ) . asMap ( ) ) ) ; } if ( ! samples . isEmpty ( ) ) { sb . append ( "\t" ) ; sb . append ( Joiner . on ( ":" ) . join ( record . getFormat ( ) ) ) ; for ( VcfSample sample : samples ) { sb . append ( "\t" ) ; List < String > values = new ArrayList < String > ( ) ; for ( String formatId : record . getFormat ( ) ) { List < String > fieldValues = record . getGenotypes ( ) . get ( sample . getId ( ) ) . getFields ( ) . get ( formatId ) ; values . add ( fieldValues . isEmpty ( ) ? "." : Joiner . on ( "," ) . join ( fieldValues ) ) ; } sb . append ( Joiner . on ( ":" ) . join ( values ) ) ; } } writer . println ( sb . toString ( ) ) ; } | Write VCF record with the specified print writer . | 586 | 10 |
142,172 | public CharacterSet getInverse ( ) { CharacterSet n = new CharacterSet ( ) ; n . forbiddenCharacters = characters ; n . characters = forbiddenCharacters ; return n ; } | Returns a CharacterSet instance whose allowed and forbidden characters are exactly inverse to this instance . | 37 | 17 |
142,173 | public char getCharacter ( final int index ) { if ( index > characters . length ) { throw new IndexOutOfBoundsException ( index + "@" + characters . length + " does not fit" ) ; } return characters [ index ] ; } | Return the character at index position | 52 | 6 |
142,174 | public static CharacterSet createCharacterSet ( final String encoding , final String goodExpression , final String badExpression , final String characterSetId ) throws UnsupportedEncodingException { if ( characterSets . get ( ) . containsKey ( characterSetId ) ) { LOG . info ( "CharacterSet with id=" + characterSetId + " already created" ) ; return characterSets . get ( ) . get ( characterSetId ) ; } CharacterSet cs = new CharacterSet ( encoding , goodExpression , badExpression , characterSetId ) ; characterSets . get ( ) . put ( characterSetId , cs ) ; LOG . info ( "Added " + cs ) ; return cs ; } | Creates a new CharacterSet . If there is already a CharacterSet with the given ID this will be returned . | 149 | 23 |
142,175 | public static MozuUrl getOptionsUrl ( Integer productTypeId ) { UrlFormatter formatter = new UrlFormatter ( "/api/commerce/catalog/admin/attributedefinition/producttypes/{productTypeId}/Options" ) ; formatter . formatUrl ( "productTypeId" , productTypeId ) ; return new MozuUrl ( formatter . getResourceUrl ( ) , MozuUrl . UrlLocation . TENANT_POD ) ; } | Get Resource Url for GetOptions | 105 | 7 |
142,176 | public static MozuUrl getOptionUrl ( String attributeFQN , Integer productTypeId , String responseFields ) { UrlFormatter formatter = new UrlFormatter ( "/api/commerce/catalog/admin/attributedefinition/producttypes/{productTypeId}/Options/{attributeFQN}?responseFields={responseFields}" ) ; formatter . formatUrl ( "attributeFQN" , attributeFQN ) ; formatter . formatUrl ( "productTypeId" , productTypeId ) ; formatter . formatUrl ( "responseFields" , responseFields ) ; return new MozuUrl ( formatter . getResourceUrl ( ) , MozuUrl . UrlLocation . TENANT_POD ) ; } | Get Resource Url for GetOption | 167 | 7 |
142,177 | public static MozuUrl addOptionUrl ( Integer productTypeId , String responseFields ) { UrlFormatter formatter = new UrlFormatter ( "/api/commerce/catalog/admin/attributedefinition/producttypes/{productTypeId}/Options?responseFields={responseFields}" ) ; formatter . formatUrl ( "productTypeId" , productTypeId ) ; formatter . formatUrl ( "responseFields" , responseFields ) ; return new MozuUrl ( formatter . getResourceUrl ( ) , MozuUrl . UrlLocation . TENANT_POD ) ; } | Get Resource Url for AddOption | 135 | 7 |
142,178 | public static MozuUrl deleteOptionUrl ( String attributeFQN , Integer productTypeId ) { UrlFormatter formatter = new UrlFormatter ( "/api/commerce/catalog/admin/attributedefinition/producttypes/{productTypeId}/Options/{attributeFQN}" ) ; formatter . formatUrl ( "attributeFQN" , attributeFQN ) ; formatter . formatUrl ( "productTypeId" , productTypeId ) ; return new MozuUrl ( formatter . getResourceUrl ( ) , MozuUrl . UrlLocation . TENANT_POD ) ; } | Get Resource Url for DeleteOption | 136 | 7 |
142,179 | public void addToBlacklists ( final Blacklist blacklist ) { if ( null == getBlacklists ( ) ) { setBlacklists ( new java . util . TreeSet < Blacklist > ( ) ) ; } getBlacklists ( ) . add ( blacklist ) ; } | add a blacklist item to the collection of blacklist associated to the application . | 56 | 14 |
142,180 | public String get ( final Object key , final boolean process ) { String value = propsMap . get ( key ) ; if ( process ) { value = processPropertyValue ( value ) ; } return value == null && defaults != null ? defaults . get ( key ) : value ; } | Looks up a property . Recursively checks the defaults if necessary . If the property is found as a system property this value will be used . | 58 | 29 |
142,181 | @ Override public String put ( final String key , final String value ) { return propsMap . put ( key , value ) ; } | Sets the property with the specified key . | 28 | 9 |
142,182 | @ Override public Set < Entry < String , String > > entrySet ( ) { if ( entrySet == null ) { entrySet = new EntrySet ( ) ; } return entrySet ; } | Returns a set of Entries representing property key - value pairs . The returned set is a view to the internal data structures and reflects changes to this instance . Potential defaults are included in the returned set . | 41 | 40 |
142,183 | @ Override public String remove ( final Object key ) { String result = propsMap . remove ( key ) ; if ( defaults != null ) { String s = defaults . remove ( key ) ; if ( result == null ) { result = s ; } } return result ; } | Removes the property with the specified key . Defaults are considered . | 57 | 14 |
142,184 | public void load ( final InputStream is , final String encoding ) throws IOException { load ( new InputStreamReader ( is , encoding ) ) ; } | Loads properties from the specified stream . The caller of this method is responsible for closing the stream . | 31 | 20 |
142,185 | public void store ( final OutputStream os , final String comments , final boolean sorted , final boolean process ) throws IOException { store ( new OutputStreamWriter ( os ) , comments , sorted , process ) ; } | Writes the properties to the specified stream using the default encoding including defaults . | 43 | 15 |
142,186 | public void store ( final Writer writer , final String comments , final boolean sorted , final boolean process ) throws IOException { BufferedWriter bw = writer instanceof BufferedWriter ? ( BufferedWriter ) writer : new BufferedWriter ( writer ) ; if ( comments != null ) { for ( Scanner scanner = new Scanner ( comments ) ; scanner . hasNextLine ( ) ; ) { bw . write ( "#" ) ; bw . write ( scanner . nextLine ( ) ) ; bw . newLine ( ) ; } } bw . write ( "#" + new Date ( ) ) ; bw . newLine ( ) ; Set < String > keys = keySet ( ) ; if ( sorted ) { keys = Sets . newTreeSet ( keys ) ; } for ( String key : keys ) { /* * No need to escape embedded and trailing spaces for value, hence pass false to flag. */ bw . write ( saveConvert ( key , true ) + "=" + saveConvert ( get ( key , process ) , false ) ) ; bw . newLine ( ) ; } bw . flush ( ) ; } | Writes the properties to the specified writer including defaults . | 241 | 11 |
142,187 | public static MozuUrl getExtraValueLocalizedDeltaPriceUrl ( String attributeFQN , String currencyCode , String productCode , String responseFields , String value ) { UrlFormatter formatter = new UrlFormatter ( "/api/commerce/catalog/admin/products/{productCode}/Extras/{attributeFQN}/Values/{value}/localizedDeltaPrice/{currencyCode}?responseFields={responseFields}" ) ; formatter . formatUrl ( "attributeFQN" , attributeFQN ) ; formatter . formatUrl ( "currencyCode" , currencyCode ) ; formatter . formatUrl ( "productCode" , productCode ) ; formatter . formatUrl ( "responseFields" , responseFields ) ; formatter . formatUrl ( "value" , value ) ; return new MozuUrl ( formatter . getResourceUrl ( ) , MozuUrl . UrlLocation . TENANT_POD ) ; } | Get Resource Url for GetExtraValueLocalizedDeltaPrice | 214 | 12 |
142,188 | public static MozuUrl getExtraUrl ( String attributeFQN , String productCode , String responseFields ) { UrlFormatter formatter = new UrlFormatter ( "/api/commerce/catalog/admin/products/{productCode}/Extras/{attributeFQN}?responseFields={responseFields}" ) ; formatter . formatUrl ( "attributeFQN" , attributeFQN ) ; formatter . formatUrl ( "productCode" , productCode ) ; formatter . formatUrl ( "responseFields" , responseFields ) ; return new MozuUrl ( formatter . getResourceUrl ( ) , MozuUrl . UrlLocation . TENANT_POD ) ; } | Get Resource Url for GetExtra | 158 | 7 |
142,189 | public static MozuUrl getCouponSetsUrl ( String filter , Boolean includeCounts , Integer pageSize , String responseFields , String sortBy , Integer startIndex ) { UrlFormatter formatter = new UrlFormatter ( "/api/commerce/catalog/admin/couponsets/?startIndex={startIndex}&pageSize={pageSize}&sortBy={sortBy}&filter={filter}&includeCounts={includeCounts}&responseFields={responseFields}" ) ; formatter . formatUrl ( "filter" , filter ) ; formatter . formatUrl ( "includeCounts" , includeCounts ) ; 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 ) ; } | Get Resource Url for GetCouponSets | 236 | 11 |
142,190 | public static MozuUrl getCouponSetUrl ( String couponSetCode , Boolean includeCounts , String responseFields ) { UrlFormatter formatter = new UrlFormatter ( "/api/commerce/catalog/admin/couponsets/{couponSetCode}?includeCounts={includeCounts}&responseFields={responseFields}" ) ; formatter . formatUrl ( "couponSetCode" , couponSetCode ) ; formatter . formatUrl ( "includeCounts" , includeCounts ) ; formatter . formatUrl ( "responseFields" , responseFields ) ; return new MozuUrl ( formatter . getResourceUrl ( ) , MozuUrl . UrlLocation . TENANT_POD ) ; } | Get Resource Url for GetCouponSet | 168 | 10 |
142,191 | public static MozuUrl updateCouponSetUrl ( String couponSetCode , String responseFields ) { UrlFormatter formatter = new UrlFormatter ( "/api/commerce/catalog/admin/couponsets/{couponSetCode}?responseFields={responseFields}" ) ; formatter . formatUrl ( "couponSetCode" , couponSetCode ) ; formatter . formatUrl ( "responseFields" , responseFields ) ; return new MozuUrl ( formatter . getResourceUrl ( ) , MozuUrl . UrlLocation . TENANT_POD ) ; } | Get Resource Url for UpdateCouponSet | 137 | 10 |
142,192 | public static MozuUrl updateDocumentListUrl ( String documentListName , String responseFields ) { UrlFormatter formatter = new UrlFormatter ( "/api/content/documentlists/{documentListName}?responseFields={responseFields}" ) ; formatter . formatUrl ( "documentListName" , documentListName ) ; formatter . formatUrl ( "responseFields" , responseFields ) ; return new MozuUrl ( formatter . getResourceUrl ( ) , MozuUrl . UrlLocation . TENANT_POD ) ; } | Get Resource Url for UpdateDocumentList | 124 | 8 |
142,193 | public static MozuUrl deleteDocumentListUrl ( String documentListName ) { UrlFormatter formatter = new UrlFormatter ( "/api/content/documentlists/{documentListName}" ) ; formatter . formatUrl ( "documentListName" , documentListName ) ; return new MozuUrl ( formatter . getResourceUrl ( ) , MozuUrl . UrlLocation . TENANT_POD ) ; } | Get Resource Url for DeleteDocumentList | 93 | 8 |
142,194 | private int s2i ( final byte [ ] bytes ) { int num = 0 ; for ( int i = 0 ; i < 4 ; i ++ ) { num += ( bytes [ i ] & 0xff ) << ( ( 3 - i ) * 8 ) ; } return num ; } | Read four bytes off the provided byte string and return the value as a big endian 32 bit unsigned integer . | 60 | 22 |
142,195 | public FormEntry getFormEntry ( final String entryKey ) { FormEntry entry = entries . get ( entryKey ) ; if ( entry == null ) { entry = addFormEntry ( entryKey , null ) ; } return entry ; } | Returns the FormEntry for the given key . If no FormEntry exists yet for the given key then a new one will be generated if generate == true | 49 | 30 |
142,196 | private void resetValues ( final Constraint constraintContainer ) { log . info ( "Reset " + key + " form data" ) ; for ( FormEntry e : entries . values ( ) ) { e . resetValue ( ) ; } constraintContainer . resetValues ( ) ; } | Calls the reset - method on all FormEntry - objects and the constraint - container . This resets all FormEntry - values to the standard value if there is one and prepares the generator for a new initialization . | 60 | 43 |
142,197 | public static MozuUrl deleteEntityListUrl ( String entityListFullName ) { UrlFormatter formatter = new UrlFormatter ( "/api/platform/entitylists/{entityListFullName}" ) ; formatter . formatUrl ( "entityListFullName" , entityListFullName ) ; return new MozuUrl ( formatter . getResourceUrl ( ) , MozuUrl . UrlLocation . TENANT_POD ) ; } | Get Resource Url for DeleteEntityList | 97 | 8 |
142,198 | public static VcfHeader header ( final File file ) throws IOException { checkNotNull ( file ) ; // could also use Files.asCharSource(file, Charsets.UTF_8).openBufferedStream() try ( BufferedReader reader = new BufferedReader ( new FileReader ( file ) ) ) { return header ( reader ) ; } } | Read the VCF header from the specified file . | 76 | 10 |
142,199 | public static VcfHeader header ( final URL url ) throws IOException { checkNotNull ( url ) ; try ( BufferedReader reader = Resources . asCharSource ( url , Charsets . UTF_8 ) . openBufferedStream ( ) ) { return header ( reader ) ; } } | Read the VCF header from the specified URL . | 62 | 10 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.