idx
int64
0
165k
question
stringlengths
73
5.81k
target
stringlengths
5
918
129,500
public String getMessage ( Context context ) { if ( customMessage != null ) { return customMessage ; } return context . getResources ( ) . getString ( message ) ; }
Getter for the error message .
129,501
@ SuppressWarnings ( "ConstantConditions" ) private void showResult ( String message ) { Snackbar . make ( rootLayout , message , Snackbar . LENGTH_LONG ) . show ( ) ; }
Shows a Snackbar on the bottom of the layout
129,502
static float dipToPixels ( Resources resources , int dip ) { return TypedValue . applyDimension ( TypedValue . COMPLEX_UNIT_DIP , dip , resources . getDisplayMetrics ( ) ) ; }
Converts dp into px .
129,503
private void parseAuthentication ( Intent data ) { String idToken = data . getStringExtra ( Constants . ID_TOKEN_EXTRA ) ; String accessToken = data . getStringExtra ( Constants . ACCESS_TOKEN_EXTRA ) ; String tokenType = data . getStringExtra ( Constants . TOKEN_TYPE_EXTRA ) ; String refreshToken = data . getStringExt...
Extracts the Authentication data from the intent data .
129,504
public ParameterizableRequest < Void , AuthenticationException > getCodeRequest ( AuthenticationAPIClient apiClient , String connectionName ) { Log . d ( TAG , String . format ( "Generating Passwordless Code/Link request for connection %s" , connectionName ) ) ; ParameterizableRequest < Void , AuthenticationException >...
Creates the ParameterizableRequest that will initiate the Passwordless Authentication flow .
129,505
public AuthenticationRequest getLoginRequest ( AuthenticationAPIClient apiClient , String emailOrNumber ) { Log . d ( TAG , String . format ( "Generating Passwordless Login request for identity %s" , emailOrNumber ) ) ; if ( getMode ( ) == PasswordlessMode . EMAIL_CODE || getMode ( ) == PasswordlessMode . EMAIL_LINK ) ...
Creates the AuthenticationRequest that will finish the Passwordless Authentication flow .
129,506
public boolean isValid ( String password ) { if ( password == null ) { return false ; } boolean length = hasMinimumLength ( password , getMinimumLength ( ) ) ; boolean other = true ; switch ( complexity . getPasswordPolicy ( ) ) { case PasswordStrength . EXCELLENT : boolean atLeast = atLeastThree ( hasLowercaseCharacte...
Checks that all the requirements are meet .
129,507
public void showProgress ( boolean show ) { if ( actionButton != null ) { actionButton . showProgress ( show ) ; } if ( formLayout != null ) { formLayout . setEnabled ( ! show ) ; } }
Displays a progress bar on top of the action button . This will also enable or disable the action button .
129,508
public void showProgress ( boolean show ) { Log . v ( TAG , show ? "Disabling the button while showing progress" : "Enabling the button and hiding progress" ) ; setEnabled ( ! show ) ; progress . setVisibility ( show ? VISIBLE : GONE ) ; if ( show ) { icon . setVisibility ( INVISIBLE ) ; labeledLayout . setVisibility (...
Used to display a progress bar and disable the button .
129,509
public void showLabel ( boolean showLabel ) { shouldShowLabel = showLabel ; labeledLayout . setVisibility ( showLabel ? VISIBLE : GONE ) ; icon . setVisibility ( ! showLabel ? VISIBLE : GONE ) ; }
Whether to show an icon or a label with the current selected mode . By default it will show the icon .
129,510
public void codeSent ( String emailOrNumber ) { Log . d ( TAG , "Now showing the Code Input Form" ) ; if ( passwordlessRequestCodeLayout != null ) { removeView ( passwordlessRequestCodeLayout ) ; if ( socialLayout != null ) { socialLayout . setVisibility ( GONE ) ; } if ( orSeparatorMessage != null ) { orSeparatorMessa...
Notifies the form that the code was correctly sent and it should now wait for the user to input the valid code .
129,511
public boolean resume ( int requestCode , int resultCode , Intent intent ) { return WebAuthProvider . resume ( requestCode , resultCode , intent ) ; }
Finishes the authentication flow in the WebAuthProvider
129,512
protected void updateBorder ( ) { boolean isFocused = input . hasFocus ( ) && ! input . isInTouchMode ( ) ; ViewUtils . setBackground ( outline , hasValidInput ? ( isFocused ? focusedOutlineBackground : normalOutlineBackground ) : errorOutlineBackground ) ; errorDescription . setVisibility ( hasValidInput ? GONE : VISI...
Updates the view knowing if the input is valid or not .
129,513
protected boolean validate ( boolean validateEmptyFields ) { boolean isValid = false ; String value = dataType == PASSWORD ? getText ( ) : getText ( ) . trim ( ) ; if ( ! validateEmptyFields && value . isEmpty ( ) ) { return true ; } switch ( dataType ) { case TEXT_NAME : case NUMBER : case PASSWORD : case NON_EMPTY_US...
Validates the input data and updates the icon . DataType must be set .
129,514
public void setText ( String text ) { input . setText ( "" ) ; if ( text != null ) { input . append ( text ) ; } }
Updates the input field text .
129,515
public void clearInput ( ) { Log . v ( TAG , "Input cleared and validation errors removed" ) ; input . setText ( "" ) ; hasValidInput = true ; updateBorder ( ) ; showPasswordToggle . setChecked ( false ) ; }
Removes any text present on the input field and clears any validation error if present .
129,516
public static int styleForStrategy ( String strategyName ) { int style = R . style . Lock_Theme_AuthStyle ; switch ( strategyName ) { case "amazon" : style = R . style . Lock_Theme_AuthStyle_Amazon ; break ; case "aol" : style = R . style . Lock_Theme_AuthStyle_AOL ; break ; case "bitbucket" : style = R . style . Lock_...
It will resolve the given Strategy Name to a valid Style .
129,517
@ SuppressWarnings ( "unused" ) public Intent newIntent ( Context context ) { Intent lockIntent = new Intent ( context , PasswordlessLockActivity . class ) ; lockIntent . putExtra ( Constants . OPTIONS_EXTRA , options ) ; lockIntent . addFlags ( Intent . FLAG_ACTIVITY_NEW_TASK ) ; return lockIntent ; }
Builds a new intent to launch LockActivity with the previously configured options
129,518
public OAuthConnection parse ( String email ) { String domain = extractDomain ( email ) ; if ( domain == null ) { return null ; } domain = domain . toLowerCase ( ) ; for ( OAuthConnection c : connections ) { String mainDomain = domainForConnection ( c ) ; if ( domain . equalsIgnoreCase ( mainDomain ) ) { return c ; } L...
Tries to find a valid domain with the given input .
129,519
public String extractUsername ( String email ) { int indexAt = email . indexOf ( AT_SYMBOL ) ; if ( indexAt == - 1 ) { return null ; } return email . substring ( 0 , indexAt ) ; }
Extracts the username part from the email
129,520
private String extractDomain ( String email ) { int indexAt = email . indexOf ( AT_SYMBOL ) + 1 ; if ( indexAt == 0 ) { return null ; } String domain = email . substring ( indexAt ) ; if ( domain . isEmpty ( ) ) { return null ; } return domain ; }
Extracts the domain part from the email
129,521
private String extractStringValue ( XMLObject xmlo ) { if ( xmlo instanceof XSString ) { return ( ( XSString ) xmlo ) . getValue ( ) ; } else if ( xmlo instanceof XSAnyImpl ) { return ( ( XSAnyImpl ) xmlo ) . getTextContent ( ) ; } logger . warn ( "Unable to map attribute class {} to String. Unknown type. Enable TRACE ...
Extracts the string value of the XMLObject depending upon its type .
129,522
public static Map < String , Set < String > > parseAttributeToAttributeMapping ( final Map < String , ? extends Object > mapping ) { if ( mapping == null ) { return new HashMap < > ( ) ; } final Map < String , Set < String > > mappedAttributesBuilder = new LinkedHashMap < > ( ) ; for ( final Map . Entry < String , ? ex...
Translate from a more flexible Attribute to Attribute mapping format to a Map from String to Set of Strings .
129,523
public void initialize ( ) { for ( final SearchScope scope : SearchScope . values ( ) ) { if ( scope . ordinal ( ) == this . searchControls . getSearchScope ( ) ) { this . searchScope = scope ; } } }
Initializes the object after properties are set .
129,524
private SearchRequest createRequest ( final SearchFilter filter ) { final SearchRequest request = new SearchRequest ( ) ; request . setBaseDn ( this . baseDN ) ; request . setSearchFilter ( filter ) ; if ( getResultAttributeMapping ( ) != null && ! getResultAttributeMapping ( ) . isEmpty ( ) ) { final String [ ] attrib...
Creates a search request from a search filter .
129,525
protected Map < String , List < Object > > buildMutableAttributeMap ( final Map < String , List < Object > > attributes ) { final Map < String , List < Object > > mutableValuesBuilder = this . createMutableAttributeMap ( attributes . size ( ) ) ; for ( final Map . Entry < String , List < Object > > attrEntry : attribut...
Do a deep clone of an attribute Map to ensure it is completley mutable .
129,526
public void setScriptFile ( final String scriptFile ) { this . scriptFile = scriptFile ; this . scriptType = determineScriptType ( scriptFile ) ; if ( scriptType != SCRIPT_TYPE . CONTENTS ) { this . engineName = getScriptEngineName ( scriptFile ) ; } }
this object would be better if engineName and scriptFile couldn t change
129,527
public static String getScriptEngineName ( String filename ) { String extension = FilenameUtils . getExtension ( filename ) ; if ( StringUtils . isBlank ( extension ) ) { logger . warn ( "Can't determine engine name based on filename without extension {}" , filename ) ; return null ; } ScriptEngineManager manager = new...
This method is static is available as utility for users that are passing the contents of a script and want to set the engineName property based on a filename .
129,528
public void setUserInfoCache ( final Map < Serializable , Set < IPersonAttributes > > userInfoCache ) { if ( userInfoCache == null ) { throw new IllegalArgumentException ( "userInfoCache may not be null" ) ; } this . userInfoCache = userInfoCache ; }
The Map to use for caching results . Only get put and remove are used so the Map may be backed by a real caching implementation .
129,529
public void setNullResultsObject ( final Set < IPersonAttributes > nullResultsObject ) { if ( nullResultsObject == null ) { throw new IllegalArgumentException ( "nullResultsObject may not be null" ) ; } this . nullResultsObject = nullResultsObject ; }
Used to specify the placeholder object to put in the cache for null results . Defaults to a minimal Set . Most installations will not need to set this .
129,530
public void setBackingMap ( final Map < String , Map < String , List < Object > > > backingMap ) { if ( backingMap == null ) { this . backingMap = new HashMap < > ( ) ; this . possibleUserAttributeNames = new HashSet < > ( ) ; } else { this . backingMap = new LinkedHashMap < > ( backingMap ) ; this . initializePossible...
The backing Map to use for queries the outer map is keyed on the query attribute . The inner Map is the set of user attributes to be returned for the query attribute .
129,531
private void initializePossibleAttributeNames ( ) { final Set < String > possibleAttribNames = new LinkedHashSet < > ( ) ; for ( final Map < String , List < Object > > attributeMapForSomeUser : this . backingMap . values ( ) ) { final Set < String > keySet = attributeMapForSomeUser . keySet ( ) ; possibleAttribNames . ...
Compute the set of attribute names that map to a value for at least one user in our backing map and store it as the instance variable possibleUserAttributeNames .
129,532
public Set < IPersonAttributes > getPeopleWithMultivaluedAttributes ( final Map < String , List < Object > > query , final IPersonAttributeDaoFilter filter ) { if ( query == null ) { throw new IllegalArgumentException ( "seed may not be null" ) ; } return Collections . singleton ( ( IPersonAttributes ) new AttributeNam...
Returns a duplicate of the seed it is passed .
129,533
protected String canonicalizeDataAttributeForSql ( final String dataAttribute ) { if ( this . caseInsensitiveDataAttributes == null || this . caseInsensitiveDataAttributes . isEmpty ( ) || ! ( this . caseInsensitiveDataAttributes . containsKey ( dataAttribute ) ) ) { return dataAttribute ; } if ( this . dataAttributeCa...
Canonicalize the data - layer attribute column with the given name via SQL function . This is as opposed to canonicalizing query attributes or application attributes passed into or mapped out of the data layer . Canonicalization of a data - layer column should only be necessary if the data layer if you require case - i...
129,534
protected Map < String , List < Object > > buildImmutableAttributeMap ( final Map < String , List < Object > > attributes ) { final Map < String , List < Object > > immutableValuesBuilder = this . createImmutableAttributeMap ( attributes . size ( ) ) ; final Pattern arrayPattern = Pattern . compile ( "\\{(.*)\\}" ) ; f...
Take the constructor argument and convert the Map and List values into read - only form .
129,535
protected final IPersonAttributes mapPersonAttributes ( final IPersonAttributes person ) { final Map < String , List < Object > > personAttributes = person . getAttributes ( ) ; final Map < String , List < Object > > mappedAttributes ; if ( this . resultAttributeMapping == null ) { if ( caseInsensitiveResultAttributes ...
Uses resultAttributeMapping to return a copy of the IPersonAttributes with only the attributes specified in resultAttributeMapping mapped to their result attribute names .
129,536
protected List < Object > canonicalizeAttribute ( final String key , final List < Object > value , final Map < String , CaseCanonicalizationMode > config ) { if ( value == null || value . isEmpty ( ) || config == null || ! ( config . containsKey ( key ) ) ) { return value ; } CaseCanonicalizationMode canonicalizationMo...
Canonicalize the attribute values if they are present in the config map .
129,537
protected Set < IPersonAttributes > getAttributesFromDao ( final Map < String , List < Object > > seed , final boolean isFirstQuery , final IPersonAttributeDao currentlyConsidering , final Set < IPersonAttributes > resultPeople , final IPersonAttributeDaoFilter filter ) { if ( isFirstQuery || ( ! stopIfFirstDaoReturnsN...
If this is the first call or there are no results in the resultPeople Set and stopIfFirstDaoReturnsNull = false the seed map is used . If not the attributes of the first user in the resultPeople Set are used for each child dao . If stopIfFirstDaoReturnsNull = true and the first query returned no results in the resultPe...
129,538
protected Set < IPersonAttributes > getAttributesFromDao ( final Map < String , List < Object > > seed , final boolean isFirstQuery , final IPersonAttributeDao currentlyConsidering , final Set < IPersonAttributes > resultPeople , final IPersonAttributeDaoFilter filter ) { return currentlyConsidering . getPeopleWithMult...
Calls the current IPersonAttributeDao from using the seed .
129,539
public List < Object > removeAttribute ( final String name ) { List < Object > removedValues = null ; for ( final IAdditionalDescriptors additionalDescriptors : this . delegateDescriptors ) { final List < Object > values = additionalDescriptors . removeAttribute ( name ) ; if ( values != null ) { if ( removedValues == ...
Returns list of all removed values
129,540
public List < Object > setAttributeValues ( final String name , final List < Object > values ) { List < Object > replacedValues = null ; for ( final IAdditionalDescriptors additionalDescriptors : delegateDescriptors ) { final List < Object > oldValues = additionalDescriptors . setAttributeValues ( name , values ) ; if ...
Returns list of all replaced values
129,541
protected void addRequestProperties ( final HttpServletRequest httpServletRequest , final Map < String , List < Object > > attributes ) { if ( this . remoteUserAttribute != null ) { final String remoteUser = httpServletRequest . getRemoteUser ( ) ; attributes . put ( this . remoteUserAttribute , list ( remoteUser ) ) ;...
Add other properties from the request to the attributes map .
129,542
protected void addRequestCookies ( final HttpServletRequest httpServletRequest , final Map < String , List < Object > > attributes ) { final Cookie [ ] cookies = httpServletRequest . getCookies ( ) ; if ( cookies == null ) { return ; } for ( final Cookie cookie : cookies ) { final String cookieName = cookie . getName (...
Add request cookies to the attributes map
129,543
protected void addRequestHeaders ( final HttpServletRequest httpServletRequest , final Map < String , List < Object > > attributes ) { for ( final Map . Entry < String , Set < String > > headerAttributeEntry : this . headerAttributeMapping . entrySet ( ) ) { final String headerName = headerAttributeEntry . getKey ( ) ;...
Add request headers to the attributes map
129,544
public void append ( final Filter query ) { switch ( this . queryType ) { case OR : { this . orFilter . or ( query ) ; } break ; default : case AND : { this . andFilter . and ( query ) ; } break ; } }
Append the query Filter to the underlying logical Filter
129,545
protected boolean isCacheValid ( final Long lastModified ) { return ( lastModified != null && lastModified <= this . lastModifiedTime ) || ( lastModified == null && ( this . lastModifiedTime + this . noLastModifiedReloadPeriod ) <= System . currentTimeMillis ( ) ) ; }
Determines if the cached unmarshalled object is still valid
129,546
protected Map < String , Object > flattenResults ( final Map < String , List < Object > > multivaluedUserAttributes ) { if ( ! this . enabled ) { return null ; } if ( multivaluedUserAttributes == null ) { return null ; } final Map < String , Object > userAttributes = new LinkedHashMap < > ( multivaluedUserAttributes . ...
Takes a &lt ; String List&lt ; Object&gt ; &gt ; Map and coverts it to a &lt ; String Object&gt ; Map . This implementation takes the first value of each List to use as the value for the new Map .
129,547
public void execute ( ) { if ( "pom" . equals ( project . getPackaging ( ) ) ) { getLog ( ) . info ( "Skipping SCoverage execution for project with packaging type 'pom'" ) ; return ; } if ( skip ) { getLog ( ) . info ( "Skipping Scoverage execution" ) ; return ; } long ts = System . currentTimeMillis ( ) ; SCoverageFor...
Creates artifact file containing instrumented classes .
129,548
public void execute ( ) { if ( "pom" . equals ( project . getPackaging ( ) ) ) { return ; } if ( skip ) { return ; } long ts = System . currentTimeMillis ( ) ; Properties projectProperties = project . getProperties ( ) ; restoreProperty ( projectProperties , "sbt._scalacOptions" ) ; restoreProperty ( projectProperties ...
Restores project original configuration after compilation with SCoverage instrumentation .
129,549
private void addScoverageDependenciesToClasspath ( Artifact scalaScoveragePluginArtifact ) throws MojoExecutionException { @ SuppressWarnings ( "unchecked" ) Set < Artifact > set = new LinkedHashSet < Artifact > ( project . getDependencyArtifacts ( ) ) ; set . add ( scalaScoveragePluginArtifact ) ; project . setDepende...
We need to tweak our test classpath for Scoverage .
129,550
public void execute ( ) throws MojoExecutionException { if ( ! canGenerateReport ( ) ) { getLog ( ) . info ( "Skipping SCoverage report generation" ) ; return ; } try { RenderingContext context = new RenderingContext ( outputDirectory , getOutputName ( ) + ".html" ) ; SiteRendererSink sink = new SiteRendererSink ( cont...
Generates SCoverage report .
129,551
protected String getRecommendedVersionRecursive ( Project project , ModuleVersionSelector mvSelector ) { String version = project . getExtensions ( ) . getByType ( RecommendationProviderContainer . class ) . getRecommendedVersion ( mvSelector . getGroup ( ) , mvSelector . getName ( ) ) ; if ( version != null ) return v...
Look for recommended versions in a project and each of its ancestors in order until one is found or the root is reached
129,552
public Integer getAccountsCount ( final QueryParams params ) { FluentCaseInsensitiveStringsMap map = doHEAD ( Accounts . ACCOUNTS_RESOURCE , params ) ; return Integer . parseInt ( map . getFirstValue ( X_RECORDS_HEADER_NAME ) ) ; }
Get number of Accounts matching the query params
129,553
public Integer getCouponsCount ( final QueryParams params ) { FluentCaseInsensitiveStringsMap map = doHEAD ( Coupons . COUPONS_RESOURCE , params ) ; return Integer . parseInt ( map . getFirstValue ( X_RECORDS_HEADER_NAME ) ) ; }
Get number of Coupons matching the query params
129,554
public Integer getSubscriptionsCount ( final QueryParams params ) { FluentCaseInsensitiveStringsMap map = doHEAD ( Subscription . SUBSCRIPTION_RESOURCE , params ) ; return Integer . parseInt ( map . getFirstValue ( X_RECORDS_HEADER_NAME ) ) ; }
Get number of Subscriptions matching the query params
129,555
public Integer getTransactionsCount ( final QueryParams params ) { FluentCaseInsensitiveStringsMap map = doHEAD ( Transactions . TRANSACTIONS_RESOURCE , params ) ; return Integer . parseInt ( map . getFirstValue ( X_RECORDS_HEADER_NAME ) ) ; }
Get number of Transactions matching the query params
129,556
public Transaction getTransaction ( final String transactionId ) { if ( transactionId == null || transactionId . isEmpty ( ) ) throw new RuntimeException ( "transactionId cannot be empty!" ) ; return doGET ( Transactions . TRANSACTIONS_RESOURCE + "/" + transactionId , Transaction . class ) ; }
Lookup a transaction
129,557
public void refundTransaction ( final String transactionId , final BigDecimal amount ) { String url = Transactions . TRANSACTIONS_RESOURCE + "/" + transactionId ; if ( amount != null ) { url = url + "?amount_in_cents=" + ( amount . intValue ( ) * 100 ) ; } doDELETE ( url ) ; }
Refund a transaction
129,558
public Invoice getInvoice ( final String invoiceId ) { if ( invoiceId == null || invoiceId . isEmpty ( ) ) throw new RuntimeException ( "invoiceId cannot be empty!" ) ; return doGET ( Invoices . INVOICES_RESOURCE + "/" + invoiceId , Invoice . class ) ; }
Lookup an invoice given an invoice id
129,559
public Invoice markInvoiceSuccessful ( final String invoiceId ) { return doPUT ( Invoices . INVOICES_RESOURCE + "/" + invoiceId + "/mark_successful" , null , Invoice . class ) ; }
Mark an invoice as paid successfully - Recurly Enterprise Feature
129,560
public InvoiceCollection markInvoiceFailed ( final String invoiceId ) { return doPUT ( Invoices . INVOICES_RESOURCE + "/" + invoiceId + "/mark_failed" , null , InvoiceCollection . class ) ; }
Mark an invoice as failed collection
129,561
public Invoice forceCollectInvoice ( final String invoiceId ) { return doPUT ( Invoices . INVOICES_RESOURCE + "/" + invoiceId + "/collect" , null , Invoice . class ) ; }
Force collect an invoice
129,562
public Integer getPlansCount ( final QueryParams params ) { FluentCaseInsensitiveStringsMap map = doHEAD ( Plans . PLANS_RESOURCE , params ) ; return Integer . parseInt ( map . getFirstValue ( X_RECORDS_HEADER_NAME ) ) ; }
Get number of Plans matching the query params
129,563
public Redemption getCouponRedemptionByAccount ( final String accountCode ) { return doGET ( Accounts . ACCOUNTS_RESOURCE + "/" + accountCode + Redemption . REDEMPTION_RESOURCE , Redemption . class ) ; }
Lookup the first coupon redemption on an account .
129,564
public Redemptions getCouponRedemptionsByAccount ( final String accountCode ) { return doGET ( Accounts . ACCOUNTS_RESOURCE + "/" + accountCode + Redemption . REDEMPTIONS_RESOURCE , Redemptions . class , new QueryParams ( ) ) ; }
Lookup all coupon redemptions on an account .
129,565
public Redemption getCouponRedemptionByInvoice ( final String invoiceId ) { return doGET ( Invoices . INVOICES_RESOURCE + "/" + invoiceId + Redemption . REDEMPTION_RESOURCE , Redemption . class ) ; }
Lookup the first coupon redemption on an invoice .
129,566
public Redemptions getCouponRedemptionsBySubscription ( final String subscriptionUuid , final QueryParams params ) { return doGET ( Subscription . SUBSCRIPTION_RESOURCE + "/" + subscriptionUuid + Redemptions . REDEMPTIONS_RESOURCE , Redemptions . class , params ) ; }
Lookup all coupon redemptions on a subscription given query params .
129,567
public void deleteCouponRedemption ( final String accountCode , final String redemptionUuid ) { doDELETE ( Accounts . ACCOUNTS_RESOURCE + "/" + accountCode + Redemption . REDEMPTIONS_RESOURCE + "/" + redemptionUuid ) ; }
Deletes a specific redemption .
129,568
public void generateUniqueCodes ( final String couponCode , final Coupon coupon ) { doPOST ( Coupon . COUPON_RESOURCE + "/" + couponCode + Coupon . GENERATE_RESOURCE , coupon , null ) ; }
Generates unique codes for a bulk coupon .
129,569
public Coupons getUniqueCouponCodes ( final String couponCode , final QueryParams params ) { return doGET ( Coupon . COUPON_RESOURCE + "/" + couponCode + Coupon . UNIQUE_CODES_RESOURCE , Coupons . class , params ) ; }
Lookup all unique codes for a bulk coupon given query params .
129,570
public Integer getGiftCardsCount ( final QueryParams params ) { FluentCaseInsensitiveStringsMap map = doHEAD ( GiftCards . GIFT_CARDS_RESOURCE , params ) ; return Integer . parseInt ( map . getFirstValue ( X_RECORDS_HEADER_NAME ) ) ; }
Get number of GiftCards matching the query params
129,571
public static Type detect ( final String payload ) { final Matcher m = ROOT_NAME . matcher ( payload ) ; if ( m . find ( ) && m . groupCount ( ) >= 1 ) { final String root = m . group ( 1 ) ; try { return Type . valueOf ( CaseFormat . LOWER_UNDERSCORE . to ( CaseFormat . UPPER_CAMEL , root ) ) ; } catch ( IllegalArgume...
Detect notification type based on the xml root name .
129,572
public static GiftCard . Redemption createRedemption ( String accountCode ) { Redemption redemption = new Redemption ( ) ; redemption . setAccountCode ( accountCode ) ; return redemption ; }
Builds a redemption request
129,573
public Invoice getOriginalInvoice ( ) { if ( originalInvoice != null && originalInvoice . getHref ( ) != null && ! originalInvoice . getHref ( ) . isEmpty ( ) ) { originalInvoice = fetch ( originalInvoice , Invoice . class ) ; } return originalInvoice ; }
Fetches the original invoice if the href is populated otherwise return the current original invoice .
129,574
public static String asWKT ( Geometry geometry ) { if ( geometry == null ) { return null ; } WKTWriter wktWriter = new WKTWriter ( ) ; return wktWriter . write ( geometry ) ; }
Convert a Geometry value into a Well Known Text value .
129,575
public static Geometry multiplyZ ( Geometry geometry , double z ) throws SQLException { if ( geometry == null ) { return null ; } geometry . apply ( new MultiplyZCoordinateSequenceFilter ( z ) ) ; return geometry ; }
Multiply the z values of the geometry by another double value . NaN values are not updated .
129,576
public void insertRow ( Object [ ] values ) throws IOException { if ( ! ( values [ geometryFieldIndex ] instanceof Geometry ) ) { if ( values [ geometryFieldIndex ] == null ) { throw new IOException ( "Shape files do not support NULL Geometry values." ) ; } else { throw new IllegalArgumentException ( "Field at " + geom...
Insert values in the row
129,577
public void initDriver ( File shpFile , ShapeType shapeType , DbaseFileHeader dbaseHeader ) throws IOException { String path = shpFile . getAbsolutePath ( ) ; String nameWithoutExt = path . substring ( 0 , path . lastIndexOf ( '.' ) ) ; this . shpFile = new File ( nameWithoutExt + ".shp" ) ; this . shxFile = new File (...
Init Driver for Write mode
129,578
private static void getPunctualGeometry ( ArrayList < Point > points , Geometry geometry ) { for ( int i = 0 ; i < geometry . getNumGeometries ( ) ; i ++ ) { Geometry subGeom = geometry . getGeometryN ( i ) ; if ( subGeom instanceof Point ) { points . add ( ( Point ) subGeom ) ; } else if ( subGeom instanceof GeometryC...
Filter point from a geometry
129,579
private static void getLinealGeometry ( ArrayList < LineString > lines , Geometry geometry ) { for ( int i = 0 ; i < geometry . getNumGeometries ( ) ; i ++ ) { Geometry subGeom = geometry . getGeometryN ( i ) ; if ( subGeom instanceof LineString ) { lines . add ( ( LineString ) subGeom ) ; } else if ( subGeom instanceo...
Filter line from a geometry
129,580
private static void getArealGeometry ( ArrayList < Polygon > polygones , Geometry geometry ) { for ( int i = 0 ; i < geometry . getNumGeometries ( ) ; i ++ ) { Geometry subGeom = geometry . getGeometryN ( i ) ; if ( subGeom instanceof Polygon ) { polygones . add ( ( Polygon ) subGeom ) ; } else if ( subGeom instanceof ...
Filter polygon from a geometry
129,581
public static String toGML ( Geometry geom ) { if ( geom == null ) { return null ; } int srid = geom . getSRID ( ) ; GMLWriter gmlw = new GMLWriter ( ) ; if ( srid != - 1 || srid != 0 ) { gmlw . setSrsName ( "EPSG:" + geom . getSRID ( ) ) ; } return gmlw . write ( geom ) ; }
Write the GML
129,582
public static Point projectPoint ( Geometry point , Geometry geometry ) { if ( point == null || geometry == null ) { return null ; } if ( point . getDimension ( ) == 0 && geometry . getDimension ( ) == 1 ) { LengthIndexedLine ll = new LengthIndexedLine ( geometry ) ; double index = ll . project ( point . getCoordinate ...
Project a point on a linestring or multilinestring
129,583
public static ResultSet triangleContouring ( Connection connection , String tableName , Value ... varArgs ) throws SQLException { if ( connection . getMetaData ( ) . getURL ( ) . equals ( HACK_URL ) ) { return new ExplodeResultSet ( connection , tableName , Collections . singletonList ( 0.0 ) ) . getResultSet ( ) ; } E...
Iso contouring using Z M attributes of geometries
129,584
public static boolean getConnectedComponents ( Connection connection , String inputTable , String orientation ) throws SQLException { KeyedGraph graph = prepareGraph ( connection , inputTable , orientation , null , VUCent . class , Edge . class ) ; if ( graph == null ) { return false ; } final List < Set < VUCent > > c...
Calculate the node and edge connected component tables .
129,585
public static LineString createLine ( Geometry pointA , Geometry ... optionalPoints ) throws SQLException { if ( pointA == null || optionalPoints . length > 0 && optionalPoints [ 0 ] == null ) { return null ; } if ( pointA . getNumGeometries ( ) == 1 && ! atLeastTwoPoints ( optionalPoints , countPoints ( pointA ) ) ) {...
Constructs a LINESTRING from the given POINTs or MULTIPOINTs
129,586
public void initialise ( XMLReader reader , AbstractGpxParserDefault parent ) { setReader ( reader ) ; setParent ( parent ) ; setContentBuffer ( parent . getContentBuffer ( ) ) ; setRtePreparedStmt ( parent . getRtePreparedStmt ( ) ) ; setRteptPreparedStmt ( parent . getRteptPreparedStmt ( ) ) ; setElementNames ( paren...
Create a new specific parser . It has in memory the default parser the contentBuffer the elementNames the currentLine and the rteID .
129,587
public static Coordinate createCoordinate ( Attributes attributes ) throws NumberFormatException { double lat ; double lon ; try { lat = Double . parseDouble ( attributes . getValue ( GPXTags . LAT ) ) ; } catch ( NumberFormatException e ) { throw new NumberFormatException ( "Cannot parse the latitude value" ) ; } try ...
General method to create a coordinate from a gpx point .
129,588
public static Double getMinX ( Geometry geom ) { if ( geom != null ) { return geom . getEnvelopeInternal ( ) . getMinX ( ) ; } else { return null ; } }
Returns the minimal x - value of the given geometry .
129,589
public static Point createPoint ( double x , double y ) throws SQLException { return createPoint ( x , y , Coordinate . NULL_ORDINATE ) ; }
Constructs POINT from two doubles .
129,590
public static Point createPoint ( double x , double y , double z ) throws SQLException { return GF . createPoint ( new Coordinate ( x , y , z ) ) ; }
Constructs POINT from three doubles .
129,591
public final void setAttribute ( String currentElement , StringBuilder contentBuffer ) { if ( currentElement . equalsIgnoreCase ( GPXTags . TIME ) ) { setTime ( contentBuffer ) ; } else if ( currentElement . equalsIgnoreCase ( GPXTags . MAGVAR ) ) { setMagvar ( contentBuffer ) ; } else if ( currentElement . equalsIgnor...
Set an attribute for a point . The String currentElement gives the information of which attribute have to be setted . The attribute to set is given by the StringBuilder contentBuffer .
129,592
public final void setLink ( Attributes attributes ) { ptValues [ GpxMetadata . PTLINK ] = attributes . getValue ( GPXTags . HREF ) ; }
Set a link to additional information about the point .
129,593
public final void setSat ( StringBuilder contentBuffer ) { ptValues [ GpxMetadata . PTSAT ] = Integer . parseInt ( contentBuffer . toString ( ) ) ; }
Set the number of satellites used to calculate the GPX fix for a point .
129,594
public final void setHdop ( StringBuilder contentBuffer ) { ptValues [ GpxMetadata . PTHDOP ] = Double . parseDouble ( contentBuffer . toString ( ) ) ; }
Set the horizontal dilution of precision of a point .
129,595
public final void setVdop ( StringBuilder contentBuffer ) { ptValues [ GpxMetadata . PTVDOP ] = Double . parseDouble ( contentBuffer . toString ( ) ) ; }
Set the vertical dilution of precision of a point .
129,596
public final void setPdop ( StringBuilder contentBuffer ) { ptValues [ GpxMetadata . PTPDOP ] = Double . parseDouble ( contentBuffer . toString ( ) ) ; }
Set the position dilution of precision of a point .
129,597
public final void setAgeofdgpsdata ( StringBuilder contentBuffer ) { ptValues [ GpxMetadata . PTAGEOFDGPSDATA ] = Double . parseDouble ( contentBuffer . toString ( ) ) ; }
Set number of seconds since last DGPS update for a point .
129,598
public final void setDgpsid ( StringBuilder contentBuffer ) { ptValues [ GpxMetadata . PTDGPSID ] = Integer . parseInt ( contentBuffer . toString ( ) ) ; }
Set ID of DGPS station used in differential correction for a point .
129,599
protected static Orientation parseGlobalOrientation ( String v ) { if ( v == null ) { return null ; } if ( isDirectedString ( v ) ) { return Orientation . DIRECTED ; } else if ( isReversedString ( v ) ) { return Orientation . REVERSED ; } else if ( isUndirectedString ( v ) ) { return Orientation . UNDIRECTED ; } else {...
Recovers the global orientation from a string .