idx int64 0 41.2k | question stringlengths 74 4.04k | target stringlengths 7 750 |
|---|---|---|
35,900 | private String getMime ( String name , String delimiter ) { if ( StringUtils . hasText ( name ) ) { return name . substring ( name . lastIndexOf ( delimiter ) , name . length ( ) ) ; } return null ; } | Method get the mime value from the given file name |
35,901 | public void setCompressedData ( byte [ ] compressedData ) { if ( compressedData != null ) { this . compressedData = Arrays . copyOf ( compressedData , compressedData . length ) ; } } | Sets compressed data |
35,902 | public BankAccount create ( BankAccount bankAccount , String customerId ) throws BaseException { logger . debug ( "Enter BankAccountService::create" ) ; if ( StringUtils . isBlank ( customerId ) ) { logger . error ( "IllegalArgumentException {}" , customerId ) ; throw new IllegalArgumentException ( "customerId cannot b... | Method to create BankAccount for a given customer |
35,903 | @ SuppressWarnings ( "unchecked" ) public QueryResponse getAllBankAccounts ( String customerId , int count ) throws BaseException { logger . debug ( "Enter BankAccountService::getAllBankAccounts" ) ; if ( StringUtils . isBlank ( customerId ) ) { logger . error ( "IllegalArgumentException {}" , customerId ) ; throw new ... | Method to Get All BankAccounts for a given customer specifying the count of records to be returned |
35,904 | private String extractEntity ( Object obj ) { String name = obj . getClass ( ) . getSimpleName ( ) ; String [ ] extracted = name . split ( "\\$\\$" ) ; if ( extracted . length == NUM_3 ) { return extracted [ 0 ] ; } return null ; } | Method to extract the entity |
35,905 | protected String extractPropertyName ( Method method ) { String name = method . getName ( ) ; name = name . startsWith ( "is" ) ? name . substring ( NUM_2 ) : name . substring ( NUM_3 ) ; return name ; } | extract the name of property from method called . |
35,906 | public Object getObject ( Type type ) throws FMSException { Object obj = null ; if ( type instanceof ParameterizedType ) { ParameterizedType pt = ( ParameterizedType ) type ; String typeString = pt . getActualTypeArguments ( ) [ 0 ] . toString ( ) . split ( " " ) [ 1 ] ; try { obj = Class . forName ( typeString ) . new... | Method to get the object for the given type |
35,907 | public List < EntitlementsResponse . Entitlement > getEntitlement ( ) { if ( entitlement == null ) { entitlement = new ArrayList < EntitlementsResponse . Entitlement > ( ) ; } return this . entitlement ; } | Gets the value of the entitlement property . |
35,908 | public void prepareResponse ( Request request , Response response , Entity entity ) { entity . setIntuit_tid ( response . getIntuit_tid ( ) ) ; entity . setRequestId ( request . getContext ( ) . getRequestId ( ) ) ; } | Sets additional attributes to the entity |
35,909 | public Expression < Boolean > eq ( Boolean value ) { String valueString = value . toString ( ) ; return new Expression < Boolean > ( this , Operation . eq , valueString ) ; } | Method to construct the equals expression for boolean |
35,910 | public Expression < Boolean > neq ( Boolean value ) { String valueString = value . toString ( ) ; return new Expression < Boolean > ( this , Operation . neq , valueString ) ; } | Method to construct the not equals expression for boolean |
35,911 | public Expression < Boolean > in ( Boolean [ ] value ) { String listBooleanString = "" ; Boolean firstNumber = true ; for ( Boolean v : value ) { if ( firstNumber ) { listBooleanString = listBooleanString . concat ( "(" ) . concat ( v . toString ( ) ) ; firstNumber = false ; } else { listBooleanString = listBooleanStri... | Method to construct the in expression for boolean |
35,912 | public List < JAXBElement < ? extends IntuitEntity > > getIntuitObject ( ) { if ( intuitObject == null ) { intuitObject = new ArrayList < JAXBElement < ? extends IntuitEntity > > ( ) ; } return this . intuitObject ; } | Any IntuitEntity derived object like Customer Invoice can be part of response Gets the value of the intuitObject property . |
35,913 | private static PropertyHelper init ( ) { propertHelper = new PropertyHelper ( ) ; try { ResourceBundle bundle = ResourceBundle . getBundle ( "ippdevkit" ) ; propertHelper . setVersion ( bundle . getString ( "version" ) ) ; propertHelper . setRequestSource ( bundle . getString ( "request.source" ) ) ; propertHelper . se... | Method to init the PropertyHelper by loading the ippdevkit . properties file |
35,914 | @ SuppressWarnings ( "unchecked" ) private < T extends IEntity > List < T > getEntities ( QueryResponse queryResponse ) { List < T > entityList = new ArrayList < T > ( ) ; List < JAXBElement < ? extends IntuitEntity > > intuitObjectsList = queryResponse . getIntuitObject ( ) ; if ( intuitObjectsList != null && ! intuit... | Method to parse the QueryResponse and create the entity list |
35,915 | private boolean isDownload ( String action ) { if ( StringUtils . hasText ( action ) && action . equals ( OperationType . DOWNLOAD . toString ( ) ) ) { return true ; } return false ; } | Method to validate if the given action is download feature |
35,916 | private InputStream getDownloadedFile ( String response ) throws FMSException { if ( response != null ) { try { URL url = new URL ( response ) ; return url . openStream ( ) ; } catch ( Exception e ) { throw new FMSException ( "Exception while downloading the file from URL." , e ) ; } } return null ; } | Method to get the input stream from the download URL returned from service |
35,917 | private void executeRequestInterceptors ( final IntuitMessage intuitMessage ) throws FMSException { Iterator < Interceptor > itr = requestInterceptors . iterator ( ) ; while ( itr . hasNext ( ) ) { Interceptor interceptor = itr . next ( ) ; interceptor . execute ( intuitMessage ) ; } } | Method to execute only request interceptors which are added to requestInterceptors list |
35,918 | private void executeResponseInterceptors ( final IntuitMessage intuitMessage ) throws FMSException { Iterator < Interceptor > itr = responseInterceptors . iterator ( ) ; while ( itr . hasNext ( ) ) { Interceptor interceptor = itr . next ( ) ; interceptor . execute ( intuitMessage ) ; } } | Method to execute only response interceptors which are added to the responseInterceptors list |
35,919 | protected void invokeFeature ( String featureSwitch , Feature feature ) { if ( Config . getBooleanProperty ( featureSwitch , true ) ) { feature . execute ( ) ; } } | Executes feature if switch setting is on |
35,920 | protected void updateBigDecimalScale ( IntuitEntity intuitType ) { Feature feature = new Feature ( ) { private IntuitEntity obj ; public < T extends IntuitEntity > void set ( T object ) { obj = object ; } public void execute ( ) { ( new BigDecimalScaleUpdater ( ) ) . execute ( obj ) ; } } ; feature . set ( intuitType )... | Updates instances of BigDecimal with new scale in intuitEntity |
35,921 | private void prepareDataServiceRequest ( IntuitMessage intuitMessage , RequestElements requestElements , Map < String , String > requestParameters , String action ) throws FMSException { requestParameters . put ( RequestElements . REQ_PARAM_RESOURCE_URL , getUri ( intuitMessage . isPlatformService ( ) , action , reques... | Method to prepare request parameters for data service |
35,922 | private void setupAcceptEncoding ( Map < String , String > requestHeaders ) { String acceptCompressionFormat = Config . getProperty ( Config . COMPRESSION_RESPONSE_FORMAT ) ; if ( StringUtils . hasText ( acceptCompressionFormat ) ) { requestHeaders . put ( RequestElements . HEADER_PARAM_ACCEPT_ENCODING , acceptCompress... | Setup accept encoding header from configuration |
35,923 | private void setupAcceptHeader ( String action , Map < String , String > requestHeaders , Map < String , String > requestParameters ) { String serializeAcceptFormat = getSerializationResponseFormat ( ) ; if ( StringUtils . hasText ( serializeAcceptFormat ) && ! isDownload ( action ) && ! isDownloadPDF ( requestParamete... | Setup accept header depends from the semantic of the request |
35,924 | private < T extends IEntity > String getEntityName ( T entity ) { if ( entity != null ) { return entity . getClass ( ) . getSimpleName ( ) . toLowerCase ( ) ; } return null ; } | Method to get the entity name from the given entity object |
35,925 | private < T extends IEntity > String getUri ( Boolean platformService , String action , Context context , Map < String , String > requestParameters , Boolean entitlementService ) throws FMSException { String uri = null ; if ( ! platformService ) { ServiceType serviceType = context . getIntuitServiceType ( ) ; if ( enti... | Method to construct the URI |
35,926 | protected String getBaseUrl ( String url ) { if ( url . endsWith ( "/" ) ) { return url . substring ( 0 , url . length ( ) - 1 ) ; } else { return url ; } } | Return QBO base configuration from config file |
35,927 | private < T extends IEntity > String prepareQBOUri ( String entityName , Context context , Map < String , String > requestParameters ) throws FMSException { StringBuilder uri = new StringBuilder ( ) ; if ( entityName . equalsIgnoreCase ( "Taxservice" ) ) { entityName = entityName + "/" + "taxcode" ; } uri . append ( ge... | Method to construct the QBO URI |
35,928 | private void addEntityID ( Map < String , String > requestParameters , StringBuilder uri ) { if ( StringUtils . hasText ( requestParameters . get ( RequestElements . REQ_PARAM_ENTITY_ID ) ) ) { uri . append ( "/" ) . append ( requestParameters . get ( RequestElements . REQ_PARAM_ENTITY_ID ) ) ; } } | adding the entity id in the URI which is required for READ operation |
35,929 | private void addEntitySelector ( Map < String , String > requestParameters , StringBuilder uri ) { if ( StringUtils . hasText ( requestParameters . get ( RequestElements . REQ_PARAM_ENTITY_SELECTOR ) ) ) { uri . append ( "/" ) . append ( requestParameters . get ( RequestElements . REQ_PARAM_ENTITY_SELECTOR ) ) ; } } | adding additional selector in the URI which is required for READ operation Main purpose is to select or modify requested resource with well - defined keyword |
35,930 | private < T extends IEntity > String prepareQBOPremierUri ( String entityName , Context context , Map < String , String > requestParameters ) throws FMSException { StringBuilder uri = new StringBuilder ( ) ; uri . append ( Config . getProperty ( "BASE_URL_QBO_OLB" ) ) . append ( "/" ) . append ( context . getRealmID ( ... | Method to construct the OLB QBO URI |
35,931 | private String prepareIPSUri ( String action , Context context ) throws FMSException { StringBuilder uri = new StringBuilder ( ) ; uri . append ( Config . getProperty ( Config . BASE_URL_PLATFORMSERVICE ) ) . append ( "/" ) . append ( context . getAppDBID ( ) ) . append ( "?act=" ) . append ( action ) . append ( "&toke... | Method to construct the IPS URI |
35,932 | private String buildRequestParams ( Map < String , String > requestParameters ) throws FMSException { StringBuilder reqParams = new StringBuilder ( ) ; Set < String > keySet = requestParameters . keySet ( ) ; Iterator < String > keySetIterator = keySet . iterator ( ) ; while ( keySetIterator . hasNext ( ) ) { String ke... | Method to build the request params which are to be added in the URI |
35,933 | private void prepareUploadParams ( RequestElements requestElements ) { Map < String , String > requestHeaders = requestElements . getRequestHeaders ( ) ; UploadRequestElements uploadRequestElements = requestElements . getUploadRequestElements ( ) ; String boundaryId = uploadRequestElements . getBoundaryId ( ) ; String ... | Method to prepare the request params for upload functionality |
35,934 | private boolean isDownloadPDF ( Map < String , String > map ) { return StringUtils . hasText ( map . get ( RequestElements . REQ_PARAM_ENTITY_SELECTOR ) ) && map . get ( RequestElements . REQ_PARAM_ENTITY_SELECTOR ) . equalsIgnoreCase ( ContentTypes . PDF . name ( ) ) ; } | Method returns true if this request expects PDF as response |
35,935 | private boolean isSendEmail ( Map < String , String > map ) { return StringUtils . hasText ( map . get ( RequestElements . REQ_PARAM_ENTITY_SELECTOR ) ) && map . get ( RequestElements . REQ_PARAM_ENTITY_SELECTOR ) . equalsIgnoreCase ( RequestElements . PARAM_SEND_SELECTOR ) ; } | Method returns true if this request should be send as email |
35,936 | private boolean isUpload ( String action ) { if ( StringUtils . hasText ( action ) && action . equals ( OperationType . UPLOAD . toString ( ) ) ) { return true ; } return false ; } | Method to validate if the given action is upload feature |
35,937 | private SyncError getSyncError ( JsonNode jsonNode ) throws IOException { ObjectMapper mapper = new ObjectMapper ( ) ; SimpleModule simpleModule = new SimpleModule ( "SyncErrorDeserializer" , new Version ( 1 , 0 , 0 , null ) ) ; simpleModule . addDeserializer ( SyncError . class , new SyncErrorDeserializer ( ) ) ; mapp... | Method to deserialize the SyncError object |
35,938 | public Expression < Enum < ? > > eq ( Enum < ? > value ) { String valueString = "'" + EnumPath . getValue ( value ) + "'" ; return new Expression < Enum < ? > > ( this , Operation . eq , valueString ) ; } | Method to construct the equals expression for enum |
35,939 | private static String getValue ( Enum < ? > value ) { try { Method m = value . getClass ( ) . getDeclaredMethod ( "value" ) ; return ( String ) m . invoke ( value ) ; } catch ( NoSuchMethodException ex ) { } catch ( IllegalAccessException ex ) { } catch ( InvocationTargetException ex ) { } return value . toString ( ) ;... | Intuit data enumerations have a value property which should be used in queries instead of enum names . |
35,940 | public Token createToken ( Token token ) throws BaseException { logger . debug ( "Enter TokenService::createToken" ) ; String apiUrl = requestContext . getBaseUrl ( ) + "tokens" ; logger . info ( "apiUrl - " + apiUrl ) ; TypeReference < Token > typeReference = new TypeReference < Token > ( ) { } ; Request request = new... | Method to create BankAccount |
35,941 | private String getCDCQueryJson ( CDCQuery cdcQuery ) throws SerializationException { ObjectMapper mapper = getObjectMapper ( ) ; String json = null ; try { json = mapper . writeValueAsString ( cdcQuery ) ; } catch ( Exception e ) { throw new SerializationException ( e ) ; } return json ; } | Method to get the Json string for CDCQuery object |
35,942 | private ObjectMapper getObjectMapper ( ) { ObjectMapper mapper = new ObjectMapper ( ) ; AnnotationIntrospector primary = new JacksonAnnotationIntrospector ( ) ; AnnotationIntrospector secondary = new JaxbAnnotationIntrospector ( ) ; AnnotationIntrospector pair = new AnnotationIntrospectorPair ( primary , secondary ) ; ... | Method to get the Jackson object mapper |
35,943 | public OAuthMigrationResponse migrate ( ) throws ConnectionException { logger . debug ( "Enter OAuthMigrationClient::migrate" ) ; try { HttpRequestClient client = new HttpRequestClient ( oAuthMigrationRequest . getOauth2config ( ) . getProxyConfig ( ) ) ; String requestjson = new JSONObject ( ) . put ( "scope" , getSco... | Calls the migrate API based on the the request provided and returns an object with oauth2 tokens |
35,944 | public Date unmarshal ( String value ) { if ( value != null ) { if ( value . length ( ) >= lengthOfDateFmtYYYY_MM_DD ) { value = value . substring ( 0 , lengthOfDateFmtYYYY_MM_DD ) ; boolean isMatch = value . matches ( datePattern ) ; if ( isMatch ) { return DatatypeConverter . parseDate ( value ) . getTime ( ) ; } els... | Unmarshal a Date . |
35,945 | public < T extends IEntity > void addEntity ( T entity , OperationEnum operation , String bId ) { BatchItemRequest batchItemRequest = new BatchItemRequest ( ) ; batchItemRequest . setBId ( bId ) ; batchItemRequest . setOperation ( operation ) ; batchItemRequest . setIntuitObject ( getIntuitObject ( entity ) ) ; batchIt... | Method to add the entity batch operations to the batchItemRequest |
35,946 | public void addQuery ( String query , String bId ) { BatchItemRequest batchItemRequest = new BatchItemRequest ( ) ; batchItemRequest . setBId ( bId ) ; batchItemRequest . setQuery ( query ) ; batchItemRequests . add ( batchItemRequest ) ; bIds . add ( bId ) ; } | Method to add the query batch operation to batchItemRequest |
35,947 | public void addCDCQuery ( List < ? extends IEntity > entities , String changedSince , String bId ) throws FMSException { if ( entities == null || entities . isEmpty ( ) ) { throw new FMSException ( "Entities is required." ) ; } if ( ! StringUtils . hasText ( changedSince ) ) { throw new FMSException ( "changedSince is ... | Method to add the cdc query batch operation to batchItemRequest |
35,948 | public void addReportQuery ( String reportQuery , String bId ) { BatchItemRequest batchItemRequest = new BatchItemRequest ( ) ; batchItemRequest . setBId ( bId ) ; batchItemRequest . setReportQuery ( reportQuery ) ; batchItemRequests . add ( batchItemRequest ) ; bIds . add ( bId ) ; } | Method to add the report query batch operation to batchItemRequest |
35,949 | @ SuppressWarnings ( "unchecked" ) protected < T > JAXBElement < ? extends IntuitEntity > getIntuitObject ( T entity ) { Class < ? > objectClass = entity . getClass ( ) ; String methodName = "create" . concat ( objectClass . getSimpleName ( ) ) ; ObjectFactory objectEntity = new ObjectFactory ( ) ; Class < ? > objectEn... | Method to get the corresponding IEntity type for the given JAXBElement |
35,950 | public CredentialsProvider setProxyAuthentication ( ProxyConfig proxyConfig ) { if ( proxyConfig == null ) { return null ; } String username = proxyConfig . getUsername ( ) ; String password = proxyConfig . getPassword ( ) ; if ( ! username . isEmpty ( ) && ! password . isEmpty ( ) ) { String host = proxyConfig . getHo... | Method to set proxy authentication |
35,951 | public Response makeJsonRequest ( Request request , OAuthMigrationRequest migrationRequest ) throws InvalidRequestException { logger . debug ( "Enter HttpRequestClient::makeJsonRequest" ) ; OAuthConsumer consumer = new CommonsHttpOAuthConsumer ( migrationRequest . getConsumerKey ( ) , migrationRequest . getConsumerSecr... | Method to make the HTTP POST request using the request attributes supplied |
35,952 | public static Marshaller createMarshaller ( ) throws JAXBException { Marshaller marshaller = MessageUtilsHelper . getContext ( ) . createMarshaller ( ) ; marshaller . setProperty ( Marshaller . JAXB_FORMATTED_OUTPUT , Boolean . TRUE ) ; return marshaller ; } | Create Marshaller from the JAXB context . |
35,953 | public URL constructURL ( ) throws InvalidRequestException { String stringUri = url ; try { URI uri = new URI ( stringUri ) ; return uri . toURL ( ) ; } catch ( final URISyntaxException e ) { throw new InvalidRequestException ( "Bad URI: " + stringUri , e ) ; } catch ( final MalformedURLException e ) { throw new Invali... | Prepares request URL |
35,954 | public OptionalSyntax where ( Expression < ? > ... expression ) { for ( Expression < ? > exp : expression ) { getMessage ( ) . getOptional ( ) . add ( exp . toString ( ) ) ; LOG . debug ( "expression: " + exp ) ; } QueryMessage mess = getMessage ( ) ; return new OptionalSyntax ( mess ) ; } | Method to get the optional syntax for where operator |
35,955 | public OptionalSyntax orderBy ( Path < ? > ... path ) { String fieldList = "" ; boolean firstExpression = true ; for ( Path < ? > exp : path ) { if ( firstExpression ) { fieldList = fieldList . concat ( exp . toString ( ) ) ; firstExpression = false ; } else { fieldList = fieldList . concat ( ", " ) . concat ( exp . to... | Method to get the optional syntax for order by operator |
35,956 | public OptionalSyntax skip ( int num ) { getMessage ( ) . setStartposition ( num ) ; QueryMessage mess = getMessage ( ) ; return new OptionalSyntax ( mess ) ; } | Method to get the optional syntax for skip operator |
35,957 | public OptionalSyntax take ( int num ) { getMessage ( ) . setMaxresults ( num ) ; QueryMessage mess = getMessage ( ) ; return new OptionalSyntax ( mess ) ; } | Method to get the optional syntax for take operator |
35,958 | public static String getResult ( HttpResponse response ) throws IOException { StringBuffer result = new StringBuffer ( ) ; if ( response . getEntity ( ) != null && response . getEntity ( ) . getContent ( ) != null ) { BufferedReader rd = new BufferedReader ( new InputStreamReader ( response . getEntity ( ) . getContent... | Parse the response and return the string from httpresponse body |
35,959 | JavaXmlQuery compile ( XPath xpath ) { try { this . expression = xpath . compile ( getQuery ( ) ) ; } catch ( XPathExpressionException e ) { LOGGER . error ( "Cannot compile XPath query: " + getQuery ( ) , e ) ; } return this ; } | Adds a compiled expression to the query |
35,960 | private Object getObjectValue ( XmlNode node , String fieldName ) { if ( node != null ) { String name = node . getName ( ) ; switch ( node . getType ( ) ) { case XmlNode . ATTRIBUTE_NODE : return name . equalsIgnoreCase ( fieldName ) ? node : null ; case XmlNode . ELEMENT_NODE : { if ( name . equalsIgnoreCase ( fieldNa... | Returns the object value for the given VTD XML node and field name |
35,961 | private String getStringValue ( XmlNodeArray nodes ) { StringBuilder stringBuilder = new StringBuilder ( ) ; stringBuilder . append ( "<string>" ) ; for ( XmlNode node : nodes ) { stringBuilder . append ( getStringValue ( node ) ) ; } stringBuilder . append ( "</string>" ) ; return stringBuilder . toString ( ) ; } | Returns the string value for the given node array |
35,962 | private Object getObjectValue ( Node node , String fieldName ) { if ( node != null ) { String name = node . getLocalName ( ) ; switch ( node . getNodeType ( ) ) { case Node . ATTRIBUTE_NODE : return name . equalsIgnoreCase ( fieldName ) ? node : null ; case Node . ELEMENT_NODE : { if ( name . equalsIgnoreCase ( fieldNa... | Returns the object value for the given field name and node |
35,963 | private String getStringValue ( Object o ) { if ( o instanceof String ) { return ( String ) o ; } else if ( o instanceof NodeArray ) { NodeArray array = ( NodeArray ) o ; switch ( array . size ( ) ) { case 0 : return null ; case 1 : { return getStringValue ( array . get ( 0 ) ) ; } default : return getStringValue ( arr... | Returns the string value for the object |
35,964 | private String getStringValue ( Node node ) { switch ( node . getNodeType ( ) ) { case Node . ATTRIBUTE_NODE : case Node . TEXT_NODE : return node . getNodeValue ( ) ; default : { try { Transformer transformer = TRANSFORMER_FACTORY . newTransformer ( ) ; StringWriter buffer = new StringWriter ( ) ; transformer . setOut... | Returns the string value for the node |
35,965 | private String getStringValue ( NodeArray nodes ) { StringBuilder stringBuilder = new StringBuilder ( ) ; stringBuilder . append ( "<string>" ) ; for ( Node node : nodes ) { stringBuilder . append ( getStringValue ( node ) ) ; } stringBuilder . append ( "</string>" ) ; return stringBuilder . toString ( ) ; } | Returns the string value for the node array |
35,966 | @ SuppressWarnings ( { "unchecked" , "rawtypes" } ) private void populateMap ( Map map , Node node ) { Map . Entry entry = getMapEntry ( node ) ; if ( entry != null ) { map . put ( entry . getKey ( ) , entry . getValue ( ) ) ; } } | Given the node populates the map |
35,967 | public void addAttribute ( final String _name , final String _value ) { this . attributes . put ( _name , new XmlNode ( ) { { this . name = _name ; this . value = _value ; this . valid = true ; this . type = XmlNode . ATTRIBUTE_NODE ; } } ) ; } | Adds the attribute |
35,968 | public static Object getPrimitiveValue ( String value , PrimitiveCategory primitiveCategory ) { if ( value != null ) { try { switch ( primitiveCategory ) { case BOOLEAN : return Boolean . valueOf ( value ) ; case BYTE : return Byte . valueOf ( value ) ; case DOUBLE : return Double . valueOf ( value ) ; case FLOAT : ret... | Converts the string value to the java object for the given primitive category |
35,969 | public static ObjectInspector getStandardJavaObjectInspectorFromTypeInfo ( TypeInfo typeInfo , XmlProcessor xmlProcessor ) { switch ( typeInfo . getCategory ( ) ) { case PRIMITIVE : { return PrimitiveObjectInspectorFactory . getPrimitiveJavaObjectInspector ( ( ( PrimitiveTypeInfo ) typeInfo ) . getPrimitiveCategory ( )... | Returns the standard java object inspector |
35,970 | public static StructObjectInspector getStandardStructObjectInspector ( List < String > structFieldNames , List < ObjectInspector > structFieldObjectInspectors , XmlProcessor xmlProcessor ) { return new XmlStructObjectInspector ( structFieldNames , structFieldObjectInspectors , xmlProcessor ) ; } | Returns the struct object inspector |
35,971 | public void transform ( XmlNode node , StringBuilder builder ) { switch ( node . getType ( ) ) { case XmlNode . ELEMENT_NODE : { builder . append ( "<" ) ; builder . append ( node . getName ( ) ) ; for ( XmlNode attribute : node . getAttributes ( ) . values ( ) ) { transform ( attribute , builder ) ; } builder . append... | Transforms the XML node into the string |
35,972 | public void setVideoURI ( Uri uri , Map < String , String > headers ) { mUri = uri ; mHeaders = headers ; mSeekWhenPrepared = 0 ; openVideo ( ) ; requestLayout ( ) ; invalidate ( ) ; } | Sets video URI using specific headers . |
35,973 | public static StartupSettings fromJSONFile ( File jsonFile ) throws JSONException , FileNotFoundException , IOException { StringBuffer buffer = new StringBuffer ( ) ; try ( BufferedReader br = new BufferedReader ( new FileReader ( jsonFile ) ) ) { String line ; while ( ( line = br . readLine ( ) ) != null ) { buffer . ... | Parse the settings for the gossip service from a JSON file . |
35,974 | protected void sendMembershipList ( LocalGossipMember me , List < LocalGossipMember > memberList ) { GossipService . LOGGER . debug ( "Send sendMembershipList() is called." ) ; me . setHeartbeat ( System . currentTimeMillis ( ) ) ; LocalGossipMember member = selectPartner ( memberList ) ; if ( member == null ) { return... | Performs the sending of the membership list after we have incremented our own heartbeat . |
35,975 | public void run ( ) { for ( LocalGossipMember member : members . keySet ( ) ) { if ( member != me ) { member . startTimeoutTimer ( ) ; } } try { passiveGossipThread = passiveGossipThreadClass . getConstructor ( GossipManager . class ) . newInstance ( this ) ; gossipThreadExecutor . execute ( passiveGossipThread ) ; act... | Starts the client . Specifically start the various cycles for this protocol . Start the gossip thread and start the receiver thread . |
35,976 | public void shutdown ( ) { gossipServiceRunning . set ( false ) ; gossipThreadExecutor . shutdown ( ) ; if ( passiveGossipThread != null ) { passiveGossipThread . shutdown ( ) ; } if ( activeGossipThread != null ) { activeGossipThread . shutdown ( ) ; } try { boolean result = gossipThreadExecutor . awaitTermination ( 1... | Shutdown the gossip service . |
35,977 | private boolean isObjectHasValue ( Object targetObj ) { for ( Map . Entry < String , String > entry : cellMapping . entrySet ( ) ) { if ( ! StringUtils . equalsIgnoreCase ( HEADER_KEY , entry . getKey ( ) ) ) { if ( StringUtils . isNotBlank ( getPropertyValue ( targetObj , entry . getValue ( ) ) ) ) { return true ; } }... | To check generic object of T has a minimum one value assigned or not |
35,978 | private void readSheet ( StylesTable styles , ReadOnlySharedStringsTable sharedStringsTable , InputStream sheetInputStream ) throws IOException , ParserConfigurationException , SAXException { SAXParserFactory saxFactory = SAXParserFactory . newInstance ( ) ; XMLReader sheetParser = saxFactory . newSAXParser ( ) . getXM... | Parses the content of one sheet using the specified styles and shared - strings tables . |
35,979 | private static String getProgramProperty ( String property ) { if ( System . getProperty ( property ) != null ) { return System . getProperty ( property ) . trim ( ) ; } Properties prop = new Properties ( ) ; try ( InputStream input = new FileInputStream ( SELENIFIED ) ) { prop . load ( input ) ; } catch ( IOException ... | Retrieves the specified program property . if it exists from the system properties that is returned overridding all other values . Otherwise if it exists from the properties file that is returned otherwise null is returned |
35,980 | public static boolean generatePDF ( ) { String generatePDF = getProgramProperty ( GENERATE_PDF ) ; if ( generatePDF == null ) { return false ; } if ( "" . equals ( generatePDF ) ) { return true ; } return "true" . equalsIgnoreCase ( generatePDF ) ; } | Determines if we are supposed to generate a pdf of the results or not |
35,981 | public static boolean packageResults ( ) { String packageResults = getProgramProperty ( PACKAGE_RESULTS ) ; if ( packageResults == null ) { return false ; } if ( "" . equals ( packageResults ) ) { return true ; } return "true" . equalsIgnoreCase ( packageResults ) ; } | Determines if we are supposed to zip up the results or not |
35,982 | public static String getProxy ( ) throws InvalidProxyException { String proxy = getProgramProperty ( PROXY ) ; if ( proxy == null ) { throw new InvalidProxyException ( PROXY_ISNT_SET ) ; } String [ ] proxyParts = proxy . split ( ":" ) ; if ( proxyParts . length != 2 ) { throw new InvalidProxyException ( "Proxy '" + pro... | Retrieves the proxy property if it is set . This could be to something local or in the cloud . Provide the protocol address and port |
35,983 | public static String getAppURL ( String clazz , ITestContext context ) throws InvalidHTTPException { String appURL = checkAppURL ( null , ( String ) context . getAttribute ( clazz + APP_URL ) , "The provided app via test case setup '" ) ; Properties prop = new Properties ( ) ; try ( InputStream input = new FileInputStr... | Obtains the application under test as a URL . If the site was provided as a system property that value will override whatever was set in the particular test suite . If no site was set null will be returned which will causes the tests to error out |
35,984 | private static String checkAppURL ( String originalAppURL , String newAppURL , String s ) { if ( newAppURL != null && ! "" . equals ( newAppURL ) ) { if ( ! newAppURL . toLowerCase ( ) . startsWith ( "http" ) && ! newAppURL . toLowerCase ( ) . startsWith ( "file" ) ) { newAppURL = "http://" + newAppURL ; } try { new UR... | A helper method to getAppURL which checks the provided URL and if it is valid overrides the initially provided one . |
35,985 | public static String getBrowser ( ) { String browser = getProgramProperty ( BROWSER ) ; if ( browser == null || "" . equals ( browser ) ) { browser = Browser . BrowserName . HTMLUNIT . toString ( ) ; } return browser ; } | Retrieves the browser property if it is set . This can be a single browser name or browser details . If it is not set HTMLUnit will be returned as the default browser to use |
35,986 | public static boolean runHeadless ( ) { String headless = getProgramProperty ( HEADLESS ) ; if ( headless == null ) { return false ; } if ( "" . equals ( headless ) ) { return true ; } return "true" . equalsIgnoreCase ( headless ) ; } | Determines if the headless parameter was set to have the browser run in headless mode . This only can be used for Chrome and Firefox . |
35,987 | public static String getOptions ( ) throws InvalidBrowserOptionsException { String options = getProgramProperty ( OPTIONS ) ; if ( options == null || "" . equals ( options ) ) { throw new InvalidBrowserOptionsException ( "Browser options aren't set" ) ; } return options ; } | Retrieves the set options |
35,988 | public void present ( double seconds ) { try { double timeTook = elementPresent ( seconds ) ; checkPresent ( seconds , timeTook ) ; } catch ( TimeoutException e ) { checkPresent ( seconds , seconds ) ; } } | Waits for the element to be present . The provided wait time will be used and if the element isn t present after that time it will fail and log the issue with a screenshot for traceability and added debugging support . |
35,989 | public void notPresent ( double seconds ) { double end = System . currentTimeMillis ( ) + ( seconds * 1000 ) ; try { WebDriverWait wait = new WebDriverWait ( element . getDriver ( ) , ( long ) seconds , DEFAULT_POLLING_INTERVAL ) ; wait . until ( ExpectedConditions . not ( ExpectedConditions . presenceOfAllElementsLoca... | Waits for the element to not be present . The provided wait time will be used and if the element isn t present after that time it will fail and log the issue with a screenshot for traceability and added debugging support . |
35,990 | public void displayed ( double seconds ) { double end = System . currentTimeMillis ( ) + ( seconds * 1000 ) ; try { double timeTook = elementPresent ( seconds ) ; WebDriverWait wait = new WebDriverWait ( element . getDriver ( ) , ( long ) ( seconds - timeTook ) , DEFAULT_POLLING_INTERVAL ) ; wait . until ( ExpectedCond... | Waits for the element to be displayed . The provided wait time will be used and if the element isn t present after that time it will fail and log the issue with a screenshot for traceability and added debugging support . |
35,991 | public void notDisplayed ( double seconds ) { double end = System . currentTimeMillis ( ) + ( seconds * 1000 ) ; try { double timeTook = elementPresent ( seconds ) ; WebDriverWait wait = new WebDriverWait ( element . getDriver ( ) , ( long ) ( seconds - timeTook ) , DEFAULT_POLLING_INTERVAL ) ; wait . until ( ExpectedC... | Waits for the element to not be displayed . The provided wait time will be used and if the element isn t present after that time it will fail and log the issue with a screenshot for traceability and added debugging support . |
35,992 | public void checked ( double seconds ) { double end = System . currentTimeMillis ( ) + ( seconds * 1000 ) ; try { elementPresent ( seconds ) ; while ( ! element . is ( ) . checked ( ) && System . currentTimeMillis ( ) < end ) ; double timeTook = Math . min ( ( seconds * 1000 ) - ( end - System . currentTimeMillis ( ) )... | Waits for the element to be checked . The provided wait time will be used and if the element isn t present after that time it will fail and log the issue with a screenshot for traceability and added debugging support . |
35,993 | public void editable ( double seconds ) { double end = System . currentTimeMillis ( ) + ( seconds * 1000 ) ; try { elementPresent ( seconds ) ; while ( ! element . is ( ) . editable ( ) && System . currentTimeMillis ( ) < end ) ; double timeTook = Math . min ( ( seconds * 1000 ) - ( end - System . currentTimeMillis ( )... | Waits for the element to be editable . The provided wait time will be used and if the element isn t present after that time it will fail and log the issue with a screenshot for traceability and added debugging support . If the element isn t an input this will constitute a failure same as it not being editable . |
35,994 | public void enabled ( double seconds ) { double end = System . currentTimeMillis ( ) + ( seconds * 1000 ) ; try { double timeTook = elementPresent ( seconds ) ; WebDriverWait wait = new WebDriverWait ( element . getDriver ( ) , ( long ) ( seconds - timeTook ) , DEFAULT_POLLING_INTERVAL ) ; wait . until ( ExpectedCondit... | Waits for the element to be enabled . The provided wait time will be used and if the element isn t present after that time it will fail and log the issue with a screenshot for traceability and added debugging support . |
35,995 | public void notEnabled ( double seconds ) { double end = System . currentTimeMillis ( ) + ( seconds * 1000 ) ; try { double timeTook = elementPresent ( seconds ) ; WebDriverWait wait = new WebDriverWait ( element . getDriver ( ) , ( long ) ( seconds - timeTook ) , DEFAULT_POLLING_INTERVAL ) ; wait . until ( ExpectedCon... | Waits for the element to not be enabled . The provided wait time will be used and if the element isn t present after that time it will fail and log the issue with a screenshot for traceability and added debugging support . |
35,996 | private Response call ( Method method , String endpoint , Request params , File inputFile ) { StringBuilder action = new StringBuilder ( ) ; action . append ( "Making <i>" ) ; action . append ( method . toString ( ) ) ; action . append ( "</i> call to <i>" ) ; action . append ( http . getServiceBaseUrl ( ) ) . append (... | Performs an http call and writes the call and response information to the output file |
35,997 | public void setupProxy ( ) throws InvalidProxyException { if ( Property . isProxySet ( ) ) { Proxy proxy = new Proxy ( ) ; proxy . setHttpProxy ( Property . getProxy ( ) ) ; desiredCapabilities . setCapability ( CapabilityType . PROXY , proxy ) ; } } | Obtains the set system values for the proxy and adds them to the desired desiredCapabilities |
35,998 | public WebDriver setupDriver ( ) throws InvalidBrowserException { WebDriver driver ; switch ( browser . getName ( ) ) { case HTMLUNIT : System . getProperties ( ) . put ( "org.apache.commons.logging.simplelog.defaultlog" , "fatal" ) ; java . util . logging . Logger . getLogger ( "com.gargoylesoftware.htmlunit" ) . setL... | this creates the webdriver object which will be used to interact with for all browser web tests |
35,999 | public void addExtraCapabilities ( DesiredCapabilities extraCapabilities ) { if ( extraCapabilities != null && browser . getName ( ) != BrowserName . NONE ) { desiredCapabilities = desiredCapabilities . merge ( extraCapabilities ) ; } } | If additional capabilities are provided in the test case add them in |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.