idx int64 0 165k | question stringlengths 73 5.81k | target stringlengths 5 918 |
|---|---|---|
9,500 | public static sdx_network_config get ( nitro_service client ) throws Exception { sdx_network_config resource = new sdx_network_config ( ) ; resource . validate ( "get" ) ; return ( ( sdx_network_config [ ] ) resource . get_resources ( client ) ) [ 0 ] ; } | Use this operation to get SDX network configuration . |
9,501 | protected HashSet < String > getVulnerabilities ( int recordId ) throws SQLException { HashSet < String > cves = new HashSet < String > ( ) ; Connection connection = getConnection ( ) ; try { PreparedStatement ps = setObjects ( connection , Query . FIND_CVES , recordId ) ; ResultSet matches = ps . executeQuery ( ) ; while ( matches . next ( ) ) { cves . add ( matches . getString ( 1 ) ) ; } matches . close ( ) ; } finally { connection . close ( ) ; } return cves ; } | Returns CVEs that are ascociated with a given record id . |
9,502 | protected HashSet < Integer > getEmbeddedRecords ( Set < String > hashes ) throws SQLException { HashSet < Integer > results = new HashSet < Integer > ( ) ; Connection connection = getConnection ( ) ; PreparedStatement ps = setObjects ( connection , Query . FILEHASH_EMBEDDED_MATCH , ( Object ) hashes . toArray ( ) ) ; try { ResultSet resultSet = ps . executeQuery ( ) ; while ( resultSet . next ( ) ) { results . add ( resultSet . getInt ( "record" ) ) ; } resultSet . close ( ) ; } finally { connection . close ( ) ; } return results ; } | Fetch record id s from the local database that is composed entirely of hashes in the set of hashes provided . |
9,503 | public synchronized void connect ( ) { if ( state != State . NONE ) { eventHandler . onError ( new WebSocketException ( "connect() already called" ) ) ; close ( ) ; return ; } getIntializer ( ) . setName ( getInnerThread ( ) , THREAD_BASE_NAME + "Reader-" + clientId ) ; state = State . CONNECTING ; getInnerThread ( ) . start ( ) ; } | Start up the socket . This is non - blocking it will fire up the threads used by the library and then trigger the onOpen handler once the connection is established . |
9,504 | public synchronized void close ( ) { switch ( state ) { case NONE : state = State . DISCONNECTED ; return ; case CONNECTING : closeSocket ( ) ; return ; case CONNECTED : sendCloseHandshake ( true ) ; return ; case DISCONNECTING : return ; case DISCONNECTED : return ; } } | Close down the socket . Will trigger the onClose handler if the socket has not been previously closed . |
9,505 | public void blockClose ( ) throws InterruptedException { if ( writer . getInnerThread ( ) . getState ( ) != Thread . State . NEW ) { writer . getInnerThread ( ) . join ( ) ; } getInnerThread ( ) . join ( ) ; } | Blocks until both threads exit . The actual close must be triggered separately . This is just a convenience method to make sure everything shuts down if desired . |
9,506 | public static ns_image [ ] get_filtered ( nitro_service service , filtervalue [ ] filter ) throws Exception { ns_image obj = new ns_image ( ) ; options option = new options ( ) ; option . set_filter ( filter ) ; ns_image [ ] response = ( ns_image [ ] ) obj . getfiltered ( service , option ) ; return response ; } | Use this API to fetch filtered set of ns_image resources . set the filter parameter values in filtervalue object . |
9,507 | public static xen_health_resource [ ] get_filtered ( nitro_service service , filtervalue [ ] filter ) throws Exception { xen_health_resource obj = new xen_health_resource ( ) ; options option = new options ( ) ; option . set_filter ( filter ) ; xen_health_resource [ ] response = ( xen_health_resource [ ] ) obj . getfiltered ( service , option ) ; return response ; } | Use this API to fetch filtered set of xen_health_resource resources . set the filter parameter values in filtervalue object . |
9,508 | protected < T > T convert ( final String value , final Class < T > type ) { Assert . notNull ( type , "The Class type to convert the String value to cannot be null!" ) ; if ( getConversionService ( ) . canConvert ( String . class , type ) ) { return getConversionService ( ) . convert ( value , type ) ; } throw new ConversionException ( String . format ( "Cannot convert String value (%1$s) into a value of type (%2$s)!" , value , type . getName ( ) ) ) ; } | Converts the configuration setting property value into a value of the specified type . |
9,509 | protected String defaultIfUnset ( final String value , final String defaultValue ) { return ( StringUtils . hasText ( value ) ? value : defaultValue ) ; } | Returns value if not blank otherwise returns default value . |
9,510 | public boolean isPresent ( final String propertyName ) { for ( String configurationPropertyName : this ) { if ( configurationPropertyName . equals ( propertyName ) ) { return true ; } } return false ; } | Determines whether the configuration property identified by name is present in the configuration settings which means the configuration property was declared but not necessarily defined . |
9,511 | public String getPropertyValue ( final String propertyName , final boolean required ) { String propertyValue = doGetPropertyValue ( propertyName ) ; if ( StringUtils . isBlank ( propertyValue ) && getParent ( ) != null ) { propertyValue = getParent ( ) . getPropertyValue ( propertyName , required ) ; } if ( StringUtils . isBlank ( propertyValue ) && required ) { throw new ConfigurationException ( String . format ( "The property (%1$s) is required!" , propertyName ) ) ; } return defaultIfUnset ( propertyValue , null ) ; } | Gets the value of the configuration property identified by name . The required parameter can be used to indicate the property is not required and that a ConfigurationException should not be thrown if the property is undeclared or undefined . |
9,512 | public String getPropertyValue ( final String propertyName , final String defaultPropertyValue ) { return defaultIfUnset ( getPropertyValue ( propertyName , NOT_REQUIRED ) , defaultPropertyValue ) ; } | Gets the value of the configuration property identified by name . The defaultPropertyValue parameter effectively overrides the required attribute indicating that the property is not required to be declared or defined . |
9,513 | public < T > T getPropertyValueAs ( final String propertyName , final Class < T > type ) { return convert ( getPropertyValue ( propertyName , DEFAULT_REQUIRED ) , type ) ; } | Gets the value of the configuration property identified by name as a value of the specified Class type . The property is required to be declared and defined otherwise a ConfigurationException is thrown . |
9,514 | public < T > T getPropertyValueAs ( final String propertyName , final boolean required , final Class < T > type ) { try { return convert ( getPropertyValue ( propertyName , required ) , type ) ; } catch ( ConversionException e ) { if ( required ) { throw new ConfigurationException ( String . format ( "Failed to get the value of configuration setting property (%1$s) as type (%2$s)!" , propertyName , ClassUtils . getName ( type ) ) , e ) ; } return null ; } } | Gets the value of the configuration property identified by name as a value of the specified Class type . The required parameter can be used to indicate the property is not required and that a ConfigurationException should not be thrown if the property is undeclared or undefined . |
9,515 | @ SuppressWarnings ( "unchecked" ) public < T > T getPropertyValueAs ( final String propertyName , final T defaultPropertyValue , final Class < T > type ) { try { return ObjectUtils . defaultIfNull ( convert ( getPropertyValue ( propertyName , NOT_REQUIRED ) , type ) , defaultPropertyValue ) ; } catch ( ConversionException ignore ) { return defaultPropertyValue ; } } | Gets the value of the configuration property identified by name as a value of the specified Class type . The defaultPropertyValue parameter effectively overrides the required attribute indicating that the property is not required to be declared or defined . |
9,516 | @ SuppressWarnings ( "unchecked" ) public static < T extends Sorter > T createSorter ( final SortType type ) { switch ( ObjectUtils . defaultIfNull ( type , SortType . UNKONWN ) ) { case BUBBLE_SORT : return ( T ) new BubbleSort ( ) ; case COMB_SORT : return ( T ) new CombSort ( ) ; case HEAP_SORT : return ( T ) new HeapSort ( ) ; case INSERTION_SORT : return ( T ) new InsertionSort ( ) ; case MERGE_SORT : return ( T ) new MergeSort ( ) ; case QUICK_SORT : return ( T ) new QuickSort ( ) ; case SELECTION_SORT : return ( T ) new SelectionSort ( ) ; case SHELL_SORT : return ( T ) new ShellSort ( ) ; default : throw new IllegalArgumentException ( String . format ( "The SortType (%1$s) is not supported by the %2$s!" , type , SorterFactory . class . getSimpleName ( ) ) ) ; } } | Creates an instance of the Sorter interface implementing the sorting algorithm based on the SortType . |
9,517 | public static < T extends Sorter > T createSorterElseDefault ( final SortType type , final T defaultSorter ) { try { return createSorter ( type ) ; } catch ( IllegalArgumentException ignore ) { return defaultSorter ; } } | Creates an instance of the Sorter interface implementing the sorting algorithm based on the SortType otherwise returns the provided default Sorter implementation if a Sorter based on the specified SortType is not available . |
9,518 | public void start ( ) { super . start ( ) ; if ( enabled ) { metricPublishing . start ( new GraphiteConfigImpl ( host , port , pollintervalseconds , queuesize , sendasrate ) ) ; } this . startUpMetric = factory . createStartUpMetric ( metricObjects , subsystem , new Timer ( ) ) ; startUpMetric . start ( ) ; } | Starts the appender by starting a background thread to poll the error counters and publish them to Graphite . Multiple instances of this EmitToGraphiteLogbackAppender will only start one background thread . This method also starts the heartbeat metric background thread . |
9,519 | public void stop ( ) { if ( enabled ) { metricPublishing . stop ( ) ; } if ( startUpMetric != null ) { startUpMetric . stop ( ) ; } super . stop ( ) ; } | Stops the appender shutting down the background polling thread to ensure that the connection to the metrics database is closed . This method also stops the heartbeat method background thread . |
9,520 | protected String getFieldName ( String propertyName ) { return ObjectUtils . defaultIfNull ( propertyNameToFieldNameMapping . get ( propertyName ) , propertyName ) ; } | Gets the name of the field mapped to the given property . If no such mapping exists then the given property name is returned . |
9,521 | @ SuppressWarnings ( "unchecked" ) public void setModifiedBy ( USER modifiedBy ) { processChange ( "modifiedBy" , this . modifiedBy , modifiedBy ) ; this . lastModifiedBy = ObjectUtils . defaultIfNull ( this . lastModifiedBy , this . modifiedBy ) ; } | Sets the user who is responsible for modifying this object . |
9,522 | void changeState ( String propertyName , Object newValue ) { try { ObjectUtils . setField ( this , getFieldName ( propertyName ) , newValue ) ; } catch ( IllegalArgumentException e ) { throw new PropertyNotFoundException ( String . format ( "The property (%1$s) corresponding to field (%2$s) was not found in this Bean (%3$s)!" , propertyName , getFieldName ( propertyName ) , getClass ( ) . getName ( ) ) , e ) ; } } | Changes the value of the given property referenced by name to the new Object value effectively modifying the internal state of this Bean . This method uses the Java reflective APIs to set the field corresponding to the specified property . |
9,523 | @ SuppressWarnings ( "all" ) public int compareTo ( Bean < ID , USER , PROCESS > obj ) { Assert . isInstanceOf ( obj , getClass ( ) , new ClassCastException ( String . format ( "The Bean being compared with this Bean must be an instance of %1$s!" , getClass ( ) . getName ( ) ) ) ) ; return ComparatorUtils . compareIgnoreNull ( getId ( ) , obj . getId ( ) ) ; } | Compares the specified Bean with this Bean to determine order . The default implementation is to order by identifier where null identifiers are ordered before non - null identifiers . |
9,524 | protected PropertyChangeEvent newPropertyChangeEvent ( String propertyName , Object oldValue , Object newValue ) { if ( isEventDispatchEnabled ( ) ) { if ( vetoableChangeSupport . hasListeners ( propertyName ) || propertyChangeSupport . hasListeners ( propertyName ) ) { return new PropertyChangeEvent ( this , propertyName , oldValue , newValue ) ; } } return this . propertyChangeEvent ; } | Creates a new instance of the PropertyChangeEvent initialized with this Bean as the source as well as the name of the property that is changing along with the property s old and new values . A PropertyChangeEvent will be created only if event dispatching to registered listeners is enabled and there are either PropertyChangeListeners or VetoableChangeListeners registered on this Bean . |
9,525 | protected void firePropertyChange ( PropertyChangeEvent event ) { if ( isEventDispatchEnabled ( ) ) { Assert . notNull ( event , "The PropertyChangeEvent cannot be null!" ) ; if ( propertyChangeSupport . hasListeners ( event . getPropertyName ( ) ) ) { propertyChangeSupport . firePropertyChange ( event ) ; } } } | Notifies all PropertyChangeListeners of a property change event occurring on this Bean . |
9,526 | protected void fireVetoableChange ( PropertyChangeEvent event ) throws PropertyVetoException { if ( isEventDispatchEnabled ( ) ) { Assert . notNull ( event , "The PropertyChangeEvent cannot be null!" ) ; if ( vetoableChangeSupport . hasListeners ( event . getPropertyName ( ) ) ) { vetoableChangeSupport . fireVetoableChange ( event ) ; } } } | Notifies all VetoableChangeListeners of a property change event occurring on this Bean . The change to the property may potentially be vetoed by one of the VetoableChangeListeners listening to property changes on this Bean resulting in preventing the value of the property to change . |
9,527 | protected boolean mapPropertyNameToFieldName ( final String propertyName , final String fieldName ) { propertyNameToFieldNameMapping . put ( propertyName , fieldName ) ; return propertyNameToFieldNameMapping . containsKey ( propertyName ) ; } | Creates a mapping from the specified property on this Bean class to one of the Bean object s fields . |
9,528 | protected boolean mapPropertyNameToParameterizedStateChangeCallback ( String propertyName , ParameterizedStateChangeCallback callback ) { propertyNameToParameterizedStateChangeCallbackMapping . put ( propertyName , callback ) ; return propertyNameToParameterizedStateChangeCallbackMapping . containsKey ( propertyName ) ; } | Creates a mapping from the specified property on this Bean to the specified ParameterizedStateChangeCallback for affecting state transitions and changes . |
9,529 | public static snmp_manager [ ] get_filtered ( nitro_service service , filtervalue [ ] filter ) throws Exception { snmp_manager obj = new snmp_manager ( ) ; options option = new options ( ) ; option . set_filter ( filter ) ; snmp_manager [ ] response = ( snmp_manager [ ] ) obj . getfiltered ( service , option ) ; return response ; } | Use this API to fetch filtered set of snmp_manager resources . set the filter parameter values in filtervalue object . |
9,530 | public static long count ( nitro_service service ) throws Exception { sms_server obj = new sms_server ( ) ; options option = new options ( ) ; option . set_count ( true ) ; sms_server [ ] response = ( sms_server [ ] ) obj . get_resources ( service , option ) ; if ( response != null && response . length > 0 ) return response [ 0 ] . __count ; return 0 ; } | Use this API to count the sms_server resources configured on NetScaler SDX . |
9,531 | public void set_filter ( filtervalue [ ] filter ) { String str = null ; for ( int i = 0 ; i < filter . length ; i ++ ) { if ( str != null ) str = str + "," ; if ( str == null ) str = filter [ i ] . get_name ( ) + ":" + nitro_util . encode ( filter [ i ] . get_value ( ) ) ; else str = str + filter [ i ] . get_name ( ) + ":" + nitro_util . encode ( filter [ i ] . get_value ( ) ) ; ; } this . filter = str ; } | sets filter field . |
9,532 | public static task_device_log get ( nitro_service client , task_device_log resource ) throws Exception { resource . validate ( "get" ) ; return ( ( task_device_log [ ] ) resource . get_resources ( client ) ) [ 0 ] ; } | Use this operation to get task log for each device . |
9,533 | public static < T > T withFields ( Class < T > clazz , Object ... keysAndValues ) { return Mockito . mock ( clazz , new FakerAnswer ( keysAndValues ) ) ; } | Create a mock object with given field values . |
9,534 | public Collection < String > getAllProperties ( ) { return wrappedSubmit ( new Callable < Collection < String > > ( ) { public Collection < String > call ( ) throws Exception { Collection < String > allProperties = new HashSet < String > ( ) ; ObjectMapper mapper = new ObjectMapper ( ) ; List < XmlProperty > xmlproperties = new ArrayList < XmlProperty > ( ) ; try { xmlproperties = mapper . readValue ( service . path ( resourceProperties ) . accept ( MediaType . APPLICATION_JSON ) . get ( String . class ) , new TypeReference < List < XmlProperty > > ( ) { } ) ; } catch ( JsonParseException e ) { e . printStackTrace ( ) ; } catch ( JsonMappingException e ) { e . printStackTrace ( ) ; } catch ( ClientHandlerException e ) { e . printStackTrace ( ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } for ( XmlProperty xmlproperty : xmlproperties ) { allProperties . add ( xmlproperty . getName ( ) ) ; } return allProperties ; } } ) ; } | Get a list of names of all the properties currently present on the channelfinder service . |
9,535 | public Collection < String > getAllTags ( ) { return wrappedSubmit ( new Callable < Collection < String > > ( ) { public Collection < String > call ( ) throws Exception { Collection < String > allTags = new HashSet < String > ( ) ; ObjectMapper mapper = new ObjectMapper ( ) ; List < XmlTag > xmltags = new ArrayList < XmlTag > ( ) ; try { xmltags = mapper . readValue ( service . path ( resourceTags ) . accept ( MediaType . APPLICATION_JSON ) . get ( String . class ) , new TypeReference < List < XmlTag > > ( ) { } ) ; } catch ( JsonParseException e ) { e . printStackTrace ( ) ; } catch ( JsonMappingException e ) { e . printStackTrace ( ) ; } catch ( ClientHandlerException e ) { e . printStackTrace ( ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } for ( XmlTag xmltag : xmltags ) { allTags . add ( xmltag . getName ( ) ) ; } return allTags ; } } ) ; } | Get a list of names of all the tags currently present on the channelfinder service . |
9,536 | public void set ( Collection < Builder > channels ) throws ChannelFinderException { wrappedSubmit ( new SetChannels ( ChannelUtil . toCollectionXmlChannels ( channels ) ) ) ; } | Destructively set a set of channels if any channels already exists it is replaced . |
9,537 | @ SuppressWarnings ( "all" ) public static boolean and ( Boolean ... values ) { boolean result = ( values != null ) ; if ( result ) { for ( Boolean value : values ) { result &= valueOf ( value ) ; if ( ! result ) { break ; } } } return result ; } | Performs a logical AND on all the Boolean values and returns true if an only if all Boolean values evaluate to true as determined by the BooleanUtils . valueOf method on the Boolean wrapper object . If the Boolean array is null then the result of the AND operation is false . |
9,538 | @ SuppressWarnings ( "all" ) public static boolean or ( Boolean ... values ) { boolean result = false ; for ( Boolean value : nullSafeArray ( values , Boolean . class ) ) { result |= valueOf ( value ) ; if ( result ) { break ; } } return result ; } | Performs a logical OR on all the Boolean values and returns true if just one Boolean value evaluates to true as determined by the BooleanUtils . valueOf method on the Boolean wrapper object . If the Boolean array is null the result of the OR operation is false . |
9,539 | public static boolean xor ( Boolean ... values ) { boolean result = false ; for ( Boolean value : nullSafeArray ( values , Boolean . class ) ) { boolean primitiveValue = valueOf ( value ) ; if ( result && primitiveValue ) { return false ; } result |= primitiveValue ; } return result ; } | Performs a logical exclusive OR on the array of Boolean values and returns true if and only if the Boolean array is not null and 1 and only 1 Boolean wrapper object evaluates to true as determined by the BooleanUtils . valueof method . |
9,540 | public static < V > StrategicBlockingQueue < V > newStrategicLinkedBlockingQueue ( QueueingStrategy < V > queueingStrategy ) { return new StrategicBlockingQueue < V > ( new LinkedBlockingQueue < V > ( ) , queueingStrategy ) ; } | Return a StrategicBlockingQueue backed by a LinkedBlockingQueue using the given QueueingStrategy . |
9,541 | public static < V > StrategicBlockingQueue < V > newStrategicArrayBlockingQueue ( int capacity , QueueingStrategy < V > queueingStrategy ) { return new StrategicBlockingQueue < V > ( new ArrayBlockingQueue < V > ( capacity ) , queueingStrategy ) ; } | Return a StrategicBlockingQueue backed by an ArrayBlockingQueue of the given capacity using the given QueueingStrategy . |
9,542 | public static < V > StrategicBlockingQueue < V > newStrategicBlockingQueue ( BlockingQueue < V > blockingQueue , QueueingStrategy < V > queueingStrategy ) { return new StrategicBlockingQueue < V > ( blockingQueue , queueingStrategy ) ; } | Return a StrategicBlockingQueue backed by the given BlockingQueue using the given QueueingStrategy . |
9,543 | public void show ( ) { if ( isVisible ( ) ) { return ; } resetToInitialState ( ) ; setVisible ( true ) ; final Timeline phaseOne = new Timeline ( ) ; phaseOne . getKeyFrames ( ) . addAll ( new KeyFrame ( Duration . ZERO , new KeyValue ( transformRadius , fromRadius ) , new KeyValue ( transformOpacity , 0 ) ) , new KeyFrame ( new Duration ( 120 ) , new KeyValue ( transformRadius , parentSection . getNominalRadius ( ) ) , new KeyValue ( transformOpacity , 1 ) ) ) ; final Timeline phaseTwo = new Timeline ( ) ; phaseTwo . getKeyFrames ( ) . addAll ( new KeyFrame ( Duration . ZERO , new KeyValue ( transformAngle , parentSection . getAngularAxisDeg ( ) ) ) , new KeyFrame ( new Duration ( 80 ) , new KeyValue ( transformAngle , angle ) ) ) ; phaseOne . setOnFinished ( event -> phaseTwo . play ( ) ) ; phaseTwo . setOnFinished ( event -> setMouseTransparent ( false ) ) ; phaseOne . play ( ) ; } | Trainsit the button to Visible state . |
9,544 | public static void setupMenuButton ( ButtonBase button , RadialMenuParams params , Node graphic , String tooltip , boolean addStyle ) { button . minWidthProperty ( ) . bind ( params . buttonSizeProperty ( ) ) ; button . minHeightProperty ( ) . bind ( params . buttonSizeProperty ( ) ) ; button . prefWidthProperty ( ) . bind ( params . buttonSizeProperty ( ) ) ; button . prefHeightProperty ( ) . bind ( params . buttonSizeProperty ( ) ) ; button . maxWidthProperty ( ) . bind ( params . buttonSizeProperty ( ) ) ; button . maxHeightProperty ( ) . bind ( params . buttonSizeProperty ( ) ) ; if ( addStyle ) { button . getStylesheets ( ) . addAll ( params . getStyleSheets ( ) ) ; } button . setId ( params . getStyleId ( ) ) ; button . getStyleClass ( ) . addAll ( params . getStyleClasses ( ) ) ; button . setGraphic ( graphic ) ; button . setTooltip ( new Tooltip ( tooltip ) ) ; } | Setup the round button . |
9,545 | public static < T > CompletableFuture < T > immediateFailedFuture ( final Throwable ex ) { final CompletableFuture < T > future = new CompletableFuture < > ( ) ; future . completeExceptionally ( ex ) ; return future ; } | Returns a completable future that is exceptionally completed with the provided exception . |
9,546 | public static ping get ( nitro_service client , ping resource ) throws Exception { resource . validate ( "get" ) ; return ( ( ping [ ] ) resource . get_resources ( client ) ) [ 0 ] ; } | Use this operation to get the status of ping on a given device . |
9,547 | public static inventory get ( nitro_service client , inventory resource ) throws Exception { resource . validate ( "get" ) ; return ( ( inventory [ ] ) resource . get_resources ( client ) ) [ 0 ] ; } | Use this operation to start inventory of a given device . All devices if device IP Address is not specified .. |
9,548 | public static inventory [ ] get_filtered ( nitro_service service , filtervalue [ ] filter ) throws Exception { inventory obj = new inventory ( ) ; options option = new options ( ) ; option . set_filter ( filter ) ; inventory [ ] response = ( inventory [ ] ) obj . getfiltered ( service , option ) ; return response ; } | Use this API to fetch filtered set of inventory resources . set the filter parameter values in filtervalue object . |
9,549 | public final void setId ( final ID id ) { Assert . notNull ( id , "The identifier for Rule ({0}) cannot be null!" , getClass ( ) . getName ( ) ) ; this . id = id ; } | Sets the identifier for this Rule . |
9,550 | public static void scan ( String source , OutputStream os ) throws IOException { scanSource ( source , new StringOutputStream ( os ) ) ; } | Iteratively finds all jar files if source is a directory and scans them or if a file scan it . The string values of the resulting records will be written to the specified output stream . Embedded jars are a record on their own . |
9,551 | public static ArrayList < VictimsRecord > getRecords ( String source ) throws IOException { ArrayList < VictimsRecord > records = new ArrayList < VictimsRecord > ( ) ; scan ( source , records ) ; return records ; } | Iteratively finds all jar files if source is a directory and scans them or if a file scan it . |
9,552 | public static boolean isIdentical ( final String expected , final String actual ) { final Diff diff = createDiffResult ( expected , actual , false ) ; return diff . identical ( ) ; } | This method will compare both XMLs and validate its attribute order . |
9,553 | public static boolean isSimilar ( final String expected , final String actual ) { final Diff diff = createDiffResult ( expected , actual , true ) ; return diff . similar ( ) ; } | This method will compare both XMLs and WILL NOT validate its attribute order . |
9,554 | @ SuppressWarnings ( "unchecked" ) public < T > Collection < Collection < T > > components ( ) { return ( Collection < Collection < T > > ) this . components ; } | Accesses the strongly connected components . |
9,555 | public static mps_doc_image [ ] get_filtered ( nitro_service service , filtervalue [ ] filter ) throws Exception { mps_doc_image obj = new mps_doc_image ( ) ; options option = new options ( ) ; option . set_filter ( filter ) ; mps_doc_image [ ] response = ( mps_doc_image [ ] ) obj . getfiltered ( service , option ) ; return response ; } | Use this API to fetch filtered set of mps_doc_image resources . set the filter parameter values in filtervalue object . |
9,556 | @ SuppressWarnings ( "unchecked" ) protected < T > T configure ( final T object ) { if ( object instanceof Configurable && isConfigurationAvailable ( ) ) { ( ( Configurable ) object ) . configure ( getConfiguration ( ) ) ; } return object ; } | Configures the object with an available Configuration if the object implements Configurable . |
9,557 | protected < T > T initialize ( final T object , final Map < ? , ? > parameters ) { if ( object instanceof ParameterizedInitable ) { ( ( ParameterizedInitable ) object ) . init ( parameters ) ; return object ; } else { return initialize ( object , parameters . values ( ) ) ; } } | Initializes the object with the specified Map of named parameters providing the object implements the ParameterizedInitable interface otherwise delegates to the initialize method accepting an array of arguments by passing the values of the Map as the argument array . |
9,558 | protected < T > T initialize ( final T object , final Object ... args ) { if ( object instanceof ParameterizedInitable ) { ( ( ParameterizedInitable ) object ) . init ( args ) ; } else if ( object instanceof Initable ) { ( ( Initable ) object ) . init ( ) ; } return object ; } | Initializes the object with the specified array of arguments providing the object implements the ParameterizedInitable interface or calls the no argument init method if the object implements the Initable interface and finally does nothing if the object is not Initable . |
9,559 | public static br_device_profile [ ] get_filtered ( nitro_service service , filtervalue [ ] filter ) throws Exception { br_device_profile obj = new br_device_profile ( ) ; options option = new options ( ) ; option . set_filter ( filter ) ; br_device_profile [ ] response = ( br_device_profile [ ] ) obj . getfiltered ( service , option ) ; return response ; } | Use this API to fetch filtered set of br_device_profile resources . set the filter parameter values in filtervalue object . |
9,560 | public static hostcpu get ( nitro_service client , hostcpu resource ) throws Exception { resource . validate ( "get" ) ; return ( ( hostcpu [ ] ) resource . get_resources ( client ) ) [ 0 ] ; } | Use this operation to get CPU Cores . |
9,561 | private static String getPropertyValue ( String key ) { String env = System . getProperty ( key ) ; if ( env == null ) { if ( DEFAULT_PROPS . containsKey ( key ) ) { return DEFAULT_PROPS . get ( key ) ; } else { return null ; } } return env ; } | Return a configured value or the default . |
9,562 | public static String serviceURI ( ) throws VictimsException { URL merged ; try { merged = new URL ( new URL ( uri ( ) ) , entry ( ) ) ; return merged . toString ( ) ; } catch ( MalformedURLException e ) { throw new VictimsException ( "Invalid configuration for service URI." , e ) ; } } | Get a complete webservice uri by merging base and entry point . |
9,563 | public static File home ( ) throws VictimsException { File directory = new File ( getPropertyValue ( Key . HOME ) ) ; if ( ! directory . exists ( ) ) { try { FileUtils . forceMkdir ( directory ) ; } catch ( IOException e ) { throw new VictimsException ( "Could not create home directory." , e ) ; } } return directory ; } | Get the configured cache directory . If the directory does not exist it will be created . |
9,564 | public static ArrayList < Algorithms > algorithms ( ) { ArrayList < Algorithms > algorithms = new ArrayList < Algorithms > ( ) ; for ( String alg : getPropertyValue ( Key . ALGORITHMS ) . split ( "," ) ) { alg = alg . trim ( ) ; try { algorithms . add ( Algorithms . valueOf ( alg ) ) ; } catch ( Exception e ) { } } if ( ! algorithms . contains ( getDefaultAlgorithm ( ) ) ) { algorithms . add ( getDefaultAlgorithm ( ) ) ; } return algorithms ; } | Returns a list of valid algorithms to be used when fingerprinting . If not specified or if all values are illegal all available algorithms are used . |
9,565 | public static String dbUrl ( ) { String dbUrl = getPropertyValue ( Key . DB_URL ) ; if ( dbUrl == null ) { if ( VictimsDB . Driver . exists ( dbDriver ( ) ) ) { return VictimsDB . defaultURL ( dbDriver ( ) ) ; } return VictimsDB . defaultURL ( ) ; } return dbUrl ; } | Get the db connection URL . |
9,566 | public static < K , V > Map < K , V > transform ( Map < K , V > map , Transformer < V > transformer ) { Assert . notNull ( map , "Map is required" ) ; Assert . notNull ( transformer , "Transformer is required" ) ; return map . entrySet ( ) . stream ( ) . collect ( Collectors . toMap ( Map . Entry :: < K > getKey , ( entry ) -> transformer . transform ( entry . getValue ( ) ) ) ) ; } | Transforms the values of the given Map with the specified Transformer . |
9,567 | public static String toIso8601 ( Date date ) { if ( date == null ) return null ; return ISODateTimeFormat . dateTimeNoMillis ( ) . withZoneUTC ( ) . print ( date . getTime ( ) ) ; } | Returns a ISO8601 string of the given date . |
9,568 | public void clean ( ) { if ( ! remove ( this ) ) return ; try { thunk . run ( ) ; } catch ( final Throwable x ) { AccessController . doPrivileged ( new PrivilegedAction < Void > ( ) { public Void run ( ) { if ( System . err != null ) new Error ( "Cleaner terminated abnormally" , x ) . printStackTrace ( ) ; System . exit ( 1 ) ; return null ; } } ) ; } } | Runs this cleaner if it has not been run before . |
9,569 | private boolean shouldPrettyPrint ( HttpRequest request ) { QueryStringDecoder decoder = new QueryStringDecoder ( request . getUri ( ) , Charsets . UTF_8 , true , 2 ) ; Map < String , List < String > > parameters = decoder . parameters ( ) ; if ( parameters . containsKey ( PP_PARAMETER ) ) { return parseBoolean ( parameters . get ( PP_PARAMETER ) . get ( 0 ) ) ; } else if ( parameters . containsKey ( PRETTY_PRINT_PARAMETER ) ) { return parseBoolean ( parameters . get ( PRETTY_PRINT_PARAMETER ) . get ( 0 ) ) ; } return true ; } | Determines whether the response to the request should be pretty - printed . |
9,570 | public static String constantValue ( int index , ConstantPool cp ) { Constant type = cp . getConstant ( index ) ; if ( type != null ) { switch ( type . getTag ( ) ) { case Constants . CONSTANT_Class : ConstantClass cls = ( ConstantClass ) type ; return constantValue ( cls . getNameIndex ( ) , cp ) ; case Constants . CONSTANT_Double : ConstantDouble dbl = ( ConstantDouble ) type ; return String . valueOf ( dbl . getBytes ( ) ) ; case Constants . CONSTANT_Fieldref : ConstantFieldref fieldRef = ( ConstantFieldref ) type ; return constantValue ( fieldRef . getClassIndex ( ) , cp ) + " " + constantValue ( fieldRef . getNameAndTypeIndex ( ) , cp ) ; case Constants . CONSTANT_Float : ConstantFloat flt = ( ConstantFloat ) type ; return String . valueOf ( flt . getBytes ( ) ) ; case Constants . CONSTANT_Integer : ConstantInteger integer = ( ConstantInteger ) type ; return String . valueOf ( integer . getBytes ( ) ) ; case Constants . CONSTANT_InterfaceMethodref : ConstantInterfaceMethodref intRef = ( ConstantInterfaceMethodref ) type ; return constantValue ( intRef . getClassIndex ( ) , cp ) + " " + constantValue ( intRef . getNameAndTypeIndex ( ) , cp ) ; case Constants . CONSTANT_Long : ConstantLong lng = ( ConstantLong ) type ; return String . valueOf ( lng . getBytes ( ) ) ; case Constants . CONSTANT_Methodref : ConstantMethodref methRef = ( ConstantMethodref ) type ; return constantValue ( methRef . getClassIndex ( ) , cp ) + " " + constantValue ( methRef . getNameAndTypeIndex ( ) , cp ) ; case Constants . CONSTANT_NameAndType : ConstantNameAndType nameType = ( ConstantNameAndType ) type ; return nameType . getName ( cp ) + " " + nameType . getSignature ( cp ) ; case Constants . CONSTANT_String : ConstantString str = ( ConstantString ) type ; return str . getBytes ( cp ) ; case Constants . CONSTANT_Utf8 : ConstantUtf8 utf8 = ( ConstantUtf8 ) type ; return utf8 . getBytes ( ) ; } } return "" ; } | Resolves a constants value from the constant pool to the lowest form it can be represented by . E . g . String Integer Float etc . |
9,571 | public static byte [ ] normalize ( byte [ ] bytes , String fileName ) throws IOException { ByteArrayInputStream is = new ByteArrayInputStream ( bytes ) ; ClassParser parser = new ClassParser ( is , fileName ) ; StringBuffer buf = new StringBuffer ( ) ; JavaClass klass = parser . parse ( ) ; ConstantPool cpool = klass . getConstantPool ( ) ; buf . append ( klass . getSourceFileName ( ) ) ; buf . append ( String . valueOf ( klass . getAccessFlags ( ) ) ) ; buf . append ( constantValue ( klass . getClassNameIndex ( ) , cpool ) ) ; buf . append ( constantValue ( klass . getSuperclassNameIndex ( ) , cpool ) ) ; for ( int index : klass . getInterfaceIndices ( ) ) { buf . append ( constantValue ( index , cpool ) ) ; } for ( Field f : klass . getFields ( ) ) { buf . append ( String . valueOf ( f . getAccessFlags ( ) ) ) ; buf . append ( constantValue ( f . getNameIndex ( ) , cpool ) ) ; buf . append ( constantValue ( f . getSignatureIndex ( ) , cpool ) ) ; if ( f . getConstantValue ( ) != null ) { int index = f . getConstantValue ( ) . getConstantValueIndex ( ) ; buf . append ( constantValue ( index , klass . getConstantPool ( ) ) ) ; } } for ( Method m : klass . getMethods ( ) ) { buf . append ( String . valueOf ( m . getAccessFlags ( ) ) ) ; buf . append ( constantValue ( m . getNameIndex ( ) , cpool ) ) ; buf . append ( constantValue ( m . getSignatureIndex ( ) , cpool ) ) ; Code code = m . getCode ( ) ; if ( code != null ) { ByteSequence bytecode = new ByteSequence ( code . getCode ( ) ) ; buf . append ( formatBytecode ( bytecode , cpool ) ) ; } } return buf . toString ( ) . getBytes ( VictimsConfig . charset ( ) ) ; } | The driving function that normalizes given byte code . |
9,572 | public static < T extends Comparable < T > > RelationalOperator < T > equalTo ( T value ) { return new EqualToOperator < > ( value ) ; } | Gets the RelationalOperator performing equality comparisons to determine whether all provided values are equal to the given expected value . |
9,573 | public static < T extends Comparable < T > > RelationalOperator < T > greaterThan ( T lowerBound ) { return new GreaterThanOperator < > ( lowerBound ) ; } | Gets the RelationalOperator performing greater than comparisons to determine whether all provided values are greater than the given lower bound value . |
9,574 | public static < T extends Comparable < T > > RelationalOperator < T > greaterThanAndLessThan ( T lowerBound , T upperBound ) { return ComposableRelationalOperator . compose ( greaterThan ( lowerBound ) , LogicalOperator . AND , lessThan ( upperBound ) ) ; } | Gets the RelationalOperator performing greater than and less than comparisons to determine whether all provided values are greater than some lower bound value and also less than some upper bound value . |
9,575 | public static < T extends Comparable < T > > RelationalOperator < T > greaterThanAndLessThanEqualTo ( T lowerBound , T upperBound ) { return ComposableRelationalOperator . compose ( greaterThan ( lowerBound ) , LogicalOperator . AND , lessThanEqualTo ( upperBound ) ) ; } | Gets the RelationalOperator performing greater than and less than equal to comparisons to determine whether all provided values are greater than some lower bound value and also less than equal to some upper bound value . |
9,576 | public static < T extends Comparable < T > > RelationalOperator < T > greaterThanEqualTo ( T lowerBound ) { return new GreaterThanEqualToOperator < > ( lowerBound ) ; } | Gets the RelationalOperator performing greater than equal to comparisons to determine whether all provided values are greater than equal to the given lower bound value . |
9,577 | public static < T extends Comparable < T > > RelationalOperator < T > greaterThanEqualToAndLessThan ( T lowerBound , T upperBound ) { return ComposableRelationalOperator . compose ( greaterThanEqualTo ( lowerBound ) , LogicalOperator . AND , lessThan ( upperBound ) ) ; } | Gets the RelationalOperator performing greater than equal to and less than comparisons to determine whether all provided values are greater than equal to some lower bound value and also less than some upper bound value . |
9,578 | public static < T extends Comparable < T > > RelationalOperator < T > greaterThanEqualToAndLessThanEqualTo ( T lowerBound , T upperBound ) { return ComposableRelationalOperator . compose ( greaterThanEqualTo ( lowerBound ) , LogicalOperator . AND , lessThanEqualTo ( upperBound ) ) ; } | Gets the RelationalOperator performing greater than equal to and less than equal to comparisons to determine whether all provided values are greater than equal to some lower bound value and also less than equal to some upper bound value . |
9,579 | public static < T extends Comparable < T > > RelationalOperator < T > lessThan ( T lowerBound ) { return new LessThanOperator < > ( lowerBound ) ; } | Gets the RelationalOperator performing less than comparisons to determine whether all provided values are less than the given upper bound value . |
9,580 | public static < T extends Comparable < T > > RelationalOperator < T > lessThanOrGreaterThan ( T lowerBound , T upperBound ) { return ComposableRelationalOperator . compose ( lessThan ( lowerBound ) , LogicalOperator . OR , greaterThan ( upperBound ) ) ; } | Gets the RelationalOperator performing less than or greater than comparisons to determine whether all provided values are less than some upper bound value or possibly greater than some lower bound value . |
9,581 | public static < T extends Comparable < T > > RelationalOperator < T > lessThanOrGreaterThanEqualTo ( T lowerBound , T upperBound ) { return ComposableRelationalOperator . compose ( lessThan ( lowerBound ) , LogicalOperator . OR , greaterThanEqualTo ( upperBound ) ) ; } | Gets the RelationalOperator performing less than or greater than equal to comparisons to determine whether all provided values are less than some upper bound value or possibly greater than equal to some lower bound value . |
9,582 | public static < T extends Comparable < T > > RelationalOperator < T > lessThanEqualTo ( T lowerBound ) { return new LessThanEqualToOperator < > ( lowerBound ) ; } | Gets the RelationalOperator performing less than equal to comparisons to determine whether all provided values are less than equal to the given upper bound value . |
9,583 | public static < T extends Comparable < T > > RelationalOperator < T > lessThanEqualToOrGreaterThan ( T lowerBound , T upperBound ) { return ComposableRelationalOperator . compose ( lessThanEqualTo ( lowerBound ) , LogicalOperator . OR , greaterThan ( upperBound ) ) ; } | Gets the RelationalOperator performing less than equal to or greater than comparisons to determine whether all provided values are less than equal to some upper bound value or possibly greater than some lower bound value . |
9,584 | public static < T extends Comparable < T > > RelationalOperator < T > lessThanEqualToOrGreaterThanEqualTo ( T lowerBound , T upperBound ) { return ComposableRelationalOperator . compose ( lessThanEqualTo ( lowerBound ) , LogicalOperator . OR , greaterThanEqualTo ( upperBound ) ) ; } | Gets the RelationalOperator performing less than equal to or greater than equal to comparisons to determine whether all provided values are less than equal to some upper bound value or possibly greater than equal to some lower bound value . |
9,585 | public < E > List < E > sort ( final List < E > elements ) { int position = elements . size ( ) ; do { int lastSwapPosition = 0 ; for ( int index = 1 ; index < position ; index ++ ) { if ( getOrderBy ( ) . compare ( elements . get ( index - 1 ) , elements . get ( index ) ) > 0 ) { swap ( elements , index - 1 , index ) ; lastSwapPosition = index ; } } position = lastSwapPosition ; } while ( position != 0 ) ; return elements ; } | Uses the Bubble Sort algorithm to sort a List of elements as defined by the Comparator or as determined by the elements in the collection if the elements are Comparable . |
9,586 | public < E > E search ( final Collection < E > collection ) { for ( E element : collection ) { if ( getMatcher ( ) . isMatch ( element ) ) { return element ; } } return null ; } | Searches the Collection of elements in order to find the element or elements matching the criteria defined by the Matcher . |
9,587 | @ SuppressWarnings ( "all" ) public static boolean areAllNull ( Object ... values ) { for ( Object value : nullSafeArray ( values ) ) { if ( value != null ) { return false ; } } return true ; } | Null - safe method to determine if all the values in the array are null . |
9,588 | public static boolean areAnyNull ( Object ... values ) { for ( Object value : nullSafeArray ( values ) ) { if ( value == null ) { return true ; } } return false ; } | Null - safe method to determine if any of the values in the array are null . |
9,589 | @ SuppressWarnings ( { "unchecked" , "varargs" } ) public static < T > T defaultIfNull ( T ... values ) { for ( T value : nullSafeArray ( values ) ) { if ( value != null ) { return value ; } } return null ; } | Gets the first non - null value in the array of values . |
9,590 | public static RadialMenuSection add ( ContextRadialMenu owner , RadialPane pane , Menu menu , RadialMenuSection parentSection , Double angularAxisDeg ) { final RadialMenuSection section = new RadialMenuSection ( owner , pane , menu , parentSection , angularAxisDeg ) ; pane . addSection ( menu , section ) ; return section ; } | Create new RadialMenuSection |
9,591 | public static mps_ssl_certkey [ ] get_filtered ( nitro_service service , filtervalue [ ] filter ) throws Exception { mps_ssl_certkey obj = new mps_ssl_certkey ( ) ; options option = new options ( ) ; option . set_filter ( filter ) ; mps_ssl_certkey [ ] response = ( mps_ssl_certkey [ ] ) obj . getfiltered ( service , option ) ; return response ; } | Use this API to fetch filtered set of mps_ssl_certkey resources . set the filter parameter values in filtervalue object . |
9,592 | @ SuppressWarnings ( { "unchecked" , "varargs" } ) public < E > E [ ] sort ( final E ... elements ) { Arrays . sort ( elements , getOrderBy ( ) ) ; return elements ; } | Uses Java s modified Merge Sort to sort an array of elements as defined by the Comparator or as determined by the elements in the array if the elements are Comparable . |
9,593 | public < E > List < E > sort ( final List < E > elements ) { Collections . sort ( elements , getOrderBy ( ) ) ; return elements ; } | Uses Java s modified Merge Sort algorithm to sort a List of elements as defined by the Comparator or as determined by the elements in the collection if the elements are Comparable . |
9,594 | public static ns_conf_download_policy get ( nitro_service client ) throws Exception { ns_conf_download_policy resource = new ns_conf_download_policy ( ) ; resource . validate ( "get" ) ; return ( ( ns_conf_download_policy [ ] ) resource . get_resources ( client ) ) [ 0 ] ; } | Use this operation to get the polling frequency of the Netscaler configuration file . |
9,595 | @ SuppressWarnings ( "unchecked" ) public < E > Matcher < E > getMatcher ( ) { Matcher < E > localMatcher = ( Matcher < E > ) MatcherHolder . get ( ) ; Assert . state ( localMatcher != null || matcher != null , "A reference to a Matcher used by this Searcher ({0}) for searching and matching elements in the collection was not properly configured!" , getClass ( ) . getName ( ) ) ; return ObjectUtils . defaultIfNull ( localMatcher , matcher ) ; } | Gets the Matcher used to match and find the desired element or elements in the collection . |
9,596 | public void setMatcher ( final Matcher matcher ) { Assert . notNull ( matcher , "The Matcher used to match elements in the collection during the search operation by this Searcher ({0}) cannot be null!" , getClass ( ) . getName ( ) ) ; this . matcher = matcher ; } | Sets the Matcher used to match and find the desired element or elements in the collection . |
9,597 | @ SuppressWarnings ( { "unchecked" , "varargs" } ) public < E > E search ( final E ... array ) { return search ( Arrays . asList ( array ) ) ; } | Searches the array of elements in order to find the element or elements matching the criteria defined by the Matcher . |
9,598 | public < E > E search ( final Searchable < E > searchable ) { try { return search ( configureMatcher ( searchable ) . asList ( ) ) ; } finally { MatcherHolder . unset ( ) ; } } | Searches the Searchable object in order to find the element or elements matching the criteria defined by the Matcher . |
9,599 | @ SuppressWarnings ( { "unchecked" , "varargs" } ) public < E > Iterable < E > searchForAll ( final E ... array ) { return searchForAll ( Arrays . asList ( array ) ) ; } | Searches an array of elements finding all elements in the array matching the criteria defined by the Matcher . |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.