idx int64 0 41.2k | question stringlengths 83 4.15k | target stringlengths 5 715 |
|---|---|---|
18,900 | public static < C extends Comparable > Ordering < Range < C > > orderingByLowerEndpoint ( ) { return new Ordering < Range < C > > ( ) { public int compare ( final Range < C > left , final Range < C > right ) { return ComparisonChain . start ( ) . compare ( left . hasLowerBound ( ) , right . hasLowerBound ( ) ) . compar... | Return an ordering by lower endpoint over ranges . |
18,901 | public static < C extends Comparable > Ordering < Range < C > > reverseOrderingByLowerEndpoint ( ) { Ordering < Range < C > > orderingByLowerEndpoint = orderingByLowerEndpoint ( ) ; return orderingByLowerEndpoint . reverse ( ) ; } | Return a reverse ordering by lower endpoint over ranges . |
18,902 | public static < C extends Comparable > Ordering < Range < C > > orderingByUpperEndpoint ( ) { return new Ordering < Range < C > > ( ) { public int compare ( final Range < C > left , final Range < C > right ) { return ComparisonChain . start ( ) . compare ( left . hasUpperBound ( ) , right . hasUpperBound ( ) ) . compar... | Return an ordering by upper endpoint over ranges . |
18,903 | public static < C extends Comparable > Ordering < Range < C > > reverseOrderingByUpperEndpoint ( ) { Ordering < Range < C > > orderingByUpperEndpoint = orderingByUpperEndpoint ( ) ; return orderingByUpperEndpoint . reverse ( ) ; } | Return a reverse ordering by upper endpoint over ranges . |
18,904 | public static MozuUrl getCurrencyExchangeRatesUrl ( ) { UrlFormatter formatter = new UrlFormatter ( "/api/commerce/catalog/storefront/currencies/exchangerates" ) ; return new MozuUrl ( formatter . getResourceUrl ( ) , MozuUrl . UrlLocation . TENANT_POD ) ; } | Get Resource Url for GetCurrencyExchangeRates |
18,905 | public void extractFromArchive ( final File targetFile , final boolean forceOverwrite ) throws IOException { if ( zipArchive != null ) { ZipEntry entry = zipArchive . getEntry ( targetFile . getName ( ) ) ; if ( entry != null ) { if ( ! targetFile . exists ( ) ) { try { targetFile . createNewFile ( ) ; } catch ( IOExce... | Extracts the specified file from this configuration s zip file if applicable . |
18,906 | public static MozuUrl getDestinationUrl ( String checkoutId , String destinationId , String responseFields ) { UrlFormatter formatter = new UrlFormatter ( "/api/commerce/checkouts/{checkoutId}/destinations/{destinationId}?responseFields={responseFields}" ) ; formatter . formatUrl ( "checkoutId" , checkoutId ) ; formatt... | Get Resource Url for GetDestination |
18,907 | public static MozuUrl addDestinationUrl ( String checkoutId , String responseFields ) { UrlFormatter formatter = new UrlFormatter ( "/api/commerce/checkouts/{checkoutId}/destinations?responseFields={responseFields}" ) ; formatter . formatUrl ( "checkoutId" , checkoutId ) ; formatter . formatUrl ( "responseFields" , res... | Get Resource Url for AddDestination |
18,908 | public static MozuUrl removeDestinationUrl ( String checkoutId , String destinationId ) { UrlFormatter formatter = new UrlFormatter ( "/api/commerce/checkouts/{checkoutId}/destinations/{destinationId}" ) ; formatter . formatUrl ( "checkoutId" , checkoutId ) ; formatter . formatUrl ( "destinationId" , destinationId ) ; ... | Get Resource Url for RemoveDestination |
18,909 | public static Iterable < VcfSample > samples ( final Readable readable ) throws IOException { checkNotNull ( readable ) ; ParseListener parseListener = new ParseListener ( ) ; VcfParser . parse ( readable , parseListener ) ; return parseListener . getSamples ( ) . values ( ) ; } | Read zero or more VCF samples from the specified readable . |
18,910 | private String chooseAlternations ( final String expression ) { StrBuilder sb = new StrBuilder ( expression ) ; int i = 0 ; while ( UNESCAPED_PIPE_PATTERN . matcher ( sb . toString ( ) ) . find ( ) ) { for ( ; i < sb . length ( ) ; ++ i ) { if ( sb . charAt ( i ) == '|' ) { if ( sb . charAt ( i - 1 ) == '\\' ) { contin... | Resolves alternations by randomly choosing one at a time and adapting the pattern accordingly |
18,911 | public String negateString ( final String input , int bad ) { int length = input . length ( ) ; Range [ ] ranges = getRanges ( ) ; int [ ] lengths = new int [ ranges . length ] ; for ( int i = 0 ; i < lengths . length ; i ++ ) { Range r = ranges [ i ] ; lengths [ i ] = r . getMin ( ) ; length -= r . getMin ( ) ; } int ... | Replaces randomly selected characters in the given string with forbidden characters according to the given expression . |
18,912 | public Range [ ] getRanges ( ) { Range [ ] ranges = new Range [ nodes . size ( ) ] ; for ( int i = 0 ; i < ranges . length ; i ++ ) { ranges [ i ] = nodes . get ( i ) . getRange ( ) ; } return ranges ; } | As the regular expression was distributed in separate node every node has its own range . This method returns an array containing all range objects . |
18,913 | public String generate ( final int [ ] nodeSizes , final int bad ) { buf . setLength ( 0 ) ; for ( int i = 0 ; i < nodes . size ( ) && i < nodeSizes . length ; i ++ ) { buf . append ( nodes . get ( i ) . getCharacters ( nodeSizes [ i ] , bad ) ) ; } String value = buf . toString ( ) ; buf . setLength ( 0 ) ; return val... | Generates a string containing subject to the parameter value only allowed or one half of forbidden characters . |
18,914 | public String generate ( final int bad ) { int [ ] sizes = new int [ nodes . size ( ) ] ; for ( int i = 0 ; i < sizes . length ; i ++ ) { Range r = nodes . get ( i ) . getRange ( ) ; sizes [ i ] = r . getMin ( ) + r . getRange ( ) / 2 ; } return generate ( sizes , bad ) ; } | Returns a string whose length is always exactly in the middle of the allowed range |
18,915 | public String generate ( int total , final int bad ) { if ( total < 0 ) { if ( log . isDebugEnabled ( ) ) { log . debug ( "Character string cannot have a negative length!" ) ; } total = 0 ; } Range [ ] ranges = getRanges ( ) ; int [ ] lengths = new int [ ranges . length ] ; int length = 0 ; for ( int i = 0 ; i < ranges... | Generates a string with the given length . Thereby the mandatory length will be reached first and then the separate areas are filled with the remaining characters randlomly . |
18,916 | private static int intFromSubArray ( final byte [ ] bytes , final int from , final int to ) { final byte [ ] subBytes = Arrays . copyOfRange ( bytes , from , to ) ; final ByteBuffer wrap = ByteBuffer . wrap ( subBytes ) ; return wrap . getInt ( ) ; } | Take a slice of an array of bytes and interpret it as an int . |
18,917 | void startArchiving ( ) { if ( isArchivingDisabled ( ) ) { return ; } String archiveName = configuration . get ( JFunkConstants . ARCHIVE_FILE ) ; if ( StringUtils . isBlank ( archiveName ) ) { archiveName = String . format ( DIR_PATTERN , moduleMetaData . getModuleName ( ) , Thread . currentThread ( ) . getName ( ) , ... | Starts archiving of the specified module if archiving is enabled . |
18,918 | public String initValuesImpl ( final FieldCase ca ) { if ( ca == FieldCase . NULL || ca == FieldCase . BLANK ) { return null ; } if ( ca != null || last && constraint . hasNextCase ( ) || generator . isIgnoreOptionalConstraints ( ) ) { return constraint . initValues ( ca ) ; } if ( choice . isNext ( ) ) { last = true ;... | Returns either null or a value . If null is returned the embedded constraint is initialized with FieldCase . NULL . If a value is returned the embedded constraint is initialized with the FieldCase whose value is returned . If the latest value was not not null the next value will be generated if in the case that the emb... |
18,919 | public static String spacesOptional ( final String input ) { String output ; output = input . replaceAll ( "\\s" , "\\\\s?" ) ; return output ; } | Replaces a space with the regular expression \\ s? |
18,920 | public static MozuUrl getDiscountSettingsUrl ( Integer catalogId , String responseFields ) { UrlFormatter formatter = new UrlFormatter ( "/api/commerce/catalog/admin/discountsettings/{catalogId}?responseFields={responseFields}" ) ; formatter . formatUrl ( "catalogId" , catalogId ) ; formatter . formatUrl ( "responseFie... | Get Resource Url for GetDiscountSettings |
18,921 | public static Hml read ( final File file ) throws IOException { checkNotNull ( file ) ; try ( BufferedReader reader = new BufferedReader ( new FileReader ( file ) ) ) { return read ( reader ) ; } } | Read HML from the specified file . |
18,922 | byte [ ] readSignResponse ( ) throws IOException { final byte [ ] headerBytes = readBytes ( 9 , "SSH2_AGENT_SIGN_RESPONSE" ) ; log . debug ( "Received SSH2_AGENT_SIGN_RESPONSE message from ssh-agent." ) ; final SignResponseHeaders headers = SignResponseHeaders . from ( headerBytes ) ; final byte [ ] bytes = readBytes (... | Return an array of bytes from the ssh - agent representing data signed by a private SSH key . |
18,923 | public static MozuUrl getTaxableTerritoriesUrl ( ) { UrlFormatter formatter = new UrlFormatter ( "/api/commerce/settings/general/taxableterritories" ) ; return new MozuUrl ( formatter . getResourceUrl ( ) , MozuUrl . UrlLocation . TENANT_POD ) ; } | Get Resource Url for GetTaxableTerritories |
18,924 | public static MozuUrl updateTaxableTerritoriesUrl ( ) { UrlFormatter formatter = new UrlFormatter ( "/api/commerce/settings/general/taxableterritories" ) ; return new MozuUrl ( formatter . getResourceUrl ( ) , MozuUrl . UrlLocation . TENANT_POD ) ; } | Get Resource Url for UpdateTaxableTerritories |
18,925 | public static Iterable < VcfRecord > records ( final Readable readable ) throws IOException { checkNotNull ( readable ) ; ParseListener parseListener = new ParseListener ( ) ; VcfParser . parse ( readable , parseListener ) ; return parseListener . getRecords ( ) ; } | Read zero or more VCF records from the specified readable . |
18,926 | public Constraint createModel ( final MathRandom random , final Element element ) { if ( element == null ) { return null ; } Class < ? extends Constraint > classObject = null ; Constraint object = null ; try { classObject = getClassObject ( element ) ; Constructor < ? extends Constraint > constructor = getConstructor (... | Generates an instance based on the data in the given object . The object s class will be determined by the class attribute of the element . IF the element contains an id attribute the generated instance is stored in a map using this id as key . |
18,927 | public Constraint getModel ( final Element element ) throws IdNotFoundException { Attribute attr = element . getAttribute ( XMLTags . ID ) ; if ( attr == null ) { throw new IdNotFoundException ( null ) ; } Constraint c = null ; final String id = attr . getValue ( ) ; try { c = getModel ( id ) ; } catch ( IdNotFoundExce... | Returns the constraint to the associated id attribute value of the passed element . To achieve this the id attribute of the passed element is searched first . If there is none an IdNotFoundException will be thrown . Then the constraint stored under the respective key is returned from the internal table . If this constr... |
18,928 | public Constraint getModel ( final String id ) throws IdNotFoundException { Constraint e = map . get ( id ) ; if ( e == null ) { throw new IdNotFoundException ( id ) ; } return e ; } | Returns the object in the map with the key id |
18,929 | private Class < ? extends Constraint > getClassObject ( final Element element ) throws ClassNotFoundException { String className = element . getAttributeValue ( XMLTags . CLASS ) ; className = className . indexOf ( '.' ) > 0 ? className : getClass ( ) . getPackage ( ) . getName ( ) + '.' + className ; return Class . fo... | This method returns the class object of which a new instance shall be generated . To achieve this the class attribute of the passed element will be used to determine the class name |
18,930 | private Constructor < ? extends Constraint > getConstructor ( final Class < ? extends Constraint > classObject ) throws NoSuchMethodException { return classObject . getConstructor ( new Class [ ] { MathRandom . class , Element . class , Generator . class } ) ; } | Searches for the matching constraint constructor with the parameter types MathRandom Element and Generator . |
18,931 | private Constraint getObject ( final MathRandom random , final Element element , final Constructor < ? extends Constraint > constructor ) throws IllegalArgumentException , InstantiationException , IllegalAccessException , InvocationTargetException { LOG . debug ( "Creating constraint: " + element . getAttributes ( ) ) ... | Generates a new constraint instance using the given constructor the element and the generateor callback as parameters . |
18,932 | private void putToCache ( final Element element , final Constraint object ) { String id = element . getAttributeValue ( XMLTags . ID ) ; if ( id != null && id . length ( ) > 0 ) { Constraint old = putToCache ( id , object ) ; if ( old != null ) { LOG . warn ( "The id=" + id + " for object of type=" + old . getClass ( )... | If the element has an attribute with name id this attribute s value will be used as key to store the just generated object in a map . The object can in this case also be retrieved using this id . |
18,933 | private Constraint putToCache ( final String id , final Constraint object ) { Constraint c = this . map . put ( id , object ) ; if ( c instanceof DummyConstraint ) { ( ( DummyConstraint ) c ) . constraint = object ; return null ; } return c ; } | Puts the given constraint object into the cache using the key id . If an existing DummyConstraint object is found in the table the reference will be set to the constraint and the constraint will not be put into the table . |
18,934 | public static Analysis readAnalysis ( final Reader reader ) throws IOException { checkNotNull ( reader ) ; try { JAXBContext context = JAXBContext . newInstance ( Analysis . class ) ; Unmarshaller unmarshaller = context . createUnmarshaller ( ) ; SchemaFactory schemaFactory = SchemaFactory . newInstance ( XMLConstants ... | Read an analysis from the specified reader . |
18,935 | public static Analysis readAnalysis ( final File file ) throws IOException { checkNotNull ( file ) ; try ( BufferedReader reader = new BufferedReader ( new FileReader ( file ) ) ) { return readAnalysis ( reader ) ; } } | Read an analysis from the specified file . |
18,936 | public static Analysis readAnalysis ( final URL url ) throws IOException { checkNotNull ( url ) ; try ( BufferedReader reader = Resources . asCharSource ( url , Charsets . UTF_8 ) . openBufferedStream ( ) ) { return readAnalysis ( reader ) ; } } | Read an analysis from the specified URL . |
18,937 | public static Analysis readAnalysis ( final InputStream inputStream ) throws IOException { checkNotNull ( inputStream ) ; try ( BufferedReader reader = new BufferedReader ( new InputStreamReader ( inputStream ) ) ) { return readAnalysis ( reader ) ; } } | Read an analysis from the specified input stream . |
18,938 | public static Experiment readExperiment ( final File file ) throws IOException { checkNotNull ( file ) ; try ( BufferedReader reader = new BufferedReader ( new FileReader ( file ) ) ) { return readExperiment ( reader ) ; } } | Read an experiment from the specified file . |
18,939 | public static Experiment readExperiment ( final URL url ) throws IOException { checkNotNull ( url ) ; try ( BufferedReader reader = Resources . asCharSource ( url , Charsets . UTF_8 ) . openBufferedStream ( ) ) { return readExperiment ( reader ) ; } } | Read an experiment from the specified URL . |
18,940 | public static Experiment readExperiment ( final InputStream inputStream ) throws IOException { checkNotNull ( inputStream ) ; try ( BufferedReader reader = new BufferedReader ( new InputStreamReader ( inputStream ) ) ) { return readExperiment ( reader ) ; } } | Read an experiment from the specified input stream . |
18,941 | public static RunSet readRunSet ( final File file ) throws IOException { checkNotNull ( file ) ; try ( BufferedReader reader = new BufferedReader ( new FileReader ( file ) ) ) { return readRunSet ( reader ) ; } } | Read a run set from the specified file . |
18,942 | public static RunSet readRunSet ( final URL url ) throws IOException { checkNotNull ( url ) ; try ( BufferedReader reader = Resources . asCharSource ( url , Charsets . UTF_8 ) . openBufferedStream ( ) ) { return readRunSet ( reader ) ; } } | Read a run set from the specified URL . |
18,943 | public static RunSet readRunSet ( final InputStream inputStream ) throws IOException { checkNotNull ( inputStream ) ; try ( BufferedReader reader = new BufferedReader ( new InputStreamReader ( inputStream ) ) ) { return readRunSet ( reader ) ; } } | Read a run set from the specified input stream . |
18,944 | public static Sample readSample ( final File file ) throws IOException { checkNotNull ( file ) ; try ( BufferedReader reader = new BufferedReader ( new FileReader ( file ) ) ) { return readSample ( reader ) ; } } | Read a sample from the specified file . |
18,945 | public static Sample readSample ( final URL url ) throws IOException { checkNotNull ( url ) ; try ( BufferedReader reader = Resources . asCharSource ( url , Charsets . UTF_8 ) . openBufferedStream ( ) ) { return readSample ( reader ) ; } } | Read a sample from the specified URL . |
18,946 | public static Sample readSample ( final InputStream inputStream ) throws IOException { checkNotNull ( inputStream ) ; try ( BufferedReader reader = new BufferedReader ( new InputStreamReader ( inputStream ) ) ) { return readSample ( reader ) ; } } | Read a sample from the specified input stream . |
18,947 | public static Study readStudy ( final File file ) throws IOException { checkNotNull ( file ) ; try ( BufferedReader reader = new BufferedReader ( new FileReader ( file ) ) ) { return readStudy ( reader ) ; } } | Read a study from the specified file . |
18,948 | public static Study readStudy ( final URL url ) throws IOException { checkNotNull ( url ) ; try ( BufferedReader reader = Resources . asCharSource ( url , Charsets . UTF_8 ) . openBufferedStream ( ) ) { return readStudy ( reader ) ; } } | Read a study from the specified URL . |
18,949 | public static Study readStudy ( final InputStream inputStream ) throws IOException { checkNotNull ( inputStream ) ; try ( BufferedReader reader = new BufferedReader ( new InputStreamReader ( inputStream ) ) ) { return readStudy ( reader ) ; } } | Read a study from the specified input stream . |
18,950 | public static Submission readSubmission ( final File file ) throws IOException { checkNotNull ( file ) ; try ( BufferedReader reader = new BufferedReader ( new FileReader ( file ) ) ) { return readSubmission ( reader ) ; } } | Read a submission from the specified file . |
18,951 | public static Submission readSubmission ( final URL url ) throws IOException { checkNotNull ( url ) ; try ( BufferedReader reader = Resources . asCharSource ( url , Charsets . UTF_8 ) . openBufferedStream ( ) ) { return readSubmission ( reader ) ; } } | Read a submission from the specified URL . |
18,952 | public static Submission readSubmission ( final InputStream inputStream ) throws IOException { checkNotNull ( inputStream ) ; try ( BufferedReader reader = new BufferedReader ( new InputStreamReader ( inputStream ) ) ) { return readSubmission ( reader ) ; } } | Read a submission from the specified input stream . |
18,953 | protected < T > T getScopedObject ( final Key < T > key , final Provider < T > unscoped , final Map < Key < ? > , Object > scopeMap ) { @ SuppressWarnings ( "unchecked" ) T value = ( T ) scopeMap . get ( key ) ; if ( value == null ) { value = unscoped . get ( ) ; scopeMap . put ( key , value ) ; } return value ; } | If already present gets the object for the specified key from the scope map . Otherwise it is retrieved from the unscoped provider and stored in the scope map . |
18,954 | public static MozuUrl refreshUserAuthTicketUrl ( String refreshToken , String responseFields ) { UrlFormatter formatter = new UrlFormatter ( "/api/commerce/customer/authtickets/refresh?refreshToken={refreshToken}&responseFields={responseFields}" ) ; formatter . formatUrl ( "refreshToken" , refreshToken ) ; formatter . ... | Get Resource Url for RefreshUserAuthTicket |
18,955 | public static MozuUrl createUserAuthTicketUrl ( String responseFields , Integer tenantId ) { UrlFormatter formatter = new UrlFormatter ( "/api/platform/adminuser/authtickets/tenants?tenantId={tenantId}&responseFields={responseFields}" ) ; formatter . formatUrl ( "responseFields" , responseFields ) ; formatter . formatU... | Get Resource Url for CreateUserAuthTicket |
18,956 | public static MozuUrl deleteUserAuthTicketUrl ( String refreshToken ) { UrlFormatter formatter = new UrlFormatter ( "/api/platform/adminuser/authtickets/?refreshToken={refreshToken}" ) ; formatter . formatUrl ( "refreshToken" , refreshToken ) ; return new MozuUrl ( formatter . getResourceUrl ( ) , MozuUrl . UrlLocation... | Get Resource Url for DeleteUserAuthTicket |
18,957 | public static Iterable < BedRecord > read ( final Readable readable ) throws IOException { checkNotNull ( readable ) ; Collect collect = new Collect ( ) ; stream ( readable , collect ) ; return collect . records ( ) ; } | Read zero or more BED records from the specified readable . |
18,958 | public static void stream ( final Readable readable , final BedListener listener ) throws IOException { checkNotNull ( readable ) ; checkNotNull ( listener ) ; BedLineProcessor lineProcessor = new BedLineProcessor ( listener ) ; CharStreams . readLines ( readable , lineProcessor ) ; } | Stream zero or more BED records from the specified readable . |
18,959 | public void copy ( final File source ) throws IOException { if ( ! source . exists ( ) ) { LOG . warn ( "File " + source + " cannot be copied as it does not exist" ) ; return ; } if ( equals ( source ) ) { LOG . info ( "Skipping copying of " + source + " as it matches the target" ) ; return ; } File target = isDirector... | Copies the specified file . If this object is a directory the file will be copied to this directory . If this object represents a file it will be overwritten with the specified file . |
18,960 | public void zip ( final File zipFile ) throws IOException { File [ ] files = listFiles ( ) ; if ( files . length == 0 ) { return ; } LOG . info ( "Creating zip file " + zipFile + " from directory " + this ) ; ZipOutputStream zipOut = null ; try { zipOut = new ZipOutputStream ( new FileOutputStream ( zipFile ) ) ; for (... | Zips all included objects into the specified file . |
18,961 | public static Module loadModulesFromProperties ( final Module jFunkModule , final String propertiesFile ) throws ClassNotFoundException , InstantiationException , IllegalAccessException , IOException { final List < Module > modules = Lists . newArrayList ( ) ; LOG . debug ( "Using jfunk.props.file=" + propertiesFile ) ... | Loads Guice modules whose class names are specified as properties . All properties starting with module . are considered to have a fully qualified class name representing a Guice module . The modules are combined and override thespecified jFunkModule . |
18,962 | public Range merge ( final Range otherRange ) { int newMin = Math . min ( otherRange . min , min ) ; int newMax = Math . max ( otherRange . max , max ) ; return new Range ( newMin , newMax ) ; } | Merges this range with the passed range . Returns a range object whose min and max values match the minimum or maximum of the two values respectively . So the range returned contains this and the passed range in any case . |
18,963 | public Range sumBoundaries ( final Range plus ) { int newMin = min + plus . min ; int newMax = max == RANGE_MAX || plus . max == RANGE_MAX ? RANGE_MAX : max + plus . max ; return new Range ( newMin , newMax ) ; } | Sums the boundaries of this range with the ones of the passed . So the returned range has this . min + plus . min as minimum and this . max + plus . max as maximum respectively . |
18,964 | public Range intersect ( final Range outerRange ) throws RangeException { if ( min > outerRange . max ) { throw new IllegalArgumentException ( "range maximum must be greater or equal than " + min ) ; } if ( max < outerRange . min ) { throw new IllegalArgumentException ( "range minimum must be less or equal than " + max... | Intersects this range with the one passed . This means that the returned rand contains the maximum of both minima as minimum and the minimum of the two maxima as maximum . |
18,965 | public List < Integer > listValues ( ) { ArrayList < Integer > list = new ArrayList < Integer > ( getRange ( ) ) ; for ( int i = getMin ( ) ; i <= getMax ( ) ; i ++ ) { list . add ( i ) ; } return list ; } | Returns a list of all allowed values within the range |
18,966 | public static MozuUrl getCartItemUrl ( String cartItemId , String responseFields ) { UrlFormatter formatter = new UrlFormatter ( "/api/commerce/carts/current/items/{cartItemId}?responseFields={responseFields}" ) ; formatter . formatUrl ( "cartItemId" , cartItemId ) ; formatter . formatUrl ( "responseFields" , responseF... | Get Resource Url for GetCartItem |
18,967 | public static MozuUrl addItemsToCartUrl ( Boolean throwErrorOnInvalidItems ) { UrlFormatter formatter = new UrlFormatter ( "/api/commerce/carts/current/bulkitems?throwErrorOnInvalidItems={throwErrorOnInvalidItems}" ) ; formatter . formatUrl ( "throwErrorOnInvalidItems" , throwErrorOnInvalidItems ) ; return new MozuUrl ... | Get Resource Url for AddItemsToCart |
18,968 | public static MozuUrl updateCartItemQuantityUrl ( String cartItemId , Integer quantity , String responseFields ) { UrlFormatter formatter = new UrlFormatter ( "/api/commerce/carts/current/items/{cartItemId}/{quantity}?responseFields={responseFields}" ) ; formatter . formatUrl ( "cartItemId" , cartItemId ) ; formatter .... | Get Resource Url for UpdateCartItemQuantity |
18,969 | public static MozuUrl removeAllCartItemsUrl ( ) { UrlFormatter formatter = new UrlFormatter ( "/api/commerce/carts/current/items" ) ; return new MozuUrl ( formatter . getResourceUrl ( ) , MozuUrl . UrlLocation . TENANT_POD ) ; } | Get Resource Url for RemoveAllCartItems |
18,970 | public static MozuUrl deleteCartItemUrl ( String cartItemId ) { UrlFormatter formatter = new UrlFormatter ( "/api/commerce/carts/current/items/{cartItemId}" ) ; formatter . formatUrl ( "cartItemId" , cartItemId ) ; return new MozuUrl ( formatter . getResourceUrl ( ) , MozuUrl . UrlLocation . TENANT_POD ) ; } | Get Resource Url for DeleteCartItem |
18,971 | public static MozuUrl processDigitalWalletUrl ( String checkoutId , String digitalWalletType , String responseFields ) { UrlFormatter formatter = new UrlFormatter ( "/api/commerce/checkouts/{checkoutId}/digitalWallet/{digitalWalletType}?responseFields={responseFields}" ) ; formatter . formatUrl ( "checkoutId" , checkou... | Get Resource Url for ProcessDigitalWallet |
18,972 | public static VcfHeader header ( final Readable readable ) throws IOException { checkNotNull ( readable ) ; ParseListener parseListener = new ParseListener ( ) ; VcfParser . parse ( readable , parseListener ) ; return parseListener . getHeader ( ) ; } | Read the VCF header from the specified readable . |
18,973 | protected String initValuesImpl ( final FieldCase ca ) { if ( ca == FieldCase . NULL || ca == FieldCase . BLANK ) { return null ; } return field . getString ( control . getNext ( ca ) ) ; } | Returns a string whose length and character type reflect the passed FieldCase using the embedded field object . If FieldCase . NULL or FieldCase . BLANK is passed the method returns null . |
18,974 | public static MozuUrl validateTargetRuleUrl ( ) { UrlFormatter formatter = new UrlFormatter ( "/api/commerce/targetrules/validate" ) ; return new MozuUrl ( formatter . getResourceUrl ( ) , MozuUrl . UrlLocation . TENANT_POD ) ; } | Get Resource Url for ValidateTargetRule |
18,975 | public static String formatLatitude ( final Latitude latitude , final PointLocationFormatType formatType ) throws FormatterException { if ( latitude == null ) { throw new FormatterException ( "No point location provided" ) ; } if ( formatType == null ) { throw new FormatterException ( "No format type provided" ) ; } fi... | Formats a latitude as an ISO 6709 string . |
18,976 | public static String formatLongitude ( final Longitude longitude , final PointLocationFormatType formatType ) throws FormatterException { if ( longitude == null ) { throw new FormatterException ( "No point location provided" ) ; } if ( formatType == null ) { throw new FormatterException ( "No format type provided" ) ; ... | Formats a longitude as an ISO 6709 string . |
18,977 | public static String formatPointLocation ( final PointLocation pointLocation , final PointLocationFormatType formatType ) throws FormatterException { if ( pointLocation == null ) { throw new FormatterException ( "No point location provided" ) ; } if ( formatType == null ) { throw new FormatterException ( "No format typ... | Formats a point location as an ISO 6709 or human readable string . |
18,978 | private static String formatISO6709WithDecimals ( final PointLocation pointLocation ) { final Latitude latitude = pointLocation . getLatitude ( ) ; final Longitude longitude = pointLocation . getLongitude ( ) ; String string = formatLatitudeWithDecimals ( latitude ) + formatLongitudeWithDecimals ( longitude ) ; final d... | Formats a point location as an ISO 6709 string using decimals . |
18,979 | private int [ ] sexagesimalSplit ( final double value ) { final double absValue = Math . abs ( value ) ; int units ; int minutes ; int seconds ; final int sign = value < 0 ? - 1 : 1 ; units = ( int ) Math . floor ( absValue ) ; seconds = ( int ) Math . round ( ( absValue - units ) * 3600D ) ; minutes = seconds / 60 ; i... | Splits a double value into it s sexagesimal parts . Each part has the same sign as the provided value . |
18,980 | public static < N extends Number & Comparable < ? super N > > Point singleton ( final N value ) { checkNotNull ( value ) ; return Geometries . point ( value . doubleValue ( ) , 0.5d ) ; } | Create and return a new point geometry from the specified singleton value . |
18,981 | public static < N extends Number & Comparable < ? super N > > Rectangle range ( final Range < N > range ) { checkNotNull ( range ) ; if ( range . isEmpty ( ) ) { throw new IllegalArgumentException ( "range must not be empty" ) ; } if ( ! range . hasLowerBound ( ) || ! range . hasUpperBound ( ) ) { throw new IllegalArgu... | Create and return a new rectangle geometry from the specified range . |
18,982 | static boolean isLeft ( final Fastq fastq ) { checkNotNull ( fastq ) ; return LEFT . matcher ( fastq . getDescription ( ) ) . matches ( ) ; } | Return true if the specified fastq is the left or first read of a paired end read . |
18,983 | static boolean isRight ( final Fastq fastq ) { checkNotNull ( fastq ) ; return RIGHT . matcher ( fastq . getDescription ( ) ) . matches ( ) ; } | Return true if the specified fastq is the right or second read of a paired end read . |
18,984 | static String prefix ( final Fastq fastq ) { checkNotNull ( fastq ) ; Matcher m = PREFIX . matcher ( fastq . getDescription ( ) ) ; if ( ! m . matches ( ) ) { throw new PairedEndFastqReaderException ( "could not parse prefix from description " + fastq . getDescription ( ) ) ; } return m . group ( 1 ) ; } | Return the prefix of the paired end read name of the specified fastq . |
18,985 | public static GapPenalties create ( final int match , final int replace , final int insert , final int delete , final int extend ) { return new GapPenalties ( ( short ) match , ( short ) replace , ( short ) insert , ( short ) delete , ( short ) extend ) ; } | Create and return a new gap penalties with the specified penalties . |
18,986 | public static MozuUrl getAvailablePickupFulfillmentActionsUrl ( String orderId , String pickupId ) { UrlFormatter formatter = new UrlFormatter ( "/api/commerce/orders/{orderId}/pickups/{pickupId}/actions" ) ; formatter . formatUrl ( "orderId" , orderId ) ; formatter . formatUrl ( "pickupId" , pickupId ) ; return new Mo... | Get Resource Url for GetAvailablePickupFulfillmentActions |
18,987 | public static MozuUrl getPickupUrl ( String orderId , String pickupId , String responseFields ) { UrlFormatter formatter = new UrlFormatter ( "/api/commerce/orders/{orderId}/pickups/{pickupId}?responseFields={responseFields}" ) ; formatter . formatUrl ( "orderId" , orderId ) ; formatter . formatUrl ( "pickupId" , picku... | Get Resource Url for GetPickup |
18,988 | public void setParameter ( final String name , final String filename , final InputStream is ) throws IOException { boundary ( ) ; writeName ( name ) ; write ( "; filename=\"" ) ; write ( filename ) ; write ( '"' ) ; newline ( ) ; write ( "Content-Type: " ) ; String type = URLConnection . guessContentTypeFromName ( file... | Adds a file parameter to the request |
18,989 | public static MozuUrl getTransactionsUrl ( Integer accountId ) { UrlFormatter formatter = new UrlFormatter ( "/api/commerce/customer/accounts/{accountId}/transactions" ) ; formatter . formatUrl ( "accountId" , accountId ) ; return new MozuUrl ( formatter . getResourceUrl ( ) , MozuUrl . UrlLocation . TENANT_POD ) ; } | Get Resource Url for GetTransactions |
18,990 | public static MozuUrl removeTransactionUrl ( Integer accountId , String transactionId ) { UrlFormatter formatter = new UrlFormatter ( "/api/commerce/customer/accounts/{accountId}/transactions/{transactionId}" ) ; formatter . formatUrl ( "accountId" , accountId ) ; formatter . formatUrl ( "transactionId" , transactionId... | Get Resource Url for RemoveTransaction |
18,991 | public void send ( final Message msg ) throws MailException { Transport transport = null ; try { if ( log . isDebugEnabled ( ) ) { log . debug ( "Sending mail message [subject={}, recipients={}]" , msg . getSubject ( ) , on ( ", " ) . join ( msg . getAllRecipients ( ) ) ) ; } transport = sessionProvider . get ( ) . get... | Sends the specified message . |
18,992 | public static MozuUrl getQuoteByNameUrl ( Integer customerAccountId , String quoteName , String responseFields ) { UrlFormatter formatter = new UrlFormatter ( "/api/commerce/quotes/customers/{customerAccountId}/{quoteName}?responseFields={responseFields}" ) ; formatter . formatUrl ( "customerAccountId" , customerAccoun... | Get Resource Url for GetQuoteByName |
18,993 | public static MozuUrl deleteQuoteUrl ( String quoteId ) { UrlFormatter formatter = new UrlFormatter ( "/api/commerce/quotes/{quoteId}" ) ; formatter . formatUrl ( "quoteId" , quoteId ) ; return new MozuUrl ( formatter . getResourceUrl ( ) , MozuUrl . UrlLocation . TENANT_POD ) ; } | Get Resource Url for DeleteQuote |
18,994 | public static MozuUrl getDBValueUrl ( String dbEntryQuery , String responseFields ) { UrlFormatter formatter = new UrlFormatter ( "/api/platform/tenantdata/{dbEntryQuery}?responseFields={responseFields}" ) ; formatter . formatUrl ( "dbEntryQuery" , dbEntryQuery ) ; formatter . formatUrl ( "responseFields" , responseFie... | Get Resource Url for GetDBValue |
18,995 | public static MozuUrl createDBValueUrl ( String dbEntryQuery ) { UrlFormatter formatter = new UrlFormatter ( "/api/platform/tenantdata/{dbEntryQuery}" ) ; formatter . formatUrl ( "dbEntryQuery" , dbEntryQuery ) ; return new MozuUrl ( formatter . getResourceUrl ( ) , MozuUrl . UrlLocation . TENANT_POD ) ; } | Get Resource Url for CreateDBValue |
18,996 | public static List < String > normalizeTagsForUpload ( List < String > list ) { if ( isNullOrEmpty ( list ) ) { return null ; } List < String > tmp = new ArrayList < String > ( ) ; for ( String s : list ) { if ( s . contains ( " " ) ) { tmp . add ( "\"" + s + "\"" ) ; } else { tmp . add ( s ) ; } } return tmp ; } | Normalize tags for uploads . |
18,997 | public static Integer memberTypeToMemberTypeId ( JinxConstants . MemberType memberType ) { if ( memberType == null ) { return null ; } Integer type ; switch ( memberType ) { case narwhal : type = 1 ; break ; case member : type = 2 ; break ; case moderator : type = 3 ; break ; case admin : type = 4 ; break ; default : t... | Convert a MemberType enum to the numeric Flickr member type id . |
18,998 | public static JinxConstants . MemberType typeIdToMemberType ( Integer typeId ) { if ( typeId == null ) { return null ; } JinxConstants . MemberType memberType ; switch ( typeId ) { case 1 : memberType = JinxConstants . MemberType . narwhal ; break ; case 2 : memberType = JinxConstants . MemberType . member ; break ; ca... | Convert a numeric Flickr member type id to a MemberType enum value . |
18,999 | public static Integer groupPrivacyEnumToPrivacyId ( JinxConstants . GroupPrivacy privacy ) { if ( privacy == null ) { return null ; } Integer id ; switch ( privacy ) { case group_private : id = 1 ; break ; case group_invite_only_public : id = 2 ; break ; case group_open_public : id = 3 ; break ; default : id = null ; b... | Convert a GroupPrivacy enum value to the corresponding Flickr numeric identifier . |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.