idx
int64
0
41.2k
question
stringlengths
73
5.81k
target
stringlengths
5
918
27,400
public TaxRate update ( Map < String , Object > params ) throws StripeException { return update ( params , ( RequestOptions ) null ) ; }
Updates an existing tax rate .
27,401
public static Dispute retrieve ( String dispute ) throws StripeException { return retrieve ( dispute , ( Map < String , Object > ) null , ( RequestOptions ) null ) ; }
Retrieves the dispute with the given ID .
27,402
public Dispute close ( ) throws StripeException { return close ( ( Map < String , Object > ) null , ( RequestOptions ) null ) ; }
Closing the dispute for a charge indicates that you do not have any evidence to submit and are essentially dismissing the dispute acknowledging it as lost .
27,403
public static IssuerFraudRecord retrieve ( String issuerFraudRecord ) throws StripeException { return retrieve ( issuerFraudRecord , ( Map < String , Object > ) null , ( RequestOptions ) null ) ; }
Retrieves the details of an issuer fraud record that has previously been created .
27,404
public static WebhookEndpoint retrieve ( String webhookEndpoint ) throws StripeException { return retrieve ( webhookEndpoint , ( Map < String , Object > ) null , ( RequestOptions ) null ) ; }
Retrieves the webhook endpoint with the given ID .
27,405
public static SubscriptionSchedule retrieve ( String schedule ) throws StripeException { return retrieve ( schedule , ( Map < String , Object > ) null , ( RequestOptions ) null ) ; }
Retrieves the details of an existing subscription schedule . You only need to supply the unique subscription schedule identifier that was returned upon subscription schedule creation .
27,406
public static LoginLink createOnAccount ( String account , Map < String , Object > params , RequestOptions options ) throws StripeException { String url = String . format ( "%s%s" , Stripe . getApiBase ( ) , String . format ( "/v1/accounts/%s/login_links" , ApiResource . urlEncodeId ( account ) ) ) ; return request ( A...
Creates a single - use login link for an Express account to access their Stripe dashboard .
27,407
public static Session retrieve ( String session ) throws StripeException { return retrieve ( session , ( Map < String , Object > ) null , ( RequestOptions ) null ) ; }
Retrieves a Session object .
27,408
public static ScheduledQueryRun retrieve ( String scheduledQueryRun ) throws StripeException { return retrieve ( scheduledQueryRun , ( Map < String , Object > ) null , ( RequestOptions ) null ) ; }
Retrieves the details of an scheduled query run .
27,409
public static Source retrieve ( String source ) throws StripeException { return retrieve ( source , ( Map < String , Object > ) null , ( RequestOptions ) null ) ; }
Retrieves an existing source object . Supply the unique source ID from a source creation request and Stripe will return the corresponding up - to - date source object information .
27,410
public Source verify ( Map < String , Object > params ) throws StripeException { return verify ( params , ( RequestOptions ) null ) ; }
Verify a given source .
27,411
public static Account retrieve ( RequestOptions options ) throws StripeException { return retrieve ( ( Map < String , Object > ) null , options ) ; }
Retrieves the details of an account .
27,412
public static Payout retrieve ( String payout ) throws StripeException { return retrieve ( payout , ( Map < String , Object > ) null , ( RequestOptions ) null ) ; }
Retrieves the details of an existing payout . Supply the unique payout ID from either a payout creation request or the payout list and Stripe will return the corresponding payout information .
27,413
public String get ( String name ) { List < String > valuesList = values ( name ) ; String value = null ; if ( valuesList != null && valuesList . size ( ) > 0 ) { value = valuesList . get ( 0 ) ; } return value ; }
Returns the first header value for a given key .
27,414
public static UsageRecord createOnSubscriptionItem ( String subscriptionItem , Map < String , Object > params , RequestOptions options ) throws StripeException { String url = String . format ( "%s%s" , Stripe . getApiBase ( ) , String . format ( "/v1/subscription_items/%s/usage_records" , ApiResource . urlEncodeId ( su...
Creates a usage record for a specified subscription item and date and fills it with a quantity .
27,415
public TransferReversal update ( Map < String , Object > params , RequestOptions options ) throws StripeException { String url ; if ( this . getTransfer ( ) != null ) { url = String . format ( "%s%s" , Stripe . getApiBase ( ) , String . format ( "/v1/transfers/%s/reversals/%s" , ApiResource . urlEncodeId ( this . getTr...
Updates the specified reversal by setting the values of the parameters passed . Any parameters not provided will be left unchanged .
27,416
public static Coupon retrieve ( String coupon , RequestOptions options ) throws StripeException { return retrieve ( coupon , ( Map < String , Object > ) null , options ) ; }
Retrieves the coupon with the given ID .
27,417
public static Topup create ( Map < String , Object > params ) throws StripeException { return create ( params , ( RequestOptions ) null ) ; }
Top up the balance of an account .
27,418
public static Topup retrieve ( String topup ) throws StripeException { return retrieve ( topup , ( Map < String , Object > ) null , ( RequestOptions ) null ) ; }
Retrieves the details of a top - up that has previously been created . Supply the unique top - up ID that was returned from your previous request and Stripe will return the corresponding top - up information .
27,419
public static CountrySpec retrieve ( String country ) throws StripeException { return retrieve ( country , ( Map < String , Object > ) null , ( RequestOptions ) null ) ; }
Returns a Country Spec for a given Country code .
27,420
public static PaymentIntent retrieve ( String intent ) throws StripeException { return retrieve ( intent , ( Map < String , Object > ) null , ( RequestOptions ) null ) ; }
Retrieves the details of a PaymentIntent that has previously been created .
27,421
public PaymentIntent confirm ( ) throws StripeException { return confirm ( ( Map < String , Object > ) null , ( RequestOptions ) null ) ; }
Confirm that your customer intends to pay with current or provided payment method . Upon confirmation the PaymentIntent will attempt to initiate a payment .
27,422
public static Invoice upcoming ( ) throws StripeException { return upcoming ( ( Map < String , Object > ) null , ( RequestOptions ) null ) ; }
At any time you can preview the upcoming invoice for a customer . This will show you all the charges that are pending including subscription renewal charges invoice item charges etc . It will also show you any discount that is applicable to the customer .
27,423
public static Invoice retrieve ( String invoice ) throws StripeException { return retrieve ( invoice , ( Map < String , Object > ) null , ( RequestOptions ) null ) ; }
Retrieves the invoice with the given ID .
27,424
public Invoice markUncollectible ( ) throws StripeException { return markUncollectible ( ( Map < String , Object > ) null , ( RequestOptions ) null ) ; }
Marking an invoice as uncollectible is useful for keeping track of bad debts that can be written off for accounting purposes .
27,425
public static Charge retrieve ( String charge ) throws StripeException { return retrieve ( charge , ( Map < String , Object > ) null , ( RequestOptions ) null ) ; }
Retrieves the details of a charge that has previously been created . Supply the unique charge ID that was returned from your previous request and Stripe will return the corresponding charge information . The same information is returned when creating or refunding the charge .
27,426
public static ExchangeRate retrieve ( String currency ) throws StripeException { return retrieve ( currency , ( Map < String , Object > ) null , ( RequestOptions ) null ) ; }
Retrieves the exchange rates from the given currency to every supported currency .
27,427
public static ThreeDSecure retrieve ( String threeDSecure ) throws StripeException { return retrieve ( threeDSecure , ( Map < String , Object > ) null , ( RequestOptions ) null ) ; }
Retrieves a 3D Secure object .
27,428
public static PaymentMethod retrieve ( String paymentMethod , RequestOptions options ) throws StripeException { return retrieve ( paymentMethod , ( Map < String , Object > ) null , options ) ; }
Retrieves a PaymentMethod object .
27,429
public PaymentMethod attach ( Map < String , Object > params ) throws StripeException { return attach ( params , ( RequestOptions ) null ) ; }
Attaches a PaymentMethod object to a Customer .
27,430
public PaymentMethod detach ( RequestOptions options ) throws StripeException { return detach ( ( Map < String , Object > ) null , options ) ; }
Detaches a PaymentMethod object from a Customer .
27,431
public static Transfer retrieve ( String transfer ) throws StripeException { return retrieve ( transfer , ( Map < String , Object > ) null , ( RequestOptions ) null ) ; }
Retrieves the details of an existing transfer . Supply the unique transfer ID from either a transfer creation request or the transfer list and Stripe will return the corresponding transfer information .
27,432
public static Subscription retrieve ( String subscriptionExposedId ) throws StripeException { return retrieve ( subscriptionExposedId , ( Map < String , Object > ) null , ( RequestOptions ) null ) ; }
Retrieves the subscription with the given ID .
27,433
public static void setAppInfo ( String name , String version , String url , String partnerId ) { if ( appInfo == null ) { appInfo = new HashMap < String , String > ( ) ; } appInfo . put ( "name" , name ) ; appInfo . put ( "version" , version ) ; appInfo . put ( "url" , url ) ; appInfo . put ( "partner_id" , partnerId )...
Sets information about your application . The information is passed along to Stripe .
27,434
public TaxIdCollection list ( TaxIdCollectionListParams params , RequestOptions options ) throws StripeException { String url = String . format ( "%s%s" , Stripe . getApiBase ( ) , this . getUrl ( ) ) ; return ApiResource . requestCollection ( url , params , TaxIdCollection . class , options ) ; }
Returns a list of tax IDs for a customer .
27,435
public static Token retrieve ( String token ) throws StripeException { return retrieve ( token , ( Map < String , Object > ) null , ( RequestOptions ) null ) ; }
Retrieves the token with the given ID .
27,436
public static CreditNote retrieve ( String id , RequestOptions options ) throws StripeException { return retrieve ( id , ( Map < String , Object > ) null , options ) ; }
Retrieves the credit note object with the given identifier .
27,437
public EphemeralKey delete ( RequestOptions options ) throws StripeException { return request ( RequestMethod . DELETE , instanceUrl ( EphemeralKey . class , this . id ) , ( Map < String , Object > ) null , EphemeralKey . class , options ) ; }
Invalidates an ephemeral API key for a given resource .
27,438
public static String urlEncodeId ( String id ) throws InvalidRequestException { try { return urlEncode ( id ) ; } catch ( UnsupportedEncodingException e ) { throw new InvalidRequestException ( String . format ( "Unable to encode `%s` in the url to %s. " + "Please contact support@stripe.com for assistance." , id , CHARS...
URL - encode a string ID in url path formatting .
27,439
public static void checkNullTypedParams ( String url , ApiRequestParams params ) { if ( params == null ) { throw new IllegalArgumentException ( String . format ( "Found null params for %s. " + "Please pass empty params using param builder via `builder().build()` instead." , url ) ) ; } }
Invalidate null typed parameters .
27,440
public static < T extends HasId > ExpandableField < T > setExpandableFieldId ( String newId , ExpandableField < T > currentObject ) { if ( currentObject == null || ( currentObject . isExpanded ( ) && ! Objects . equals ( currentObject . getId ( ) , newId ) ) ) { return new ExpandableField < > ( newId , null ) ; } retur...
When setting a String ID for an ExpandableField we need to be careful about keeping the String ID and the expanded object in sync . If they specify a new String ID that is different from the ID within the expanded object we don t keep the object .
27,441
public Iterable < T > autoPagingIterable ( Map < String , Object > params , RequestOptions options ) { this . setRequestOptions ( options ) ; this . setRequestParams ( params ) ; return new PagingIterable < > ( this ) ; }
Constructs an iterable that can be used to iterate across all objects across all pages . As page boundaries are encountered the next page will be fetched automatically for continued iteration .
27,442
public void addFileField ( String name , String fileName , InputStream inputStream ) throws IOException { writer . append ( "--" ) . append ( boundary ) . append ( LINE_BREAK ) ; writer . append ( "Content-Disposition: form-data; name=\"" ) . append ( name ) . append ( "\"; filename=\"" ) . append ( fileName ) . append...
Adds a file field to the multipart message but takes in an InputStream instead of just a file to read bytes from .
27,443
private void streamToOutput ( InputStream inputStream ) throws IOException { try { byte [ ] buffer = new byte [ 4096 ] ; int bytesRead = - 1 ; while ( ( bytesRead = inputStream . read ( buffer ) ) != - 1 ) { outputStream . write ( buffer , 0 , bytesRead ) ; } outputStream . flush ( ) ; } finally { inputStream . close (...
Utility method to read all the bytes from an InputStream into the outputStream .
27,444
public void finish ( ) throws IOException { writer . append ( "--" + boundary + "--" ) . append ( LINE_BREAK ) ; writer . flush ( ) ; writer . close ( ) ; outputStream . flush ( ) ; outputStream . close ( ) ; }
Adds the final boundary to the multipart message and closes streams .
27,445
public static String authorizeUrl ( Map < String , Object > params , RequestOptions options ) throws AuthenticationException , InvalidRequestException { final String base = Stripe . getConnectBase ( ) ; params . put ( "client_id" , getClientId ( params , options ) ) ; if ( params . get ( "response_type" ) == null ) { p...
Generates a URL to Stripe s OAuth form .
27,446
public static TokenResponse token ( Map < String , Object > params , RequestOptions options ) throws StripeException { String url = Stripe . getConnectBase ( ) + "/oauth/token" ; return OAuth . stripeResponseGetter . oauthRequest ( ApiResource . RequestMethod . POST , url , params , TokenResponse . class , ApiResource ...
Uses an authorization code to connect an account to your platform and fetch the user s credentials .
27,447
public static DeauthorizedAccount deauthorize ( Map < String , Object > params , RequestOptions options ) throws StripeException { String url = Stripe . getConnectBase ( ) + "/oauth/deauthorize" ; params . put ( "client_id" , getClientId ( params , options ) ) ; return OAuth . stripeResponseGetter . oauthRequest ( ApiR...
Disconnects an account from your platform .
27,448
private static String getClientId ( Map < String , Object > params , RequestOptions options ) throws AuthenticationException { String clientId = Stripe . clientId ; if ( ( options != null ) && ( options . getClientId ( ) != null ) ) { clientId = options . getClientId ( ) ; } if ( ( params != null ) && ( params . get ( ...
Returns the client_id to use in OAuth requests .
27,449
public static FileLink retrieve ( String link ) throws StripeException { return retrieve ( link , ( Map < String , Object > ) null , ( RequestOptions ) null ) ; }
Retrieves the file link with the given ID .
27,450
public static InvoiceItem retrieve ( String invoiceitem ) throws StripeException { return retrieve ( invoiceitem , ( Map < String , Object > ) null , ( RequestOptions ) null ) ; }
Retrieves the invoice item with the given ID .
27,451
public static ApplePayDomain retrieve ( String domain ) throws StripeException { return retrieve ( domain , ( Map < String , Object > ) null , ( RequestOptions ) null ) ; }
Retrieve an apple pay domain .
27,452
public static Plan retrieve ( String plan ) throws StripeException { return retrieve ( plan , ( Map < String , Object > ) null , ( RequestOptions ) null ) ; }
Retrieves the plan with the given ID .
27,453
public void registerBeanDefinitions ( final AnnotationMetadata importingClassMetadata , final BeanDefinitionRegistry registry ) { Map < String , Object > componentScan = importingClassMetadata . getAnnotationAttributes ( RemoteApplicationEventScan . class . getName ( ) , false ) ; Set < String > basePackages = new Hash...
patterned after Spring Integration IntegrationComponentScanRegistrar
27,454
@ ConditionalOnMissingBean ( name = "busJsonConverter" ) public AbstractMessageConverter busJsonConverter ( @ Autowired ( required = false ) ObjectMapper objectMapper ) { return new BusJacksonMessageConverter ( objectMapper ) ; }
otherwise RemoteApplicationEventRegistrar will register the bean
27,455
private void computeChartSteps ( ) { if ( chartType == GraphPanelChart . CHART_PERCENTAGE ) { minYVal = 0 ; maxYVal = 100 ; return ; } if ( maxYVal - minYVal < 0.1 ) { maxYVal = minYVal + 1 ; } double step = ( maxYVal - minYVal ) / gridLinesCount ; int pow = - 1 ; double factor = - 1 ; boolean found = false ; double te...
compute minY and step value to have better readable charts
27,456
private void paintAd ( Graphics2D g ) { Font oldFont = g . getFont ( ) ; g . setFont ( g . getFont ( ) . deriveFont ( 10F ) ) ; g . setColor ( axisColor ) ; Composite oldComposite = g . getComposite ( ) ; g . setComposite ( AlphaComposite . getInstance ( AlphaComposite . SRC_OVER , 0.7f ) ) ; g . drawString ( AD_TEXT ,...
Paint the add the same color of the axis but with transparency
27,457
private void registerPopup ( boolean allowCsvExport ) { this . setComponentPopupMenu ( popup ) ; JMenuItem itemCopy = new JMenuItem ( "Copy Image to Clipboard" ) ; itemCopy . setIcon ( new javax . swing . ImageIcon ( getClass ( ) . getResource ( "/kg/apc/jmeter/img/copy.png" ) ) ) ; JMenuItem itemSave = new JMenuItem (...
Thanks to stephane . hoblingre
27,458
public void stateChanged ( ChangeEvent e ) { log . debug ( "getting new collector" ) ; collector = ( CorrectedResultCollector ) createTestElement ( ) ; if ( collector instanceof CorrectedResultCollector ) { setUpFiltering ( ( CorrectedResultCollector ) collector ) ; } collector . loadExistingFile ( ) ; }
Invoked when the target of the listener has changed its state . This implementation assumes that the target is the FilePanel and will update the result collector for the new filename .
27,459
public String setValue ( String value ) { String result = this . value ; this . value = value ; calculateCompareKey ( ) ; return result ; }
Property value setter .
27,460
protected ListedHashTree cloneTree ( ListedHashTree tree ) { TreeCloner cloner = new TreeCloner ( true ) ; tree . traverse ( cloner ) ; ListedHashTree clonedTree = cloner . getClonedTree ( ) ; if ( ! clonedTree . isEmpty ( ) ) { Object firstElement = clonedTree . getArray ( ) [ 0 ] ; Controller samplerController = ( ( ...
had to copy it from ThreadGroup
27,461
private void syncContext ( boolean isInit ) { JMeterContext current = JMeterContextService . getContext ( ) ; JMeterContext ctx = this . getThreadContext ( ) ; if ( isInit ) { current . setCurrentSampler ( ctx . getCurrentSampler ( ) ) ; current . setEngine ( ctx . getEngine ( ) ) ; current . setRestartNextLoop ( ctx ....
Update the worker thread jmeter context with the main thread one
27,462
public void replaceRowTab ( String tabLabel , Component object , String toolTipText ) { int index = indexOfComponent ( rowsTab ) ; remove ( index ) ; ImageIcon rowsIcon = createImageIcon ( "/kg/apc/jmeter/img/checks.png" ) ; insertTab ( tabLabel , rowsIcon , object , toolTipText , index ) ; }
Method used only for change row selector tab in Composite Chart
27,463
public void stop ( ) { running = false ; threadStarter . interrupt ( ) ; for ( DynamicThread thread : threads ) { thread . interrupt ( ) ; thread . interruptOSThread ( ) ; } }
Forceful stop of test calls this
27,464
protected double getCurrentRate ( ) { long rampUp = owner . getRampUpSeconds ( ) ; long hold = owner . getHoldSeconds ( ) ; long steps = owner . getStepsAsLong ( ) ; double throughput = owner . getTargetLevelFactored ( ) ; double timeOffset = rollingTime / 1000.0 - startTime ; if ( timeOffset >= rampUp + hold ) { retur...
ported from Taurus PBench module
27,465
public static String buildHelpPageUrl ( String helpPage ) { try { if ( helpPage . matches ( "[hH][tT][tT][pP][sS]?://.*" ) ) { log . debug ( "Help page URL found, skipping building link to " + WIKI_BASE ) ; return helpPage ; } } catch ( PatternSyntaxException ex ) { log . warn ( "Invalid regex" , ex ) ; } if ( helpPage...
Builds full URL from wiki page name unless a URL is already passed in .
27,466
public static Component addHelpLinkToPanel ( Container panel , String helpPage ) { if ( ! java . awt . Desktop . isDesktopSupported ( ) ) { return panel ; } JLabel icon = new JLabel ( ) ; icon . setIcon ( new javax . swing . ImageIcon ( JMeterPluginsUtils . class . getResource ( "vizualizers/information.png" ) ) ) ; JL...
Find in panel appropriate place and put hyperlink there . I know that it is stupid way . But the result is so good!
27,467
private static void initializeProperties ( ) { JMeterUtils . loadJMeterProperties ( JMeterUtils . getJMeterHome ( ) + File . separator + "bin" + File . separator + "jmeter.properties" ) ; JMeterUtils . initLocale ( ) ; Properties jmeterProps = JMeterUtils . getJMeterProperties ( ) ; String userProp = JMeterUtils . getP...
Had to copy this method from JMeter class cause they provide no ways to re - use this code
27,468
public void scheduleThread ( JMeterThread thread ) { if ( System . currentTimeMillis ( ) - tgStartTime > TOLERANCE ) { tgStartTime = System . currentTimeMillis ( ) ; } scheduleThread ( thread , tgStartTime ) ; }
JMeter 2 . 7 compatibility
27,469
void checkNeedsPropertiesReloading ( long now ) { if ( CACHING_VALIDITY_MS > 0 && now - lastCachedTime > CACHING_VALIDITY_MS ) { this . rampUp = owner . getRampUpSeconds ( ) ; this . hold = owner . getHoldSeconds ( ) ; this . steps = owner . getStepsAsLong ( ) ; this . maxConcurr = owner . getTargetLevelAsDouble ( ) ; ...
Check if we need to reload properties
27,470
private void initGui ( ) { totalThreads . setText ( "100" ) ; initialDelay . setText ( "0" ) ; incUserCount . setText ( "10" ) ; incUserCountBurst . setText ( "0" ) ; incUserPeriod . setText ( "30" ) ; flightTime . setText ( "60" ) ; decUserCount . setText ( "5" ) ; decUserPeriod . setText ( "1" ) ; rampUp . setText ( ...
Initialise the gui field values
27,471
public void paintBorder ( Component c , Graphics g , int x , int y , int width , int height ) { float x2 = ( width - component . getWidth ( ) ) * component . getAlignmentX ( ) + x ; float y2 = ( height - component . getHeight ( ) ) * component . getAlignmentY ( ) + y ; component . setLocation ( ( int ) x2 , ( int ) y2 ...
In this case a real component is to be painted . Setting the location of the component will cause it to be painted at that location .
27,472
private void determineInsetsAndAlignment ( ) { borderInsets = new Insets ( 0 , 0 , 0 , 0 ) ; if ( edge == Edge . TOP ) { borderInsets . top = component . getPreferredSize ( ) . height + gap ; component . setAlignmentX ( alignment ) ; component . setAlignmentY ( 0.0f ) ; } else if ( edge == Edge . BOTTOM ) { borderInset...
The insets need to be determined so they are included in the preferred size of the component the Border is attached to .
27,473
public void waitThreadStopped ( ) { long sleepTime = threads . isEmpty ( ) ? DEFAULT_TEMPORISATION : MIN_CHECK_TIME ; lock . lock ( ) ; try { condition . await ( sleepTime , TimeUnit . MILLISECONDS ) ; } catch ( InterruptedException e ) { log . debug ( "Interrupted" , e ) ; Thread . currentThread ( ) . interrupt ( ) ; ...
If threads is empty we wait on condition for DEFAULT_TEMPORISATION millis to be notified otherwise we wait for 1s
27,474
public void generateSample ( double value , String label ) { PerfMonSampleResult res = new PerfMonSampleResult ( ) ; res . setSampleLabel ( label ) ; res . setValue ( value ) ; res . setSuccessful ( true ) ; SampleEvent e = new SampleEvent ( res , PERFMON ) ; super . sampleOccurred ( e ) ; }
need floating point precision for memory and cpu
27,475
public void generate2Samples ( long [ ] values , String label1 , String label2 , double dividingFactor ) { if ( oldValues . containsKey ( label1 ) && oldValues . containsKey ( label2 ) ) { generateSample ( ( ( double ) ( values [ 0 ] - oldValues . get ( label1 ) ) ) / dividingFactor , label1 ) ; generateSample ( ( ( do...
float precision required for net io
27,476
public void stop ( ) { try { safeClose ( myServerSocket ) ; closeAllConnections ( ) ; myThread . join ( ) ; } catch ( Exception e ) { e . printStackTrace ( ) ; } }
Stop the server .
27,477
private void compileColumns ( ) { log . debug ( "Compiling columns string: " + getColumns ( ) ) ; String [ ] chunks = JMeterPluginsUtils . replaceRNT ( getColumns ( ) ) . split ( "\\|" ) ; log . debug ( "Chunks " + chunks . length ) ; compiledFields = new int [ chunks . length ] ; compiledVars = new int [ chunks . leng...
making this once to be efficient and avoid manipulating strings in switch operators
27,478
static ObjectTableModel createObjectTableModel ( ) { return new ObjectTableModel ( COLUMNS , SamplingStatCalculator . class , new Functor [ ] { new Functor ( "getLabel" ) , new Functor ( "getCount" ) , new Functor ( "getMeanAsNumber" ) , new Functor ( "getMin" ) , new Functor ( "getMax" ) , new Functor ( "getPercentPoi...
Creates that Table model
27,479
public static List < List < Object > > getAllTableData ( ObjectTableModel model , Format [ ] formats ) { List < List < Object > > data = new ArrayList < > ( ) ; if ( model . getRowCount ( ) > 0 ) { for ( int rw = 0 ; rw < model . getRowCount ( ) ; rw ++ ) { int cols = model . getColumnCount ( ) ; List < Object > column...
We use this method to get the data since we are using ObjectTableModel so the calling getDataVector doesn t work as expected .
27,480
public static DefaultTableModel getAllDataAsTable ( ObjectTableModel model , Format [ ] formats , String [ ] columns ) { final List < List < Object > > table = getAllTableData ( model , formats ) ; final DefaultTableModel tableModel = new DefaultTableModel ( ) ; for ( String header : columns ) { tableModel . addColumn ...
Present data in javax . swing . table . DefaultTableModel form .
27,481
public synchronized long delay ( ) { while ( true ) { long curTimeMs = System . currentTimeMillis ( ) ; long millisSinceLastSecond = curTimeMs % 1000 ; long nowInMsRoundedAtSec = curTimeMs - millisSinceLastSecond ; checkNextSecond ( nowInMsRoundedAtSec ) ; int delayMs = getDelay ( millisSinceLastSecond ) ; if ( stoppin...
Internally handles that delay for caller thread
27,482
protected String changeCase ( String originalString , String mode ) { String targetString = originalString ; CaseFormatMode changeCaseMode = CaseFormatMode . get ( mode . toUpperCase ( ) ) ; if ( changeCaseMode != null ) { switch ( changeCaseMode ) { case LOWER_CAMEL_CASE : targetString = camelFormat ( originalString ,...
Change case options
27,483
private static String camelFormat ( String str , boolean isFirstCapitalized ) { StringBuilder builder = new StringBuilder ( str . length ( ) ) ; String [ ] tokens = NOT_ALPHANUMERIC_REGEX . split ( str ) ; for ( int i = 0 ; i < tokens . length ; i ++ ) { String lowerCased = StringUtils . lowerCase ( tokens [ i ] ) ; if...
Camel format string
27,484
private static String caseFormatWithDelimiter ( String str , String delimiter , boolean isAllUpper , boolean isAllLower ) { StringBuilder builder = new StringBuilder ( str . length ( ) ) ; String [ ] tokens = NOT_ALPHANUMERIC_REGEX . split ( str ) ; boolean shouldAddDelimiter = StringUtils . isNotEmpty ( delimiter ) ; ...
Change case using delimiter between words
27,485
private final void addVariableValue ( String value , String variableName ) { if ( StringUtils . isNotEmpty ( variableName ) ) { JMeterVariables vars = getVariables ( ) ; if ( vars != null ) { vars . put ( variableName , value ) ; } } }
Store value in a variable
27,486
private void copyPrivateRawResourceToPubliclyAccessibleFile ( ) { InputStream inputStream = null ; FileOutputStream outputStream = null ; try { inputStream = getResources ( ) . openRawResource ( R . raw . robot ) ; outputStream = openFileOutput ( SHARED_FILE_NAME , Context . MODE_WORLD_READABLE | Context . MODE_APPEND ...
Copies a private raw resource content to a publicly readable file such that the latter can be shared with other applications .
27,487
protected void addItemView ( View itemView , int childIndex ) { final ViewGroup currentParent = ( ViewGroup ) itemView . getParent ( ) ; if ( currentParent != null ) { currentParent . removeView ( itemView ) ; } ( ( ViewGroup ) mMenuView ) . addView ( itemView , childIndex ) ; }
Add an item view at the given index .
27,488
public MenuView . ItemView createItemView ( ViewGroup parent ) { return ( MenuView . ItemView ) mSystemInflater . inflate ( mItemLayoutRes , parent , false ) ; }
Create a new item view that can be re - bound to other item data later .
27,489
public View getItemView ( MenuItemImpl item , View convertView , ViewGroup parent ) { MenuView . ItemView itemView ; if ( convertView instanceof MenuView . ItemView ) { itemView = ( MenuView . ItemView ) convertView ; } else { itemView = createItemView ( parent ) ; } bindItemView ( item , itemView ) ; return ( View ) i...
Prepare an item view for use . See AdapterView for the basic idea at work here . This may require creating a new item view but well - behaved implementations will re - use the view passed as convertView if present . The returned view will be populated with data from the item parameter .
27,490
public boolean showOverflowMenu ( ) { if ( mReserveOverflow && ! isOverflowMenuShowing ( ) && mMenu != null && mMenuView != null && mPostedOpenRunnable == null && ! mMenu . getNonActionItems ( ) . isEmpty ( ) ) { OverflowPopup popup = new OverflowPopup ( mContext , mMenu , mOverflowButton , true ) ; mPostedOpenRunnable...
Display the overflow menu if one is present .
27,491
public boolean hideOverflowMenu ( ) { if ( mPostedOpenRunnable != null && mMenuView != null ) { ( ( View ) mMenuView ) . removeCallbacks ( mPostedOpenRunnable ) ; mPostedOpenRunnable = null ; return true ; } MenuPopupHelper popup = mOverflowPopup ; if ( popup != null ) { popup . dismiss ( ) ; return true ; } return fal...
Hide the overflow menu if it is currently showing .
27,492
public void changeCursor ( Cursor c ) { if ( DBG ) Log . d ( LOG_TAG , "changeCursor(" + c + ")" ) ; if ( mClosed ) { Log . w ( LOG_TAG , "Tried to change cursor after adapter was closed." ) ; if ( c != null ) c . close ( ) ; return ; } try { super . changeCursor ( c ) ; if ( c != null ) { mText1Col = c . getColumnInde...
Cache columns .
27,493
public View newView ( Context context , Cursor cursor , ViewGroup parent ) { View v = super . newView ( context , cursor , parent ) ; v . setTag ( new ChildViewCache ( v ) ) ; return v ; }
Tags the view with cached child view look - ups .
27,494
private void setViewDrawable ( ImageView v , Drawable drawable , int nullVisibility ) { v . setImageDrawable ( drawable ) ; if ( drawable == null ) { v . setVisibility ( nullVisibility ) ; } else { v . setVisibility ( View . VISIBLE ) ; drawable . setVisible ( false , false ) ; drawable . setVisible ( true , false ) ; ...
Sets the drawable in an image view makes sure the view is only visible if there is a drawable .
27,495
public View getView ( int position , View convertView , ViewGroup parent ) { try { return super . getView ( position , convertView , parent ) ; } catch ( RuntimeException e ) { Log . w ( LOG_TAG , "Search suggestions cursor threw exception." , e ) ; View v = newView ( mContext , mCursor , parent ) ; if ( v != null ) { ...
This method is overridden purely to provide a bit of protection against flaky content providers .
27,496
private Drawable getDrawableFromResourceValue ( String drawableId ) { if ( drawableId == null || drawableId . length ( ) == 0 || "0" . equals ( drawableId ) ) { return null ; } try { int resourceId = Integer . parseInt ( drawableId ) ; String drawableUri = ContentResolver . SCHEME_ANDROID_RESOURCE + "://" + mProviderCo...
Gets a drawable given a value provided by a suggestion provider .
27,497
private Drawable getActivityIconWithCache ( ComponentName component ) { String componentIconKey = component . flattenToShortString ( ) ; if ( mOutsideDrawablesCache . containsKey ( componentIconKey ) ) { Drawable . ConstantState cached = mOutsideDrawablesCache . get ( componentIconKey ) ; return cached == null ? null :...
Gets the activity or application icon for an activity . Uses the local icon cache for fast repeated lookups .
27,498
private Drawable getActivityIcon ( ComponentName component ) { PackageManager pm = mContext . getPackageManager ( ) ; final ActivityInfo activityInfo ; try { activityInfo = pm . getActivityInfo ( component , PackageManager . GET_META_DATA ) ; } catch ( NameNotFoundException ex ) { Log . w ( LOG_TAG , ex . toString ( ) ...
Gets the activity or application icon for an activity .
27,499
public static String getColumnString ( Cursor cursor , String columnName ) { int col = cursor . getColumnIndex ( columnName ) ; return getStringOrNull ( cursor , col ) ; }
Gets the value of a string column by name .