idx int64 0 165k | question stringlengths 73 4.15k | target stringlengths 5 918 | len_question int64 21 890 | len_target int64 3 255 |
|---|---|---|---|---|
24,500 | public StorageRestoreParameters withStorageBundleBackup ( byte [ ] storageBundleBackup ) { if ( storageBundleBackup == null ) { this . storageBundleBackup = null ; } else { this . storageBundleBackup = Base64Url . encode ( storageBundleBackup ) ; } return this ; } | Set the storageBundleBackup value . | 72 | 9 |
24,501 | public < U extends ODataEntity < ? > > LinkInfo < U > getLink ( String rel ) { for ( Object child : entry . getEntryChildren ( ) ) { LinkType link = linkFromChild ( child ) ; if ( link != null && link . getRel ( ) . equals ( rel ) ) { return new LinkInfo < U > ( link ) ; } } return null ; } | Get the link with the given rel attribute | 84 | 8 |
24,502 | public < U extends ODataEntity < ? > > LinkInfo < U > getRelationLink ( String relationName ) { return this . < U > getLink ( Constants . ODATA_DATA_NS + "/related/" + relationName ) ; } | Get the link to navigate an OData relationship | 54 | 9 |
24,503 | public static boolean isODataEntityCollectionType ( Class < ? > type , Type genericType ) { if ( ListResult . class != type ) { return false ; } ParameterizedType pt = ( ParameterizedType ) genericType ; if ( pt . getActualTypeArguments ( ) . length != 1 ) { return false ; } Class < ? > typeClass = getCollectedType ( genericType ) ; return isODataEntityType ( typeClass ) ; } | Is the given type a collection of ODataEntity | 100 | 10 |
24,504 | public void beginDelete ( String resourceGroupName , String expressRouteGatewayName , String connectionName ) { beginDeleteWithServiceResponseAsync ( resourceGroupName , expressRouteGatewayName , connectionName ) . toBlocking ( ) . single ( ) . body ( ) ; } | Deletes a connection to a ExpressRoute circuit . | 58 | 10 |
24,505 | public static boolean isNullOrWhiteSpace ( String arg ) { if ( Strings . isNullOrEmpty ( arg ) || arg . trim ( ) . isEmpty ( ) ) { return true ; } return false ; } | Determines whether the parameter string is null empty or whitespace . | 46 | 14 |
24,506 | public static boolean sequenceEqualConstantTime ( byte [ ] self , byte [ ] other ) { if ( self == null ) { throw new IllegalArgumentException ( "self" ) ; } if ( other == null ) { throw new IllegalArgumentException ( "other" ) ; } // Constant time comparison of two byte arrays long difference = ( self . length & 0xffffffff L ) ^ ( other . length & 0xffffffff L ) ; for ( int i = 0 ; i < self . length && i < other . length ; i ++ ) { difference |= ( self [ i ] ^ other [ i ] ) & 0xffffffff L ; } return difference == 0 ; } | Compares two byte arrays in constant time . | 147 | 9 |
24,507 | public KeyVerifyParameters withDigest ( byte [ ] digest ) { if ( digest == null ) { this . digest = null ; } else { this . digest = Base64Url . encode ( digest ) ; } return this ; } | Set the digest value . | 49 | 5 |
24,508 | public KeyVerifyParameters withSignature ( byte [ ] signature ) { if ( signature == null ) { this . signature = null ; } else { this . signature = Base64Url . encode ( signature ) ; } return this ; } | Set the signature value . | 49 | 5 |
24,509 | public Observable < SecretBundle > deleteSecretAsync ( String vaultBaseUrl , String secretName ) { return deleteSecretWithServiceResponseAsync ( vaultBaseUrl , secretName ) . map ( new Func1 < ServiceResponse < SecretBundle > , SecretBundle > ( ) { @ Override public SecretBundle call ( ServiceResponse < SecretBundle > response ) { return response . body ( ) ; } } ) ; } | Deletes a secret from a specified key vault . | 91 | 10 |
24,510 | public Observable < ServiceResponse < Page < CertificateItem > > > getCertificatesSinglePageAsync ( final String vaultBaseUrl , final Integer maxresults ) { if ( vaultBaseUrl == null ) { throw new IllegalArgumentException ( "Parameter vaultBaseUrl is required and cannot be null." ) ; } if ( this . apiVersion ( ) == null ) { throw new IllegalArgumentException ( "Parameter this.apiVersion() is required and cannot be null." ) ; } String parameterizedHost = Joiner . on ( ", " ) . join ( "{vaultBaseUrl}" , vaultBaseUrl ) ; return service . getCertificates ( maxresults , this . apiVersion ( ) , this . acceptLanguage ( ) , parameterizedHost , this . userAgent ( ) ) . flatMap ( new Func1 < Response < ResponseBody > , Observable < ServiceResponse < Page < CertificateItem > > > > ( ) { @ Override public Observable < ServiceResponse < Page < CertificateItem > > > call ( Response < ResponseBody > response ) { try { ServiceResponse < PageImpl < CertificateItem >> result = getCertificatesDelegate ( response ) ; return Observable . just ( new ServiceResponse < Page < CertificateItem > > ( result . body ( ) , result . response ( ) ) ) ; } catch ( Throwable t ) { return Observable . error ( t ) ; } } } ) ; } | List certificates in a specified key vault . | 301 | 8 |
24,511 | public Observable < CertificateBundle > deleteCertificateAsync ( String vaultBaseUrl , String certificateName ) { return deleteCertificateWithServiceResponseAsync ( vaultBaseUrl , certificateName ) . map ( new Func1 < ServiceResponse < CertificateBundle > , CertificateBundle > ( ) { @ Override public CertificateBundle call ( ServiceResponse < CertificateBundle > response ) { return response . body ( ) ; } } ) ; } | Deletes a certificate from a specified key vault . | 93 | 10 |
24,512 | public String scheme ( Object [ ] swaggerMethodArguments ) { final String substitutedHost = applySubstitutions ( rawHost , hostSubstitutions , swaggerMethodArguments , UrlEscapers . PATH_ESCAPER ) ; final String [ ] substitutedHostParts = substitutedHost . split ( "://" ) ; return substitutedHostParts . length < 1 ? null : substitutedHostParts [ 0 ] ; } | Get the scheme to use for HTTP requests for this Swagger method . | 89 | 14 |
24,513 | public String path ( Object [ ] methodArguments ) { return applySubstitutions ( relativePath , pathSubstitutions , methodArguments , UrlEscapers . PATH_ESCAPER ) ; } | Get the path that will be used to complete the Swagger method s request . | 45 | 16 |
24,514 | public Iterable < EncodedParameter > encodedQueryParameters ( Object [ ] swaggerMethodArguments ) { final List < EncodedParameter > result = new ArrayList <> ( ) ; if ( querySubstitutions != null ) { final PercentEscaper escaper = UrlEscapers . QUERY_ESCAPER ; for ( Substitution querySubstitution : querySubstitutions ) { final int parameterIndex = querySubstitution . methodParameterIndex ( ) ; if ( 0 <= parameterIndex && parameterIndex < swaggerMethodArguments . length ) { final Object methodArgument = swaggerMethodArguments [ querySubstitution . methodParameterIndex ( ) ] ; String parameterValue = serialize ( methodArgument ) ; if ( parameterValue != null ) { if ( querySubstitution . shouldEncode ( ) && escaper != null ) { parameterValue = escaper . escape ( parameterValue ) ; } result . add ( new EncodedParameter ( querySubstitution . urlParameterName ( ) , parameterValue ) ) ; } } } } return result ; } | Get the encoded query parameters that have been added to this value based on the provided method arguments . | 229 | 19 |
24,515 | public Iterable < EncodedParameter > encodedFormParameters ( Object [ ] swaggerMethodArguments ) { if ( formSubstitutions == null ) { return Collections . emptyList ( ) ; } final List < EncodedParameter > result = new ArrayList <> ( ) ; final PercentEscaper escaper = UrlEscapers . QUERY_ESCAPER ; for ( Substitution formSubstitution : formSubstitutions ) { final int parameterIndex = formSubstitution . methodParameterIndex ( ) ; if ( 0 <= parameterIndex && parameterIndex < swaggerMethodArguments . length ) { final Object methodArgument = swaggerMethodArguments [ formSubstitution . methodParameterIndex ( ) ] ; String parameterValue = serialize ( methodArgument ) ; if ( parameterValue != null ) { if ( formSubstitution . shouldEncode ( ) && escaper != null ) { parameterValue = escaper . escape ( parameterValue ) ; } result . add ( new EncodedParameter ( formSubstitution . urlParameterName ( ) , parameterValue ) ) ; } } } return result ; } | Get the encoded form parameters that have been added to this value based on the provided method arguments . | 237 | 19 |
24,516 | public Iterable < HttpHeader > headers ( Object [ ] swaggerMethodArguments ) { final HttpHeaders result = new HttpHeaders ( headers ) ; if ( headerSubstitutions != null ) { for ( Substitution headerSubstitution : headerSubstitutions ) { final int parameterIndex = headerSubstitution . methodParameterIndex ( ) ; if ( 0 <= parameterIndex && parameterIndex < swaggerMethodArguments . length ) { final Object methodArgument = swaggerMethodArguments [ headerSubstitution . methodParameterIndex ( ) ] ; if ( methodArgument instanceof Map ) { final Map < String , ? > headerCollection = ( Map < String , ? > ) methodArgument ; final String headerCollectionPrefix = headerSubstitution . urlParameterName ( ) ; for ( final Map . Entry < String , ? > headerCollectionEntry : headerCollection . entrySet ( ) ) { final String headerName = headerCollectionPrefix + headerCollectionEntry . getKey ( ) ; final String headerValue = serialize ( headerCollectionEntry . getValue ( ) ) ; result . set ( headerName , headerValue ) ; } } else { final String headerName = headerSubstitution . urlParameterName ( ) ; final String headerValue = serialize ( methodArgument ) ; result . set ( headerName , headerValue ) ; } } } } return result ; } | Get the headers that have been added to this value based on the provided method arguments . | 296 | 17 |
24,517 | public boolean isExpectedResponseStatusCode ( int responseStatusCode , int [ ] additionalAllowedStatusCodes ) { boolean result ; if ( expectedStatusCodes == null ) { result = ( responseStatusCode < 400 ) ; } else { result = contains ( expectedStatusCodes , responseStatusCode ) || contains ( additionalAllowedStatusCodes , responseStatusCode ) ; } return result ; } | Get whether or not the provided response status code is one of the expected status codes for this Swagger method . | 84 | 22 |
24,518 | public Object body ( Object [ ] swaggerMethodArguments ) { Object result = null ; if ( bodyContentMethodParameterIndex != null && swaggerMethodArguments != null && 0 <= bodyContentMethodParameterIndex && bodyContentMethodParameterIndex < swaggerMethodArguments . length ) { result = swaggerMethodArguments [ bodyContentMethodParameterIndex ] ; } if ( formSubstitutions != null && ! formSubstitutions . isEmpty ( ) && swaggerMethodArguments != null ) { result = formSubstitutions . stream ( ) . map ( s -> serializeFormData ( s . urlParameterName ( ) , swaggerMethodArguments [ s . methodParameterIndex ( ) ] ) ) . collect ( Collectors . joining ( "&" ) ) ; } return result ; } | Get the object to be used as the value of the HTTP request . | 171 | 14 |
24,519 | public boolean expectsResponseBody ( ) { boolean result = true ; if ( TypeUtil . isTypeOrSubTypeOf ( returnType , Void . class ) ) { result = false ; } else if ( TypeUtil . isTypeOrSubTypeOf ( returnType , Mono . class ) || TypeUtil . isTypeOrSubTypeOf ( returnType , Flux . class ) ) { final ParameterizedType asyncReturnType = ( ParameterizedType ) returnType ; final Type syncReturnType = asyncReturnType . getActualTypeArguments ( ) [ 0 ] ; if ( TypeUtil . isTypeOrSubTypeOf ( syncReturnType , Void . class ) ) { result = false ; } else if ( TypeUtil . isTypeOrSubTypeOf ( syncReturnType , Response . class ) ) { result = TypeUtil . restResponseTypeExpectsBody ( ( ParameterizedType ) TypeUtil . getSuperType ( syncReturnType , Response . class ) ) ; } } else if ( TypeUtil . isTypeOrSubTypeOf ( returnType , Response . class ) ) { result = TypeUtil . restResponseTypeExpectsBody ( ( ParameterizedType ) returnType ) ; } return result ; } | Checks whether or not the Swagger method expects the response to contain a body . | 265 | 17 |
24,520 | public static EntityCreateOperation < ContentKeyAuthorizationPolicyOptionInfo > create ( String name , int keyDeliveryType , String keyDeliveryConfiguration , List < ContentKeyAuthorizationPolicyRestriction > restrictions ) { return new Creator ( name , keyDeliveryType , keyDeliveryConfiguration , restrictions ) ; } | Creates an operation to create a new content key authorization options | 60 | 12 |
24,521 | public static DefaultListOperation < ContentKeyAuthorizationPolicyOptionInfo > list ( LinkInfo < ContentKeyAuthorizationPolicyOptionInfo > link ) { return new DefaultListOperation < ContentKeyAuthorizationPolicyOptionInfo > ( link . getHref ( ) , new GenericType < ListResult < ContentKeyAuthorizationPolicyOptionInfo > > ( ) { } ) ; } | Create an operation that will list all the content keys authorization policy options at the given link . | 76 | 18 |
24,522 | public Observable < ManagedInstanceVulnerabilityAssessmentInner > getAsync ( String resourceGroupName , String managedInstanceName ) { return getWithServiceResponseAsync ( resourceGroupName , managedInstanceName ) . map ( new Func1 < ServiceResponse < ManagedInstanceVulnerabilityAssessmentInner > , ManagedInstanceVulnerabilityAssessmentInner > ( ) { @ Override public ManagedInstanceVulnerabilityAssessmentInner call ( ServiceResponse < ManagedInstanceVulnerabilityAssessmentInner > response ) { return response . body ( ) ; } } ) ; } | Gets the managed instance s vulnerability assessment . | 121 | 9 |
24,523 | public MimeMultipart getMimeMultipart ( ) throws MessagingException , IOException , JAXBException { List < DataSource > bodyPartContents = createRequestBody ( ) ; return toMimeMultipart ( bodyPartContents ) ; } | Gets the mime multipart . | 56 | 8 |
24,524 | private int addJobPart ( List < DataSource > bodyPartContents , URI jobURI , int contentId ) throws JAXBException { int jobContentId = contentId ; validateJobOperation ( ) ; for ( EntityBatchOperation entityBatchOperation : entityBatchOperations ) { DataSource bodyPartContent = null ; if ( entityBatchOperation instanceof Job . CreateBatchOperation ) { Job . CreateBatchOperation jobCreateBatchOperation = ( Job . CreateBatchOperation ) entityBatchOperation ; jobContentId = contentId ; bodyPartContent = createBatchCreateEntityPart ( jobCreateBatchOperation . getVerb ( ) , "Jobs" , jobCreateBatchOperation . getEntryType ( ) , jobURI , contentId ) ; contentId ++ ; if ( bodyPartContent != null ) { bodyPartContents . add ( bodyPartContent ) ; break ; } } } return jobContentId ; } | Adds the job part . | 199 | 5 |
24,525 | private void addTaskPart ( List < DataSource > bodyPartContents , URI taskURI , int contentId ) throws JAXBException { for ( EntityBatchOperation entityBatchOperation : entityBatchOperations ) { DataSource bodyPartContent = null ; if ( entityBatchOperation instanceof Task . CreateBatchOperation ) { Task . CreateBatchOperation createTaskOperation = ( Task . CreateBatchOperation ) entityBatchOperation ; bodyPartContent = createBatchCreateEntityPart ( createTaskOperation . getVerb ( ) , "Tasks" , createTaskOperation . getEntryType ( ) , taskURI , contentId ) ; contentId ++ ; } if ( bodyPartContent != null ) { bodyPartContents . add ( bodyPartContent ) ; } } } | Adds the task part . | 165 | 5 |
24,526 | private MimeMultipart toMimeMultipart ( List < DataSource > bodyPartContents ) throws MessagingException , IOException { String changeSetId = String . format ( "changeset_%s" , UUID . randomUUID ( ) . toString ( ) ) ; MimeMultipart changeSets = createChangeSets ( bodyPartContents , changeSetId ) ; MimeBodyPart mimeBodyPart = createMimeBodyPart ( changeSets , changeSetId ) ; MimeMultipart mimeMultipart = new BatchMimeMultipart ( new SetBoundaryMultipartDataSource ( batchId ) ) ; mimeMultipart . addBodyPart ( mimeBodyPart ) ; return mimeMultipart ; } | To mime multipart . | 168 | 6 |
24,527 | private DataSource createBatchCreateEntityPart ( String verb , String entityName , EntryType entryType , URI uri , int contentId ) throws JAXBException { ByteArrayOutputStream stream = new ByteArrayOutputStream ( ) ; this . oDataAtomMarshaller . marshalEntryType ( entryType , stream ) ; byte [ ] bytes = stream . toByteArray ( ) ; // adds header InternetHeaders headers = new InternetHeaders ( ) ; headers . addHeader ( "Content-ID" , Integer . toString ( contentId ) ) ; headers . addHeader ( "Content-Type" , "application/atom+xml;type=entry" ) ; headers . addHeader ( "Content-Length" , Integer . toString ( bytes . length ) ) ; headers . addHeader ( "DataServiceVersion" , "3.0;NetFx" ) ; headers . addHeader ( "MaxDataServiceVersion" , "3.0;NetFx" ) ; // adds body ByteArrayOutputStream httpRequest = new ByteArrayOutputStream ( ) ; addHttpMethod ( httpRequest , verb , uri ) ; appendHeaders ( httpRequest , headers ) ; appendEntity ( httpRequest , new ByteArrayInputStream ( bytes ) ) ; DataSource bodyPartContent = new InputStreamDataSource ( new ByteArrayInputStream ( httpRequest . toByteArray ( ) ) , "application/http" ) ; return bodyPartContent ; } | Creates the batch create entity part . | 309 | 8 |
24,528 | public void parseBatchResult ( ClientResponse response ) throws IOException , ServiceException { ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream ( ) ; InputStream inputStream = response . getEntityInputStream ( ) ; ReaderWriter . writeTo ( inputStream , byteArrayOutputStream ) ; response . setEntityInputStream ( new ByteArrayInputStream ( byteArrayOutputStream . toByteArray ( ) ) ) ; JobInfo jobInfo ; List < DataSource > parts = parseParts ( response . getEntityInputStream ( ) , response . getHeaders ( ) . getFirst ( "Content-Type" ) ) ; if ( parts . size ( ) == 0 || parts . size ( ) > entityBatchOperations . size ( ) ) { throw new UniformInterfaceException ( String . format ( "Batch response from server does not contain the correct amount " + "of parts (expecting %d, received %d instead)" , parts . size ( ) , entityBatchOperations . size ( ) ) , response ) ; } for ( int i = 0 ; i < parts . size ( ) ; i ++ ) { DataSource ds = parts . get ( i ) ; EntityBatchOperation entityBatchOperation = entityBatchOperations . get ( i ) ; StatusLine status = StatusLine . create ( ds ) ; InternetHeaders headers = parseHeaders ( ds ) ; InputStream content = parseEntity ( ds ) ; if ( status . getStatus ( ) >= HTTP_ERROR ) { InBoundHeaders inBoundHeaders = new InBoundHeaders ( ) ; @ SuppressWarnings ( "unchecked" ) Enumeration < Header > e = headers . getAllHeaders ( ) ; while ( e . hasMoreElements ( ) ) { Header header = e . nextElement ( ) ; inBoundHeaders . putSingle ( header . getName ( ) , header . getValue ( ) ) ; } ClientResponse clientResponse = new ClientResponse ( status . getStatus ( ) , inBoundHeaders , content , null ) ; UniformInterfaceException uniformInterfaceException = new UniformInterfaceException ( clientResponse ) ; throw uniformInterfaceException ; } else if ( entityBatchOperation instanceof Job . CreateBatchOperation ) { try { jobInfo = oDataAtomUnmarshaller . unmarshalEntry ( content , JobInfo . class ) ; Job . CreateBatchOperation jobCreateBatchOperation = ( Job . CreateBatchOperation ) entityBatchOperation ; jobCreateBatchOperation . setJobInfo ( jobInfo ) ; } catch ( JAXBException e ) { throw new ServiceException ( e ) ; } } else if ( entityBatchOperation instanceof Task . CreateBatchOperation ) { try { oDataAtomUnmarshaller . unmarshalEntry ( content , TaskInfo . class ) ; } catch ( JAXBException e ) { throw new ServiceException ( e ) ; } } } } | Parses the batch result . | 630 | 7 |
24,529 | private InternetHeaders parseHeaders ( DataSource ds ) { try { return new InternetHeaders ( ds . getInputStream ( ) ) ; } catch ( MessagingException e ) { throw new RuntimeException ( e ) ; } catch ( IOException e ) { throw new RuntimeException ( e ) ; } } | Parses the headers . | 67 | 6 |
24,530 | private InputStream parseEntity ( DataSource ds ) { try { return ds . getInputStream ( ) ; } catch ( IOException e ) { throw new RuntimeException ( e ) ; } } | Parses the entity . | 42 | 6 |
24,531 | private List < DataSource > parseParts ( final InputStream entityInputStream , final String contentType ) { try { return parsePartsCore ( entityInputStream , contentType ) ; } catch ( IOException e ) { throw new RuntimeException ( e ) ; } catch ( MessagingException e ) { throw new RuntimeException ( e ) ; } } | Parses the parts . | 72 | 6 |
24,532 | private List < DataSource > parsePartsCore ( InputStream entityInputStream , String contentType ) throws MessagingException , IOException { DataSource dataSource = new InputStreamDataSource ( entityInputStream , contentType ) ; MimeMultipart batch = new MimeMultipart ( dataSource ) ; MimeBodyPart batchBody = ( MimeBodyPart ) batch . getBodyPart ( 0 ) ; MimeMultipart changeSets = new MimeMultipart ( new MimePartDataSource ( batchBody ) ) ; List < DataSource > result = new ArrayList < DataSource > ( ) ; for ( int i = 0 ; i < changeSets . getCount ( ) ; i ++ ) { BodyPart part = changeSets . getBodyPart ( i ) ; result . add ( new InputStreamDataSource ( part . getInputStream ( ) , part . getContentType ( ) ) ) ; } return result ; } | Parses the parts core . | 202 | 7 |
24,533 | private void addHttpMethod ( ByteArrayOutputStream outputStream , String verb , URI uri ) { try { String method = String . format ( "%s %s HTTP/1.1\r\n" , verb , uri ) ; outputStream . write ( method . getBytes ( "UTF-8" ) ) ; } catch ( UnsupportedEncodingException e ) { throw new RuntimeException ( e ) ; } catch ( IOException e ) { throw new RuntimeException ( e ) ; } } | Adds the http method . | 106 | 5 |
24,534 | private void appendHeaders ( OutputStream outputStream , InternetHeaders internetHeaders ) { try { // Headers @ SuppressWarnings ( "unchecked" ) Enumeration < Header > headers = internetHeaders . getAllHeaders ( ) ; while ( headers . hasMoreElements ( ) ) { Header header = headers . nextElement ( ) ; String headerLine = String . format ( "%s: %s\r\n" , header . getName ( ) , header . getValue ( ) ) ; outputStream . write ( headerLine . getBytes ( "UTF-8" ) ) ; } // Empty line outputStream . write ( "\r\n" . getBytes ( "UTF-8" ) ) ; } catch ( UnsupportedEncodingException e ) { throw new RuntimeException ( e ) ; } catch ( IOException e ) { throw new RuntimeException ( e ) ; } } | Append headers . | 193 | 4 |
24,535 | private void appendEntity ( OutputStream outputStream , ByteArrayInputStream byteArrayInputStream ) { try { byte [ ] buffer = new byte [ BUFFER_SIZE ] ; while ( true ) { int bytesRead = byteArrayInputStream . read ( buffer ) ; if ( bytesRead <= 0 ) { break ; } outputStream . write ( buffer , 0 , bytesRead ) ; } } catch ( IOException e ) { throw new RuntimeException ( e ) ; } } | Append entity . | 98 | 4 |
24,536 | public ServiceFuture < JobExecutionInner > getAsync ( String resourceGroupName , String serverName , String jobAgentName , String jobName , UUID jobExecutionId , String stepName , UUID targetId , final ServiceCallback < JobExecutionInner > serviceCallback ) { return ServiceFuture . fromResponse ( getWithServiceResponseAsync ( resourceGroupName , serverName , jobAgentName , jobName , jobExecutionId , stepName , targetId ) , serviceCallback ) ; } | Gets a target execution . | 105 | 6 |
24,537 | final void updateDelayInMillisecondsFrom ( HttpResponse httpPollResponse ) { final Long parsedDelayInMilliseconds = delayInMillisecondsFrom ( httpPollResponse ) ; if ( parsedDelayInMilliseconds != null ) { delayInMilliseconds = parsedDelayInMilliseconds ; } } | Update the delay in milliseconds from the provided HTTP poll response . | 70 | 12 |
24,538 | Mono < Void > delayAsync ( ) { Mono < Void > result = Mono . empty ( ) ; if ( delayInMilliseconds > 0 ) { result = result . delaySubscription ( Duration . ofMillis ( delayInMilliseconds ) ) ; } return result ; } | If this OperationStatus has a retryAfterSeconds value return an Mono that is delayed by the number of seconds that are in the retryAfterSeconds value . If this OperationStatus doesn t have a retryAfterSeconds value then return an Single with no delay . | 60 | 56 |
24,539 | public Observable < TriggerInner > getAsync ( String deviceName , String name , String resourceGroupName ) { return getWithServiceResponseAsync ( deviceName , name , resourceGroupName ) . map ( new Func1 < ServiceResponse < TriggerInner > , TriggerInner > ( ) { @ Override public TriggerInner call ( ServiceResponse < TriggerInner > response ) { return response . body ( ) ; } } ) ; } | Get a specific trigger by name . | 94 | 7 |
24,540 | public Observable < EncryptionProtectorInner > getAsync ( String resourceGroupName , String serverName ) { return getWithServiceResponseAsync ( resourceGroupName , serverName ) . map ( new Func1 < ServiceResponse < EncryptionProtectorInner > , EncryptionProtectorInner > ( ) { @ Override public EncryptionProtectorInner call ( ServiceResponse < EncryptionProtectorInner > response ) { return response . body ( ) ; } } ) ; } | Gets a server encryption protector . | 104 | 7 |
24,541 | public static void eraseKey ( byte [ ] keyToErase ) { if ( keyToErase != null ) { SecureRandom random ; try { random = SecureRandom . getInstance ( "SHA1PRNG" ) ; random . nextBytes ( keyToErase ) ; } catch ( NoSuchAlgorithmException e ) { // never reached } } } | Overwrites the supplied byte array with RNG generated data which destroys the original contents . | 75 | 18 |
24,542 | @ Override public Response intercept ( Interceptor . Chain chain ) throws IOException { Request newRequest = this . signHeader ( chain . request ( ) ) ; return chain . proceed ( newRequest ) ; } | Inject the new authentication HEADER | 43 | 7 |
24,543 | public Observable < ServiceResponse < Void > > exportWithServiceResponseAsync ( String vaultName , String resourceGroupName , String filter ) { if ( vaultName == null ) { throw new IllegalArgumentException ( "Parameter vaultName is required and cannot be null." ) ; } if ( resourceGroupName == null ) { throw new IllegalArgumentException ( "Parameter resourceGroupName is required and cannot be null." ) ; } if ( this . client . subscriptionId ( ) == null ) { throw new IllegalArgumentException ( "Parameter this.client.subscriptionId() is required and cannot be null." ) ; } final String apiVersion = "2017-07-01" ; return service . export ( vaultName , resourceGroupName , this . client . subscriptionId ( ) , apiVersion , filter , this . client . acceptLanguage ( ) , this . client . userAgent ( ) ) . flatMap ( new Func1 < Response < ResponseBody > , Observable < ServiceResponse < Void > > > ( ) { @ Override public Observable < ServiceResponse < Void > > call ( Response < ResponseBody > response ) { try { ServiceResponse < Void > clientResponse = exportDelegate ( response ) ; return Observable . just ( clientResponse ) ; } catch ( Throwable t ) { return Observable . error ( t ) ; } } } ) ; } | Triggers export of jobs specified by filters and returns an OperationID to track . | 288 | 17 |
24,544 | public Observable < DatabaseBlobAuditingPolicyInner > getAsync ( String resourceGroupName , String serverName , String databaseName ) { return getWithServiceResponseAsync ( resourceGroupName , serverName , databaseName ) . map ( new Func1 < ServiceResponse < DatabaseBlobAuditingPolicyInner > , DatabaseBlobAuditingPolicyInner > ( ) { @ Override public DatabaseBlobAuditingPolicyInner call ( ServiceResponse < DatabaseBlobAuditingPolicyInner > response ) { return response . body ( ) ; } } ) ; } | Gets a database s blob auditing policy . | 121 | 10 |
24,545 | public Observable < DatabaseBlobAuditingPolicyInner > createOrUpdateAsync ( String resourceGroupName , String serverName , String databaseName , DatabaseBlobAuditingPolicyInner parameters ) { return createOrUpdateWithServiceResponseAsync ( resourceGroupName , serverName , databaseName , parameters ) . map ( new Func1 < ServiceResponse < DatabaseBlobAuditingPolicyInner > , DatabaseBlobAuditingPolicyInner > ( ) { @ Override public DatabaseBlobAuditingPolicyInner call ( ServiceResponse < DatabaseBlobAuditingPolicyInner > response ) { return response . body ( ) ; } } ) ; } | Creates or updates a database s blob auditing policy . | 137 | 12 |
24,546 | public Duration getNextRetryInterval ( String clientId , Exception lastException , Duration remainingTime ) { int baseWaitTime = 0 ; synchronized ( this . serverBusySync ) { if ( lastException != null && ( lastException instanceof ServerBusyException || ( lastException . getCause ( ) != null && lastException . getCause ( ) instanceof ServerBusyException ) ) ) { baseWaitTime += ClientConstants . SERVER_BUSY_BASE_SLEEP_TIME_IN_SECS ; } } return this . onGetNextRetryInterval ( clientId , lastException , remainingTime , baseWaitTime ) ; } | Gets the Interval after which nextRetry should be done . | 140 | 14 |
24,547 | public void deletePool ( String poolId , Iterable < BatchClientBehavior > additionalBehaviors ) throws BatchErrorException , IOException { PoolDeleteOptions options = new PoolDeleteOptions ( ) ; BehaviorManager bhMgr = new BehaviorManager ( this . customBehaviors ( ) , additionalBehaviors ) ; bhMgr . applyRequestBehaviors ( options ) ; this . parentBatchClient . protocolLayer ( ) . pools ( ) . delete ( poolId , options ) ; } | Deletes the specified pool . | 109 | 6 |
24,548 | public void stopResizePool ( String poolId , Iterable < BatchClientBehavior > additionalBehaviors ) throws BatchErrorException , IOException { PoolStopResizeOptions options = new PoolStopResizeOptions ( ) ; BehaviorManager bhMgr = new BehaviorManager ( this . customBehaviors ( ) , additionalBehaviors ) ; bhMgr . applyRequestBehaviors ( options ) ; this . parentBatchClient . protocolLayer ( ) . pools ( ) . stopResize ( poolId , options ) ; } | Stops a pool resize operation . | 117 | 7 |
24,549 | public void disableAutoScale ( String poolId , Iterable < BatchClientBehavior > additionalBehaviors ) throws BatchErrorException , IOException { PoolDisableAutoScaleOptions options = new PoolDisableAutoScaleOptions ( ) ; BehaviorManager bhMgr = new BehaviorManager ( this . customBehaviors ( ) , additionalBehaviors ) ; bhMgr . applyRequestBehaviors ( options ) ; this . parentBatchClient . protocolLayer ( ) . pools ( ) . disableAutoScale ( poolId , options ) ; } | Disables automatic scaling on the specified pool . | 116 | 9 |
24,550 | public boolean existsPool ( String poolId , Iterable < BatchClientBehavior > additionalBehaviors ) throws BatchErrorException , IOException { PoolExistsOptions options = new PoolExistsOptions ( ) ; BehaviorManager bhMgr = new BehaviorManager ( this . customBehaviors ( ) , additionalBehaviors ) ; bhMgr . applyRequestBehaviors ( options ) ; return this . parentBatchClient . protocolLayer ( ) . pools ( ) . exists ( poolId , options ) ; } | Checks whether the specified pool exists . | 112 | 8 |
24,551 | public void patchPool ( String poolId , StartTask startTask , Collection < CertificateReference > certificateReferences , Collection < ApplicationPackageReference > applicationPackageReferences , Collection < MetadataItem > metadata , Iterable < BatchClientBehavior > additionalBehaviors ) throws BatchErrorException , IOException { PoolPatchOptions options = new PoolPatchOptions ( ) ; BehaviorManager bhMgr = new BehaviorManager ( this . customBehaviors ( ) , additionalBehaviors ) ; bhMgr . applyRequestBehaviors ( options ) ; PoolPatchParameter param = new PoolPatchParameter ( ) . withStartTask ( startTask ) ; if ( metadata != null ) { param . withMetadata ( new LinkedList <> ( metadata ) ) ; } if ( applicationPackageReferences != null ) { param . withApplicationPackageReferences ( new LinkedList <> ( applicationPackageReferences ) ) ; } if ( certificateReferences != null ) { param . withCertificateReferences ( new LinkedList <> ( certificateReferences ) ) ; } this . parentBatchClient . protocolLayer ( ) . pools ( ) . patch ( poolId , param , options ) ; } | Updates the specified pool . This method only replaces the properties specified with non - null values . | 245 | 19 |
24,552 | public PoolStatistics getAllPoolsLifetimeStatistics ( Iterable < BatchClientBehavior > additionalBehaviors ) throws BatchErrorException , IOException { PoolGetAllLifetimeStatisticsOptions options = new PoolGetAllLifetimeStatisticsOptions ( ) ; BehaviorManager bhMgr = new BehaviorManager ( this . customBehaviors ( ) , additionalBehaviors ) ; bhMgr . applyRequestBehaviors ( options ) ; return this . parentBatchClient . protocolLayer ( ) . pools ( ) . getAllLifetimeStatistics ( options ) ; } | Gets lifetime summary statistics for all of the pools in the current account . Statistics are aggregated across all pools that have ever existed in the account from account creation to the last update time of the statistics . | 125 | 41 |
24,553 | public static EntityCreateOperation < AccessPolicyInfo > create ( String name , double durationInMinutes , EnumSet < AccessPolicyPermission > permissions ) { return new Creator ( name , durationInMinutes , permissions ) ; } | Creates an operation to create a new access policy | 48 | 10 |
24,554 | public static EntityGetOperation < AccessPolicyInfo > get ( String accessPolicyId ) { return new DefaultGetOperation < AccessPolicyInfo > ( ENTITY_SET , accessPolicyId , AccessPolicyInfo . class ) ; } | Create an operation that will retrieve the given access policy | 46 | 10 |
24,555 | public static EntityGetOperation < AccessPolicyInfo > get ( LinkInfo < AccessPolicyInfo > link ) { return new DefaultGetOperation < AccessPolicyInfo > ( link . getHref ( ) , AccessPolicyInfo . class ) ; } | Create an operation that will retrieve the access policy at the given link | 49 | 13 |
24,556 | public ContentKeyType getContentKeyType ( ) { Integer contentKeyTypeInteger = getContent ( ) . getContentKeyType ( ) ; ContentKeyType contentKeyType = null ; if ( contentKeyTypeInteger != null ) { contentKeyType = ContentKeyType . fromCode ( contentKeyTypeInteger ) ; } return contentKeyType ; } | Gets the content key type . | 72 | 7 |
24,557 | public Observable < TermList > getDetailsAsync ( String listId ) { return getDetailsWithServiceResponseAsync ( listId ) . map ( new Func1 < ServiceResponse < TermList > , TermList > ( ) { @ Override public TermList call ( ServiceResponse < TermList > response ) { return response . body ( ) ; } } ) ; } | Returns list Id details of the term list with list Id equal to list Id passed . | 77 | 17 |
24,558 | public SecretRestoreParameters withSecretBundleBackup ( byte [ ] secretBundleBackup ) { if ( secretBundleBackup == null ) { this . secretBundleBackup = null ; } else { this . secretBundleBackup = Base64Url . encode ( secretBundleBackup ) ; } return this ; } | Set the secretBundleBackup value . | 72 | 9 |
24,559 | public Observable < ServerAutomaticTuningInner > getAsync ( String resourceGroupName , String serverName ) { return getWithServiceResponseAsync ( resourceGroupName , serverName ) . map ( new Func1 < ServiceResponse < ServerAutomaticTuningInner > , ServerAutomaticTuningInner > ( ) { @ Override public ServerAutomaticTuningInner call ( ServiceResponse < ServerAutomaticTuningInner > response ) { return response . body ( ) ; } } ) ; } | Retrieves server automatic tuning options . | 109 | 8 |
24,560 | public Observable < ServerTableAuditingPolicyInner > getAsync ( String resourceGroupName , String serverName ) { return getWithServiceResponseAsync ( resourceGroupName , serverName ) . map ( new Func1 < ServiceResponse < ServerTableAuditingPolicyInner > , ServerTableAuditingPolicyInner > ( ) { @ Override public ServerTableAuditingPolicyInner call ( ServiceResponse < ServerTableAuditingPolicyInner > response ) { return response . body ( ) ; } } ) ; } | Gets a server s table auditing policy . Table auditing is deprecated use blob auditing instead . | 109 | 21 |
24,561 | public Observable < ServerTableAuditingPolicyInner > createOrUpdateAsync ( String resourceGroupName , String serverName , ServerTableAuditingPolicyInner parameters ) { return createOrUpdateWithServiceResponseAsync ( resourceGroupName , serverName , parameters ) . map ( new Func1 < ServiceResponse < ServerTableAuditingPolicyInner > , ServerTableAuditingPolicyInner > ( ) { @ Override public ServerTableAuditingPolicyInner call ( ServiceResponse < ServerTableAuditingPolicyInner > response ) { return response . body ( ) ; } } ) ; } | Creates or updates a servers s table auditing policy . Table auditing is deprecated use blob auditing instead . | 124 | 23 |
24,562 | public Observable < ServerTableAuditingPolicyListResultInner > listByServerAsync ( String resourceGroupName , String serverName ) { return listByServerWithServiceResponseAsync ( resourceGroupName , serverName ) . map ( new Func1 < ServiceResponse < ServerTableAuditingPolicyListResultInner > , ServerTableAuditingPolicyListResultInner > ( ) { @ Override public ServerTableAuditingPolicyListResultInner call ( ServiceResponse < ServerTableAuditingPolicyListResultInner > response ) { return response . body ( ) ; } } ) ; } | Lists a servers s table auditing policies . Table auditing is deprecated use blob auditing instead . | 123 | 21 |
24,563 | @ Override public void register ( Builder . Registry registry ) { registry . add ( new AzureAdTokenFactory ( ) ) ; registry . add ( MediaContract . class , MediaExceptionProcessor . class ) ; registry . add ( MediaRestProxy . class ) ; registry . add ( OAuthFilter . class ) ; registry . add ( ResourceLocationManager . class ) ; registry . add ( RedirectFilter . class ) ; registry . add ( VersionHeadersFilter . class ) ; registry . add ( UserAgentFilter . class ) ; registry . alter ( MediaContract . class , ClientConfig . class , new Builder . Alteration < ClientConfig > ( ) { @ SuppressWarnings ( "rawtypes" ) @ Override public ClientConfig alter ( String profile , ClientConfig instance , Builder builder , Map < String , Object > properties ) { instance . getProperties ( ) . put ( JSONConfiguration . FEATURE_POJO_MAPPING , true ) ; // Turn off auto-follow redirects, because Media // Services rest calls break if it's on instance . getProperties ( ) . put ( ClientConfig . PROPERTY_FOLLOW_REDIRECTS , false ) ; try { instance . getSingletons ( ) . add ( new ODataEntityProvider ( ) ) ; instance . getSingletons ( ) . add ( new ODataEntityCollectionProvider ( ) ) ; instance . getSingletons ( ) . add ( new MediaContentProvider ( ) ) ; instance . getSingletons ( ) . add ( new BatchMimeMultipartBodyWritter ( ) ) ; } catch ( JAXBException e ) { throw new RuntimeException ( e ) ; } catch ( ParserConfigurationException e ) { throw new RuntimeException ( e ) ; } return instance ; } } ) ; } | register the Media services . | 382 | 5 |
24,564 | public void run ( ) { try { ReceivePump . this . receiveAndProcess ( ) ; } catch ( final Exception exception ) { if ( TRACE_LOGGER . isErrorEnabled ( ) ) { TRACE_LOGGER . error ( String . format ( Locale . US , "Receive pump for eventHub (%s), consumerGroup (%s), partition (%s) " + "encountered unrecoverable error and exited with exception %s." , this . eventHubName , this . consumerGroupName , this . receiver . getPartitionId ( ) , exception . toString ( ) ) ) ; } throw exception ; } } | entry - point - for runnable | 136 | 8 |
24,565 | public void receiveAndProcess ( ) { if ( this . shouldContinue ( ) ) { this . receiver . receive ( this . onReceiveHandler . getMaxEventCount ( ) ) . handleAsync ( this . processAndReschedule , this . executor ) ; } else { if ( TRACE_LOGGER . isInfoEnabled ( ) ) { TRACE_LOGGER . info ( String . format ( Locale . US , "Stopping receive pump for eventHub (%s), consumerGroup (%s), partition (%s) as %s" , this . eventHubName , this . consumerGroupName , this . receiver . getPartitionId ( ) , this . stopPumpRaised . get ( ) ? "per the request." : "pump ran into errors." ) ) ; } this . stopPump . complete ( null ) ; } } | receives and invokes user - callback if success or stops pump if fails | 181 | 16 |
24,566 | public static Authenticated authenticate ( AzureTokenCredentials credentials ) { return new AuthenticatedImpl ( new RestClient . Builder ( ) . withBaseUrl ( credentials . environment ( ) , AzureEnvironment . Endpoint . RESOURCE_MANAGER ) . withCredentials ( credentials ) . withSerializerAdapter ( new AzureJacksonAdapter ( ) ) . withResponseBuilderFactory ( new AzureResponseBuilder . Factory ( ) ) . build ( ) ) ; } | Creates an instance of Azure . Authenticated that exposes subscription tenant and authorization API entry points . | 95 | 19 |
24,567 | public Observable < DataMaskingPolicyInner > getAsync ( String resourceGroupName , String serverName , String databaseName ) { return getWithServiceResponseAsync ( resourceGroupName , serverName , databaseName ) . map ( new Func1 < ServiceResponse < DataMaskingPolicyInner > , DataMaskingPolicyInner > ( ) { @ Override public DataMaskingPolicyInner call ( ServiceResponse < DataMaskingPolicyInner > response ) { return response . body ( ) ; } } ) ; } | Gets a database data masking policy . | 111 | 9 |
24,568 | public Observable < Page < DscNodeConfigurationInner > > listByAutomationAccountNextAsync ( final String nextPageLink ) { return listByAutomationAccountNextWithServiceResponseAsync ( nextPageLink ) . map ( new Func1 < ServiceResponse < Page < DscNodeConfigurationInner > > , Page < DscNodeConfigurationInner > > ( ) { @ Override public Page < DscNodeConfigurationInner > call ( ServiceResponse < Page < DscNodeConfigurationInner > > response ) { return response . body ( ) ; } } ) ; } | Retrieve a list of dsc node configurations . | 123 | 10 |
24,569 | public Observable < List < AssemblyDefinitionInner > > listAsync ( String resourceGroupName , String integrationAccountName ) { return listWithServiceResponseAsync ( resourceGroupName , integrationAccountName ) . map ( new Func1 < ServiceResponse < List < AssemblyDefinitionInner > > , List < AssemblyDefinitionInner > > ( ) { @ Override public List < AssemblyDefinitionInner > call ( ServiceResponse < List < AssemblyDefinitionInner > > response ) { return response . body ( ) ; } } ) ; } | List the assemblies for an integration account . | 111 | 8 |
24,570 | static String parseRoleIdentifier ( final String trackingId ) { if ( StringUtil . isNullOrWhiteSpace ( trackingId ) || ! trackingId . contains ( TRACKING_ID_TOKEN_SEPARATOR ) ) { return null ; } return trackingId . substring ( trackingId . indexOf ( TRACKING_ID_TOKEN_SEPARATOR ) ) ; } | parses ServiceBus role identifiers from trackingId | 83 | 10 |
24,571 | public static MySQLManager authenticate ( AzureTokenCredentials credentials , String subscriptionId ) { return new MySQLManager ( new RestClient . Builder ( ) . withBaseUrl ( credentials . environment ( ) , AzureEnvironment . Endpoint . RESOURCE_MANAGER ) . withCredentials ( credentials ) . withSerializerAdapter ( new AzureJacksonAdapter ( ) ) . withResponseBuilderFactory ( new AzureResponseBuilder . Factory ( ) ) . build ( ) , subscriptionId ) ; } | Creates an instance of MySQLManager that exposes DBforMySQL resource management API entry points . | 101 | 19 |
24,572 | public void delete ( String resourceGroupName , String automationAccountName , UUID jobScheduleId ) { deleteWithServiceResponseAsync ( resourceGroupName , automationAccountName , jobScheduleId ) . toBlocking ( ) . single ( ) . body ( ) ; } | Delete the job schedule identified by job schedule name . | 57 | 10 |
24,573 | public Observable < ApplicationInsightsComponentInner > getByResourceGroupAsync ( String resourceGroupName , String resourceName ) { return getByResourceGroupWithServiceResponseAsync ( resourceGroupName , resourceName ) . map ( new Func1 < ServiceResponse < ApplicationInsightsComponentInner > , ApplicationInsightsComponentInner > ( ) { @ Override public ApplicationInsightsComponentInner call ( ServiceResponse < ApplicationInsightsComponentInner > response ) { return response . body ( ) ; } } ) ; } | Returns an Application Insights component . | 110 | 7 |
24,574 | public static void validate ( Object parameter ) { // Validation of top level payload is done outside if ( parameter == null ) { return ; } Class < ? > type = parameter . getClass ( ) ; if ( type == Double . class || type == Float . class || type == Long . class || type == Integer . class || type == Short . class || type == Character . class || type == Byte . class || type == Boolean . class ) { type = wrapperToPrimitive ( type ) ; } if ( type . isPrimitive ( ) || type . isEnum ( ) || type . isAssignableFrom ( Class . class ) || type . isAssignableFrom ( LocalDate . class ) || type . isAssignableFrom ( OffsetDateTime . class ) || type . isAssignableFrom ( String . class ) || type . isAssignableFrom ( DateTimeRfc1123 . class ) || type . isAssignableFrom ( Duration . class ) ) { return ; } Annotation skipParentAnnotation = type . getAnnotation ( SkipParentValidation . class ) ; // if ( skipParentAnnotation == null ) { for ( Class < ? > c : TypeUtil . getAllClasses ( type ) ) { validateClass ( c , parameter ) ; } } else { validateClass ( type , parameter ) ; } } | Validates a user provided required parameter to be not null . | 288 | 12 |
24,575 | public Observable < DatabaseInner > getAsync ( String resourceGroupName , String serverName , String databaseName , String expand ) { return getWithServiceResponseAsync ( resourceGroupName , serverName , databaseName , expand ) . map ( new Func1 < ServiceResponse < DatabaseInner > , DatabaseInner > ( ) { @ Override public DatabaseInner call ( ServiceResponse < DatabaseInner > response ) { return response . body ( ) ; } } ) ; } | Gets a database . | 101 | 5 |
24,576 | public List < DatabaseInner > listByServer ( String resourceGroupName , String serverName , String expand , String filter ) { return listByServerWithServiceResponseAsync ( resourceGroupName , serverName , expand , filter ) . toBlocking ( ) . single ( ) . body ( ) ; } | Returns a list of databases in a server . | 63 | 9 |
24,577 | public JobExecutionInner get ( String resourceGroupName , String serverName , String jobAgentName , String jobName , UUID jobExecutionId ) { return getWithServiceResponseAsync ( resourceGroupName , serverName , jobAgentName , jobName , jobExecutionId ) . toBlocking ( ) . single ( ) . body ( ) ; } | Gets a job execution . | 76 | 6 |
24,578 | public Observable < VirtualNetworkRuleInner > getAsync ( String resourceGroupName , String accountName , String virtualNetworkRuleName ) { return getWithServiceResponseAsync ( resourceGroupName , accountName , virtualNetworkRuleName ) . map ( new Func1 < ServiceResponse < VirtualNetworkRuleInner > , VirtualNetworkRuleInner > ( ) { @ Override public VirtualNetworkRuleInner call ( ServiceResponse < VirtualNetworkRuleInner > response ) { return response . body ( ) ; } } ) ; } | Gets the specified Data Lake Store virtual network rule . | 110 | 11 |
24,579 | public Observable < Void > cancelAsync ( String resourceGroupName , String registryName , String buildId ) { return cancelWithServiceResponseAsync ( resourceGroupName , registryName , buildId ) . map ( new Func1 < ServiceResponse < Void > , Void > ( ) { @ Override public Void call ( ServiceResponse < Void > response ) { return response . body ( ) ; } } ) ; } | Cancel an existing build . | 86 | 6 |
24,580 | public void loadNextPage ( ) { this . currentPage = cachedPage ; cachedPage = null ; this . items . addAll ( currentPage . items ( ) ) ; cachePage ( currentPage . nextPageLink ( ) ) ; } | Loads a page from next page link . The exceptions are wrapped into Java Runtime exceptions . | 50 | 18 |
24,581 | protected void setCurrentPage ( Page < E > currentPage ) { this . currentPage = currentPage ; List < E > retrievedItems = currentPage . items ( ) ; if ( retrievedItems != null ) { items . addAll ( retrievedItems ) ; } cachePage ( currentPage . nextPageLink ( ) ) ; } | Sets the current page . | 68 | 6 |
24,582 | @ Beta public void putCustomEventMapping ( final String eventType , final Type eventDataType ) { if ( eventType == null || eventType . isEmpty ( ) ) { throw new IllegalArgumentException ( "eventType parameter is required and cannot be null or empty" ) ; } if ( eventDataType == null ) { throw new IllegalArgumentException ( "eventDataType parameter is required and cannot be null" ) ; } this . eventTypeToEventDataMapping . put ( canonicalizeEventType ( eventType ) , eventDataType ) ; } | Add a custom event mapping . If a mapping with same eventType exists then the old eventDataType is replaced by the specified eventDataType . | 119 | 29 |
24,583 | @ Beta public Type getCustomEventMapping ( final String eventType ) { if ( ! containsCustomEventMappingFor ( eventType ) ) { return null ; } else { return this . eventTypeToEventDataMapping . get ( canonicalizeEventType ( eventType ) ) ; } } | Get type of the Java model that is mapped to the given eventType . | 62 | 15 |
24,584 | @ Beta public boolean removeCustomEventMapping ( final String eventType ) { if ( ! containsCustomEventMappingFor ( eventType ) ) { return false ; } else { this . eventTypeToEventDataMapping . remove ( canonicalizeEventType ( eventType ) ) ; return true ; } } | Removes the mapping with the given eventType . | 64 | 10 |
24,585 | @ Beta public boolean containsCustomEventMappingFor ( final String eventType ) { if ( eventType == null || eventType . isEmpty ( ) ) { return false ; } else { return this . eventTypeToEventDataMapping . containsKey ( canonicalizeEventType ( eventType ) ) ; } } | Checks if an event mapping with the given eventType exists . | 65 | 13 |
24,586 | @ Beta public EventGridEvent [ ] deserializeEventGridEvents ( final String requestContent , final SerializerAdapter < ObjectMapper > serializerAdapter ) throws IOException { EventGridEvent [ ] eventGridEvents = serializerAdapter . < EventGridEvent [ ] > deserialize ( requestContent , EventGridEvent [ ] . class ) ; for ( EventGridEvent receivedEvent : eventGridEvents ) { if ( receivedEvent . data ( ) == null ) { continue ; } else { final String eventType = receivedEvent . eventType ( ) ; final Type eventDataType ; if ( SystemEventTypeMappings . containsMappingFor ( eventType ) ) { eventDataType = SystemEventTypeMappings . getMapping ( eventType ) ; } else if ( containsCustomEventMappingFor ( eventType ) ) { eventDataType = getCustomEventMapping ( eventType ) ; } else { eventDataType = null ; } if ( eventDataType != null ) { final String eventDataAsString = serializerAdapter . serializeRaw ( receivedEvent . data ( ) ) ; final Object eventData = serializerAdapter . < Object > deserialize ( eventDataAsString , eventDataType ) ; setEventData ( receivedEvent , eventData ) ; } } } return eventGridEvents ; } | De - serialize the events in the given requested content using the provided de - serializer . | 276 | 19 |
24,587 | public Observable < ApplicationInsightsComponentAvailableFeaturesInner > getAsync ( String resourceGroupName , String resourceName ) { return getWithServiceResponseAsync ( resourceGroupName , resourceName ) . map ( new Func1 < ServiceResponse < ApplicationInsightsComponentAvailableFeaturesInner > , ApplicationInsightsComponentAvailableFeaturesInner > ( ) { @ Override public ApplicationInsightsComponentAvailableFeaturesInner call ( ServiceResponse < ApplicationInsightsComponentAvailableFeaturesInner > response ) { return response . body ( ) ; } } ) ; } | Returns all available features of the application insights component . | 114 | 10 |
24,588 | public Observable < List < RestorableDroppedDatabaseInner > > listByServerAsync ( String resourceGroupName , String serverName ) { return listByServerWithServiceResponseAsync ( resourceGroupName , serverName ) . map ( new Func1 < ServiceResponse < List < RestorableDroppedDatabaseInner > > , List < RestorableDroppedDatabaseInner > > ( ) { @ Override public List < RestorableDroppedDatabaseInner > call ( ServiceResponse < List < RestorableDroppedDatabaseInner > > response ) { return response . body ( ) ; } } ) ; } | Gets a list of deleted databases that can be restored . | 128 | 12 |
24,589 | public static ComputerVisionClient authenticate ( ServiceClientCredentials credentials , String endpoint ) { return authenticate ( "https://{endpoint}/vision/v2.0/" , credentials ) . withEndpoint ( endpoint ) ; } | Initializes an instance of Computer Vision API client . | 50 | 10 |
24,590 | public Observable < OperationStatus > deleteAsync ( UUID appId , String versionId , int exampleId ) { return deleteWithServiceResponseAsync ( appId , versionId , exampleId ) . map ( new Func1 < ServiceResponse < OperationStatus > , OperationStatus > ( ) { @ Override public OperationStatus call ( ServiceResponse < OperationStatus > response ) { return response . body ( ) ; } } ) ; } | Deletes the labeled example with the specified ID . | 90 | 10 |
24,591 | public static byte [ ] encodeURLWithoutPadding ( byte [ ] src ) { return src == null ? null : Base64 . getUrlEncoder ( ) . withoutPadding ( ) . encode ( src ) ; } | Encodes a byte array to base64 URL format . | 46 | 11 |
24,592 | public static String encodeToString ( byte [ ] src ) { return src == null ? null : Base64 . getEncoder ( ) . encodeToString ( src ) ; } | Encodes a byte array to a base 64 string . | 37 | 11 |
24,593 | public static byte [ ] decodeString ( String encoded ) { return encoded == null ? null : Base64 . getDecoder ( ) . decode ( encoded ) ; } | Decodes a base64 encoded string . | 34 | 8 |
24,594 | public Observable < DatabaseSecurityAlertPolicyInner > getAsync ( String resourceGroupName , String serverName , String databaseName ) { return getWithServiceResponseAsync ( resourceGroupName , serverName , databaseName ) . map ( new Func1 < ServiceResponse < DatabaseSecurityAlertPolicyInner > , DatabaseSecurityAlertPolicyInner > ( ) { @ Override public DatabaseSecurityAlertPolicyInner call ( ServiceResponse < DatabaseSecurityAlertPolicyInner > response ) { return response . body ( ) ; } } ) ; } | Gets a database s threat detection policy . | 111 | 9 |
24,595 | public Observable < DatabaseSecurityAlertPolicyInner > createOrUpdateAsync ( String resourceGroupName , String serverName , String databaseName , DatabaseSecurityAlertPolicyInner parameters ) { return createOrUpdateWithServiceResponseAsync ( resourceGroupName , serverName , databaseName , parameters ) . map ( new Func1 < ServiceResponse < DatabaseSecurityAlertPolicyInner > , DatabaseSecurityAlertPolicyInner > ( ) { @ Override public DatabaseSecurityAlertPolicyInner call ( ServiceResponse < DatabaseSecurityAlertPolicyInner > response ) { return response . body ( ) ; } } ) ; } | Creates or updates a database s threat detection policy . | 125 | 11 |
24,596 | public static List < Class < ? > > getAllClasses ( Class < ? > clazz ) { List < Class < ? > > types = new ArrayList <> ( ) ; while ( clazz != null ) { types . add ( clazz ) ; clazz = clazz . getSuperclass ( ) ; } return types ; } | Find all super classes including provided class . | 72 | 8 |
24,597 | public static Type [ ] getTypeArguments ( Type type ) { if ( ! ( type instanceof ParameterizedType ) ) { return new Type [ 0 ] ; } return ( ( ParameterizedType ) type ) . getActualTypeArguments ( ) ; } | Get the generic arguments for a type . | 57 | 8 |
24,598 | public static Type getTypeArgument ( Type type ) { if ( ! ( type instanceof ParameterizedType ) ) { return null ; } return ( ( ParameterizedType ) type ) . getActualTypeArguments ( ) [ 0 ] ; } | Get the generic argument or the first if the type has more than one . | 54 | 15 |
24,599 | public static Type getSuperType ( Type type ) { if ( type instanceof ParameterizedType ) { ParameterizedType parameterizedType = ( ParameterizedType ) type ; Type genericSuperClass = ( ( Class < ? > ) parameterizedType . getRawType ( ) ) . getGenericSuperclass ( ) ; if ( genericSuperClass instanceof ParameterizedType ) { /* * Find erased generic types for the super class and replace * with actual type arguments from the parameterized type */ Type [ ] superTypeArguments = getTypeArguments ( genericSuperClass ) ; List < Type > typeParameters = Arrays . asList ( ( ( Class < ? > ) parameterizedType . getRawType ( ) ) . getTypeParameters ( ) ) ; int j = 0 ; for ( int i = 0 ; i != superTypeArguments . length ; i ++ ) { if ( typeParameters . contains ( superTypeArguments [ i ] ) ) { superTypeArguments [ i ] = parameterizedType . getActualTypeArguments ( ) [ j ++ ] ; } } return new ParameterizedType ( ) { @ Override public Type [ ] getActualTypeArguments ( ) { return superTypeArguments ; } @ Override public Type getRawType ( ) { return ( ( ParameterizedType ) genericSuperClass ) . getRawType ( ) ; } @ Override public Type getOwnerType ( ) { return null ; } } ; } else { return genericSuperClass ; } } else { return ( ( Class < ? > ) type ) . getGenericSuperclass ( ) ; } } | Get the super type for a given type . | 341 | 9 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.