idx int64 0 165k | question stringlengths 73 5.81k | target stringlengths 5 918 |
|---|---|---|
136,400 | protected ActiveParticipantType addActiveParticipant ( String userID , String altUserID , String userName , Boolean userIsRequestor , List < CodedValueType > roleIdCodes , String networkAccessPointID ) { return addActiveParticipant ( userID , altUserID , userName , userIsRequestor , roleIdCodes , networkAccessPointID ,... | Create and add an Active Participant block to this audit event message but automatically determine the Network Access Point ID Type Code |
136,401 | protected RFC3881NetworkAccessPointTypeCodes getNetworkAccessPointCodeFromAddress ( String address ) { if ( EventUtils . isEmptyOrNull ( address ) ) { return null ; } if ( address . matches ( "^[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}$" ) ) { return RFC3881NetworkAccessPointTypeCodes . IP_ADDRESS ; } return RF... | Attempt to determine the proper Active Participant Network Access Point Type Code from a given string . |
136,402 | public static XCPDInitiatingGatewayAuditor getAuditor ( ) { AuditorModuleContext ctx = AuditorModuleContext . getContext ( ) ; return ( XCPDInitiatingGatewayAuditor ) ctx . getAuditor ( XCPDInitiatingGatewayAuditor . class ) ; } | Get an instance of the XCPD Initiating Gateway Auditor from the global context |
136,403 | public void auditXCPDQueryEvent ( RFC3881EventOutcomeCodes eventOutcome , String sourceUserId , String humanRequestorUserId , CodedValueType humanRequestorRoleIdCode , String XCPDRGUri , String homeCommunityId , String queryByParameter , List < CodedValueType > purposesOfUse ) { if ( ! isAuditorEnabled ( ) ) { return ;... | Audits an ITI - 55 Cross Gateway Patient Discovery event for XCPD Initiating Gateway actors . |
136,404 | public static SVSConsumerAuditor getAuditor ( ) { AuditorModuleContext ctx = AuditorModuleContext . getContext ( ) ; return ( SVSConsumerAuditor ) ctx . getAuditor ( SVSConsumerAuditor . class ) ; } | Get an instance of the SVS Consumer Auditor from the global context |
136,405 | public void auditRetrieveValueSetEvent ( RFC3881EventOutcomeCodes eventOutcome , String repositoryEndpointUri , String valueSetUniqueId , String valueSetName , String valueSetVersion , List < CodedValueType > purposesOfUse , List < CodedValueType > userRoles ) { if ( ! isAuditorEnabled ( ) ) { return ; } ImportEvent im... | Audits an ITI - 48 Retrieve Value Set event for SVS Consumer actors . |
136,406 | public static void main ( String [ ] args ) { try { File homeDir = new File ( args [ 0 ] ) ; int initialCapacity = Integer . parseInt ( args [ 1 ] ) ; KratiDataStore store = new KratiDataStore ( homeDir , initialCapacity ) ; store . populate ( ) ; store . doRandomReads ( 10 ) ; store . close ( ) ; } catch ( Exception e... | java - Xmx4G krati . examples . KratiDataStore homeDir initialCapacity |
136,407 | protected byte [ ] getTransportPayload ( AuditEventMessage msg ) throws UnsupportedEncodingException { if ( msg == null ) { return null ; } byte [ ] msgBytes = msg . getSerializedMessage ( false ) ; if ( EventUtils . isEmptyOrNull ( msgBytes ) ) { return null ; } StringBuilder sb = new StringBuilder ( ) ; sb . append (... | Serialize format and prepare the message payload body for sending by this transport . This includes adding the syslog message header which is transport independent . |
136,408 | private String getSystemHostName ( ) { if ( EventUtils . isEmptyOrNull ( systemHostName ) ) { try { systemHostName = InetAddress . getLocalHost ( ) . getHostName ( ) ; } catch ( Throwable t ) { systemHostName = "localhost" ; } } return systemHostName ; } | Gets the hostname of the system managing this transport |
136,409 | private long fourByteToLong ( byte [ ] bytes , int offset ) { return ( byteToLong ( bytes [ offset + 0 ] ) + ( byteToLong ( bytes [ offset + 1 ] ) << 8 ) + ( byteToLong ( bytes [ offset + 2 ] ) << 16 ) + ( byteToLong ( bytes [ offset + 3 ] ) << 24 ) ) ; } | Convert 4 bytes from the buffer at offset into a long value . |
136,410 | private void hashMix ( ) { a = subtract ( a , b ) ; a = subtract ( a , c ) ; a = xor ( a , c >> 13 ) ; b = subtract ( b , c ) ; b = subtract ( b , a ) ; b = xor ( b , leftShift ( a , 8 ) ) ; c = subtract ( c , a ) ; c = subtract ( c , b ) ; c = xor ( c , ( b >> 13 ) ) ; a = subtract ( a , b ) ; a = subtract ( a , c ) ;... | Mix up the values in the hash function . |
136,411 | public long hash ( byte [ ] buffer , long initialValue ) { int len , pos ; a = 0x09e3779b9L ; b = 0x09e3779b9L ; c = initialValue ; pos = 0 ; for ( len = buffer . length ; len >= 12 ; len -= 12 ) { a = add ( a , fourByteToLong ( buffer , pos ) ) ; b = add ( b , fourByteToLong ( buffer , pos + 4 ) ) ; c = add ( c , four... | Hash a variable - length key into a 32 - bit value . Every bit of the key affects every bit of the return value . Every 1 - bit and 2 - bit delta achieves avalanche . The best hash table sizes are powers of 2 . |
136,412 | public XmlSchemaComplexType createXmlSchemaComplexType ( final XsdDataItem xsdDataItem ) { XmlSchemaComplexType xmlSchemaComplexType = new XmlSchemaComplexType ( getXsd ( ) , true ) ; XmlSchemaChoice xmlSchemaChoice = null ; XmlSchemaSequence xmlSchemaSequence = new XmlSchemaSequence ( ) ; for ( XsdDataItem child : xsd... | Create an XML schema complex type . We want to use Named complex types so we add them to the XSD directly . We add complex types before their children because its nicer for the XSD layout to list roots before leafs . Redefined and redefining elements are grouped into an XML Schema choice . A choice is created when an e... |
136,413 | public XmlSchemaElement createXmlSchemaElement ( final XsdDataItem xsdDataItem ) { XmlSchemaElement element = new XmlSchemaElement ( getXsd ( ) , false ) ; element . setName ( xsdDataItem . getXsdElementName ( ) ) ; if ( xsdDataItem . getMaxOccurs ( ) != 1 ) { element . setMaxOccurs ( xsdDataItem . getMaxOccurs ( ) ) ;... | Create an XML Schema element from a COBOL data item . |
136,414 | protected void addEnumerationFacets ( final XsdDataItem xsdDataItem , final XmlSchemaSimpleTypeRestriction restriction ) { if ( getConfig ( ) . mapConditionsToFacets ( ) ) { boolean hasValueThru = false ; for ( XsdDataItem child : xsdDataItem . getChildren ( ) ) { if ( child . getDataEntryType ( ) == DataEntryType . CO... | If simple type has conditions attached to it emit enumeration facets . |
136,415 | protected XmlSchemaSimpleType createXmlSchemaSimpleType ( final XmlSchemaSimpleTypeRestriction restriction ) { XmlSchemaSimpleType xmlSchemaSimpleType = new XmlSchemaSimpleType ( getXsd ( ) , false ) ; xmlSchemaSimpleType . setContent ( restriction ) ; return xmlSchemaSimpleType ; } | Create an XML schema simple type from a restriction . |
136,416 | protected XmlSchemaSimpleTypeRestriction createRestriction ( final String xsdTypeName ) { XmlSchemaSimpleTypeRestriction restriction = new XmlSchemaSimpleTypeRestriction ( ) ; restriction . setBaseTypeName ( new QName ( XMLConstants . W3C_XML_SCHEMA_NS_URI , xsdTypeName ) ) ; return restriction ; } | Create an XML schema restriction . |
136,417 | protected XmlSchemaMaxLengthFacet createMaxLengthFacet ( final int length ) { XmlSchemaMaxLengthFacet xmlSchemaMaxLengthFacet = new XmlSchemaMaxLengthFacet ( ) ; xmlSchemaMaxLengthFacet . setValue ( length ) ; return xmlSchemaMaxLengthFacet ; } | Create an XML schema maxLength facet . |
136,418 | protected XmlSchemaPatternFacet createPatternFacet ( final String pattern ) { XmlSchemaPatternFacet xmlSchemaPatternFacet = new XmlSchemaPatternFacet ( ) ; xmlSchemaPatternFacet . setValue ( pattern ) ; return xmlSchemaPatternFacet ; } | Create an XML schema pattern facet . |
136,419 | protected XmlSchemaEnumerationFacet createEnumerationFacet ( final String conditionValue ) { XmlSchemaEnumerationFacet xmlSchemaEnumerationFacet = new XmlSchemaEnumerationFacet ( ) ; xmlSchemaEnumerationFacet . setValue ( conditionValue ) ; return xmlSchemaEnumerationFacet ; } | Create an XML schema enumeration facet . |
136,420 | protected XmlSchemaTotalDigitsFacet createTotalDigitsFacet ( final int totalDigits ) { XmlSchemaTotalDigitsFacet xmlSchemaTotalDigitsFacet = new XmlSchemaTotalDigitsFacet ( ) ; xmlSchemaTotalDigitsFacet . setValue ( totalDigits ) ; return xmlSchemaTotalDigitsFacet ; } | Create an XML schema totalDigits facet . |
136,421 | protected XmlSchemaFractionDigitsFacet createFractionDigitsFacet ( final int fractionDigits ) { XmlSchemaFractionDigitsFacet xmlSchemaFractionDigitsFacet = new XmlSchemaFractionDigitsFacet ( ) ; xmlSchemaFractionDigitsFacet . setValue ( fractionDigits ) ; return xmlSchemaFractionDigitsFacet ; } | Create an XML schema fractionDigits facet . |
136,422 | protected XmlSchemaMinInclusiveFacet createMinInclusiveFacet ( final String minInclusive ) { XmlSchemaMinInclusiveFacet xmlSchemaMinInclusiveFacet = new XmlSchemaMinInclusiveFacet ( ) ; xmlSchemaMinInclusiveFacet . setValue ( minInclusive ) ; return xmlSchemaMinInclusiveFacet ; } | Create an XML schema minInclusive facet . |
136,423 | protected XmlSchemaMaxInclusiveFacet createMaxInclusiveFacet ( final String maxInclusive ) { XmlSchemaMaxInclusiveFacet xmlSchemaMaxInclusiveFacet = new XmlSchemaMaxInclusiveFacet ( ) ; xmlSchemaMaxInclusiveFacet . setValue ( maxInclusive ) ; return xmlSchemaMaxInclusiveFacet ; } | Create an XML schema maxInclusive facet . |
136,424 | public int read ( SegmentIndexBuffer sib , File sibFile ) throws IOException { check ( sibFile ) ; RandomAccessFile raf = new RandomAccessFile ( sibFile , "r" ) ; FileChannel channel = raf . getChannel ( ) ; readVersion ( channel ) ; int length = sib . read ( channel ) ; length += STORAGE_VERSION_LENGTH ; channel . clo... | Reads from the specified segment index buffer file . |
136,425 | public int write ( SegmentIndexBuffer sib , File sibFile ) throws IOException { create ( sibFile ) ; RandomAccessFile raf = new RandomAccessFile ( sibFile , "rw" ) ; FileChannel channel = raf . getChannel ( ) ; writeVersion ( channel ) ; int length = sib . write ( channel ) ; length += STORAGE_VERSION_LENGTH ; raf . se... | Writes to the specified segment index buffer file . |
136,426 | protected int readVersion ( ReadableByteChannel channel ) throws IOException { ByteBuffer version = ByteBuffer . allocate ( STORAGE_VERSION_LENGTH ) ; int len = channel . read ( version ) ; if ( len < STORAGE_VERSION_LENGTH ) { throw new IOException ( "Invalid Version" ) ; } return version . getInt ( 0 ) ; } | Reads version from readable channel . |
136,427 | protected void writeVersion ( WritableByteChannel channel ) throws IOException { ByteBuffer version = ByteBuffer . allocate ( STORAGE_VERSION_LENGTH ) ; version . putInt ( STORAGE_VERSION ) ; version . flip ( ) ; channel . write ( version ) ; } | Writes the version to writable channel . |
136,428 | protected void create ( File file ) throws IOException { if ( ! file . exists ( ) ) { File dir = file . getParentFile ( ) ; if ( dir . exists ( ) ) file . createNewFile ( ) ; else if ( dir . mkdirs ( ) ) file . createNewFile ( ) ; else throw new IOException ( "Failed to create " + file . getAbsolutePath ( ) ) ; } if ( ... | Creates the specified file if needed . |
136,429 | protected void check ( File file ) throws IOException { if ( ! file . exists ( ) ) { throw new FileNotFoundException ( file . getAbsolutePath ( ) ) ; } if ( file . isDirectory ( ) ) { throw new IOException ( "Cannot open directory " + file . getAbsolutePath ( ) ) ; } } | Checks the existence of the specified file . |
136,430 | public static PAMSourceAuditor getAuditor ( ) { AuditorModuleContext ctx = AuditorModuleContext . getContext ( ) ; return ( PAMSourceAuditor ) ctx . getAuditor ( PAMSourceAuditor . class ) ; } | Get an instance of the PAM Source Auditor from the global context |
136,431 | public void add ( int pos , long val , long scn ) { if ( _index < _entryCapacity ) { _valArray . get ( _index ++ ) . reinit ( pos , val , scn ) ; maintainScn ( scn ) ; } else { throw new EntryOverflowException ( ) ; } } | Adds data to this Entry . |
136,432 | public final void save ( File file ) throws IOException { _entryFile = file ; Chronos c = new Chronos ( ) ; DataWriter out = new FastDataWriter ( file ) ; try { out . open ( ) ; out . writeLong ( STORAGE_VERSION ) ; out . writeLong ( _minScn ) ; out . writeLong ( _maxScn ) ; out . writeInt ( size ( ) ) ; saveDataSectio... | Saves to a file . |
136,433 | public void load ( File file ) throws IOException { _entryFile = file ; Chronos c = new Chronos ( ) ; ChannelReader in = new ChannelReader ( file ) ; try { in . open ( ) ; long fileVersion = in . readLong ( ) ; if ( fileVersion != STORAGE_VERSION ) { throw new RuntimeException ( "Wrong storage version " + fileVersion +... | Loads an entry from a given file . |
136,434 | public CodedValueType getAuditSourceTypeCode ( ) { if ( EventUtils . isEmptyOrNull ( auditSourceTypeCode ) ) { return null ; } AuditSourceType auditSourceType = auditSourceTypeCode . get ( 0 ) ; CodedValueType codedValueType = new CodedValueType ( ) ; codedValueType . setCode ( auditSourceType . getCode ( ) ) ; codedVa... | Gets the value of the auditSourceTypeCode property . |
136,435 | public void setAuditSourceTypeCode ( CodedValueType auditSourceTypeCode ) { AuditSourceType auditSourceType = new AuditSourceType ( ) ; auditSourceType . setCode ( auditSourceTypeCode . getCode ( ) ) ; auditSourceType . setCodeSystem ( auditSourceTypeCode . getCodeSystem ( ) ) ; auditSourceType . setCodeSystemName ( au... | Sets the value of the auditSourceTypeCode property . |
136,436 | public static int getCacheSize ( Context ctx ) { final DisplayMetrics displayMetrics = ctx . getResources ( ) . getDisplayMetrics ( ) ; final int screenWidth = displayMetrics . widthPixels ; final int screenHeight = displayMetrics . heightPixels ; final int screenBytes = screenWidth * screenHeight * 4 ; return screenBy... | Returns a cache size equal to approximately three screens worth of images . |
136,437 | public static AuditRecordRepositoryAuditor getAuditor ( ) { AuditorModuleContext ctx = AuditorModuleContext . getContext ( ) ; return ( AuditRecordRepositoryAuditor ) ctx . getAuditor ( AuditRecordRepositoryAuditor . class ) ; } | Get an instance of the Audit Record Repository auditor from the global context |
136,438 | public void auditAuditLogUsed ( RFC3881EventOutcomeCodes eventOutcome , String accessingUser , String accessingProcess , String auditLogUri ) { if ( ! isAuditorEnabled ( ) ) { return ; } AuditLogUsedEvent auditLogUsedEvent = new AuditLogUsedEvent ( eventOutcome ) ; auditLogUsedEvent . setAuditSourceId ( getAuditSourceI... | Audits a DICOM Audit Log Used event for a given User and Process . |
136,439 | public static < T extends EntryValue > void sortEntriesById ( List < Entry < T > > entryList ) { if ( entryList . size ( ) > 0 ) { Collections . sort ( entryList , new Comparator < Entry < ? > > ( ) { public int compare ( Entry < ? > e1 , Entry < ? > e2 ) { long v1 = getEntryId ( e1 . getFile ( ) . getName ( ) ) ; long... | Sort entries in the ascending order of entry log IDs . |
136,440 | public static long getEntryId ( String entryFileName ) { int ind1 = entryFileName . indexOf ( "_" ) + 1 ; if ( ind1 > 0 ) { int ind2 = entryFileName . indexOf ( "_" , ind1 ) ; if ( ind2 > ind1 ) { String str = entryFileName . substring ( ind1 , ind2 ) ; try { return Long . parseLong ( str ) ; } catch ( Exception e ) { ... | Gets the entry ID based on the specified entry file name . |
136,441 | private void send ( byte [ ] msg , DatagramSocket socket , InetAddress destination , int port ) throws Exception { if ( EventUtils . isEmptyOrNull ( msg ) ) { return ; } if ( LOGGER . isDebugEnabled ( ) ) { LOGGER . debug ( "Auditing to " + destination . getHostAddress ( ) + ":" + port ) ; } if ( LOGGER . isDebugEnable... | Send a byte buffer to a designated destination address and port using the datagram socket specified . |
136,442 | private void send ( AuditEventMessage msg , DatagramSocket socket , InetAddress destination , int port ) throws Exception { if ( EventUtils . isEmptyOrNull ( msg ) ) { return ; } int portToUse = getTransportPort ( port ) ; byte [ ] msgBytes = getTransportPayload ( msg ) ; send ( msgBytes , socket , destination , portTo... | Send an audit message to a designated destination address and port using the datagram socket specified . |
136,443 | protected byte [ ] getTransportPayload ( AuditEventMessage msg ) { if ( msg == null ) { return null ; } byte [ ] msgBytes = msg . getSerializedMessage ( false ) ; if ( EventUtils . isEmptyOrNull ( msgBytes ) ) { return null ; } StringBuilder sb = new StringBuilder ( ) ; sb . append ( "<" ) ; sb . append ( TRANSPORT_DEF... | Serialize format and prepare the message payload body for sending by this transport . This includes adding the syslog message header . |
136,444 | protected void loadWaterMarks ( ) throws IOException { if ( file != null && file . exists ( ) ) { try { loadWaterMarks ( file ) ; } catch ( IOException e ) { if ( fileOriginal != null && fileOriginal . exists ( ) ) { loadWaterMarks ( fileOriginal ) ; } } } } | Load water marks from underlying files . |
136,445 | protected void loadWaterMarks ( File waterMarksFile ) throws IOException { Properties p = new Properties ( ) ; FileInputStream fis = new FileInputStream ( waterMarksFile ) ; logger . info ( "Loading " + waterMarksFile ) ; try { p . load ( fis ) ; Enumeration < ? > enm = p . propertyNames ( ) ; while ( enm . hasMoreElem... | Load water marks from an underlying file . |
136,446 | public long getHWMScn ( String source ) { WaterMarkEntry e = sourceWaterMarkMap . get ( source ) ; return ( e == null ) ? 0 : e . getHWMScn ( ) ; } | Gets the high water mark of a source . |
136,447 | public long getLWMScn ( String source ) { WaterMarkEntry e = sourceWaterMarkMap . get ( source ) ; return ( e == null ) ? 0 : e . getLWMScn ( ) ; } | Gets the low water mark of a source . |
136,448 | public void setLWMScn ( String source , long scn ) { WaterMarkEntry e = sourceWaterMarkMap . get ( source ) ; if ( e == null ) { e = new WaterMarkEntry ( source ) ; sourceWaterMarkMap . put ( source , e ) ; } e . setLWMScn ( scn ) ; } | Sets the low water mark of a source |
136,449 | public void setWaterMarks ( String source , long lwmScn , long hwmScn ) { WaterMarkEntry e = sourceWaterMarkMap . get ( source ) ; if ( e == null ) { e = new WaterMarkEntry ( source ) ; sourceWaterMarkMap . put ( source , e ) ; } e . setLWMScn ( lwmScn ) ; e . setHWMScn ( hwmScn ) ; } | Sets the water marks of a source . |
136,450 | public boolean syncWaterMarks ( String source , long lwmScn , long hwmScn ) { setWaterMarks ( source , lwmScn , hwmScn ) ; return flush ( ) ; } | Sets and flushes the water marks of a source . |
136,451 | public boolean syncWaterMarks ( ) { for ( String source : sourceWaterMarkMap . keySet ( ) ) { WaterMarkEntry wmEntry = sourceWaterMarkMap . get ( source ) ; wmEntry . setLWMScn ( wmEntry . getHWMScn ( ) ) ; } return flush ( ) ; } | Sync up low water marks to high water marks for all the sources . |
136,452 | public boolean flush ( ) { boolean ret = true ; PrintWriter out = null ; try { if ( file . exists ( ) ) { if ( fileOriginal . exists ( ) ) { fileOriginal . delete ( ) ; } file . renameTo ( fileOriginal ) ; } out = new PrintWriter ( new FileOutputStream ( file ) ) ; for ( String source : sourceWaterMarkMap . keySet ( ) ... | Flushes low water marks and high water marks for all the sources . |
136,453 | public void clear ( ) { sourceWaterMarkMap . clear ( ) ; flush ( ) ; if ( fileOriginal != null && fileOriginal . exists ( ) ) { fileOriginal . delete ( ) ; } } | Clears SourceWaterMark . |
136,454 | synchronized void loadImageIfNecessary ( final boolean isInLayoutPass ) { int width = getWidth ( ) ; int height = getHeight ( ) ; boolean wrapWidth = false , wrapHeight = false ; if ( getLayoutParams ( ) != null ) { wrapWidth = getLayoutParams ( ) . width == LayoutParams . WRAP_CONTENT ; wrapHeight = getLayoutParams ( ... | Loads the image for the view if it isn t already loaded . |
136,455 | public static PIXManagerAuditor getAuditor ( ) { AuditorModuleContext ctx = AuditorModuleContext . getContext ( ) ; return ( PIXManagerAuditor ) ctx . getAuditor ( PIXManagerAuditor . class ) ; } | Get an instance of the PIX Manager Auditor from the global context |
136,456 | private String getAnnotations ( final Properties properties , final String stringFromClient ) throws IOException , JDOMException { BufferedReader breader ; KAFDocument kaf ; String kafString = null ; String lang = properties . getProperty ( "language" ) ; String outputFormat = properties . getProperty ( "outputFormat" ... | Get tokens . |
136,457 | public static < T > Class < ? > [ ] resolveGenerics ( Class < T > superType , Class < ? extends T > subType ) { checkNotNull ( superType , "superType should not be null" ) ; checkNotNull ( subType , "subType should not be null" ) ; Class < ? > subTypeWithoutProxy = ProxyUtils . cleanProxy ( subType ) ; return TypeResol... | Resolve generics of a class relatively to a superclass . |
136,458 | @ SuppressWarnings ( "unchecked" ) public static < A extends AggregateRoot < I > , I > Class < I > resolveAggregateIdClass ( Class < A > aggregateRootClass ) { checkNotNull ( aggregateRootClass , "aggregateRootClass should not be null" ) ; return ( Class < I > ) resolveGenerics ( AggregateRoot . class , aggregateRootCl... | Returns the identifier class for an aggregate root class . |
136,459 | public static Class < ? > [ ] getAggregateIdClasses ( Class < ? extends AggregateRoot < ? > > [ ] aggregateRootClasses ) { checkNotNull ( aggregateRootClasses , "aggregateRootClasses should not be null" ) ; Class < ? > [ ] result = new Class < ? > [ aggregateRootClasses . length ] ; for ( int i = 0 ; i < aggregateRootC... | Returns an arrays of all identifier class corresponding the the given array of aggregate root classes . |
136,460 | @ SuppressWarnings ( "unchecked" ) public static < T > Stream < Class < ? extends T > > streamClasses ( Collection < Class < ? > > classes , Class < ? extends T > baseClass ) { return classes . stream ( ) . filter ( ClassPredicates . classIsDescendantOf ( baseClass ) ) . map ( c -> ( Class < T > ) c ) ; } | Checks that classes satisfying a specification are assignable to a base class and return a typed stream of it . |
136,461 | public static Optional < Annotation > getQualifier ( AnnotatedElement annotatedElement ) { AnnotatedElement cleanedAnnotatedElement ; if ( annotatedElement instanceof Class < ? > ) { cleanedAnnotatedElement = ProxyUtils . cleanProxy ( ( Class < ? > ) annotatedElement ) ; } else { cleanedAnnotatedElement = annotatedElem... | Optionally returns the qualifier annotation of a class . |
136,462 | @ SuppressWarnings ( "unchecked" ) public static < T > Optional < Key < T > > resolveDefaultQualifier ( Map < Key < ? > , Class < ? > > bindings , ClassConfiguration < ? > classConfiguration , String property , Class < ? > qualifiedClass , TypeLiteral < T > genericInterface ) { Key < T > key = null ; if ( classConfigur... | Returns the Guice key qualified with the default qualifier configured for the specified class . |
136,463 | @ SuppressWarnings ( "unchecked" ) public static Set < Class < ? extends AggregateRoot < ? > > > includeSuperClasses ( Collection < Class < ? extends AggregateRoot > > aggregateClasses ) { Set < Class < ? extends AggregateRoot < ? > > > results = new HashSet < > ( ) ; for ( Class < ? > aggregateClass : aggregateClasses... | Walks the class hierarchy of each class in the given collection and adds its superclasses to the mix . |
136,464 | public void tokenizeToKAF ( final KAFDocument kaf ) throws IOException { int noSents = 0 ; int noParas = 1 ; List < List < Token > > tokens ; if ( isNoSeg ) { String [ ] sentences = text . toArray ( new String [ text . size ( ) ] ) ; tokens = tokenizer . tokenize ( sentences ) ; } else { final String [ ] sentences = se... | Tokenize document to NAF . |
136,465 | public String tokenizeToText ( ) { final StringBuilder sb = new StringBuilder ( ) ; if ( isNoSeg ) { String [ ] sentences = text . toArray ( new String [ text . size ( ) ] ) ; final List < List < Token > > tokens = tokenizer . tokenize ( sentences ) ; for ( final List < Token > tokSentence : tokens ) { for ( final Toke... | Tokenize and Segment input text . Outputs tokens in running text format one sentence per line . |
136,466 | void packageArtifacts ( final File compileDir , final MavenProject project , final Set < String > bundles ) throws IOException , XCodeException { File mainArtifact = createMainArtifactFile ( project ) ; attachBundle ( compileDir , project , bundles , mainArtifact ) ; final File mainArtifactFile = archiveMainArtifact ( ... | Packages all the artifacts . The main artifact is set and all side artifacts are attached for deployment . |
136,467 | Collection < BindingStrategy > collectFromAggregates ( Collection < Class < ? extends AggregateRoot > > aggregateClasses ) { Collection < BindingStrategy > bindingStrategies = new ArrayList < > ( ) ; Map < Type [ ] , Key < ? > > allGenerics = new HashMap < > ( ) ; for ( Class < ? extends AggregateRoot < ? > > aggregate... | Prepares the binding strategies which bind default repositories . The specificity here is that it could have multiple implementations of default repository i . e . one per persistence . |
136,468 | @ SuppressWarnings ( "unchecked" ) public static < T extends Class < ? > > Map < T , Specification < ? extends T > > classpathRequestForDescendantTypesOf ( ClasspathScanRequestBuilder classpathScanRequestBuilder , Collection < T > interfaces ) { Map < T , Specification < ? extends T > > specsByInterface = new HashMap <... | Builds a ClasspathScanRequest to find all the descendant of the given interfaces . |
136,469 | public final void run ( final String [ ] args ) throws IOException , JDOMException { try { Parameters parameters = cliArgumentsParser . parse ( args ) ; if ( parameters . getStrategy ( ) == Strategy . TOKENIZE ) { annotate ( parameters ) ; } else if ( parameters . getStrategy ( ) == Strategy . SERVER ) { server ( param... | Run the appropriate command based on the command line parameters . |
136,470 | public SortOption add ( String attribute , Direction direction ) { sortedAttributes . add ( new SortedAttribute ( attribute , direction ) ) ; return this ; } | Adds the specified attribute to the list of sorted attributes with the specified direction . |
136,471 | public < T > Comparator < T > buildComparator ( ) { if ( sortedAttributes . isEmpty ( ) ) { return ( o1 , o2 ) -> 0 ; } else { Comparator < T > comparator = null ; for ( SortedAttribute sortedAttribute : sortedAttributes ) { if ( comparator == null ) { comparator = buildComparator ( sortedAttribute ) ; } else { compara... | Builds a comparator allowing the sorting of objects according to the sort criteria . |
136,472 | private int findPartnerNodeId ( Tree < Row > current , Type type ) { switch ( type ) { case JOIN_FIRST : case JOIN_ALL : case WHILE_DO_END : return current . getPrevious ( ) . getContent ( ) . getId ( ) ; case DO_WHILE_BEGIN : return current . getNext ( ) . getContent ( ) . getMainElement ( ) . getId ( ) ; case END_IF ... | Some node producing elements do not define an id themselves but deduce their id based on their block - opening or block - closing partner . E . g . a WHILE_DO_END deduces its id based on its WHILE_DO_BEGIN partner . |
136,473 | protected File zipSubfolder ( File rootDir , String zipSubFolder , String zipFileName , String archiveFolder ) throws MojoExecutionException { int resultCode = 0 ; try { File scriptDirectory = new File ( project . getBuild ( ) . getDirectory ( ) , "scripts" ) . getCanonicalFile ( ) ; scriptDirectory . deleteOnExit ( ) ... | Calls a shell script in order to zip a folder . We have to call a shell script as Java cannot zip symbolic links . |
136,474 | @ RequestMapping ( method = RequestMethod . GET , value = "/workflowInstance/search" , produces = { MediaType . APPLICATION_JSON_VALUE , MediaType . TEXT_XML_VALUE } ) public ResponseEntity < List < WorkflowInstanceRestModel > > findInstances ( @ RequestParam ( required = false ) String label1 , @ RequestParam ( requir... | Searches workflow instance s that match the given criteria . |
136,475 | public SmiSymbol resolveReference ( IdToken idToken , XRefProblemReporter reporter ) { SmiSymbol result = findSymbol ( idToken . getId ( ) ) ; if ( result == null ) { result = findImportedSymbol ( idToken . getId ( ) ) ; } if ( result == null ) { List < SmiSymbol > symbols = getMib ( ) . getSymbols ( ) . findAll ( idTo... | Resolves a reference from within this module to a symbol in the same module an imported module or in the whole mib |
136,476 | public SmiOidNode findByOidPrefix ( int ... oid ) { SmiOidNode parent = getRootNode ( ) ; for ( int subId : oid ) { SmiOidNode result = parent . findChild ( subId ) ; if ( result == null ) { return parent ; } parent = result ; } return null ; } | This method can be used to find the best match for an OID . By comparing the length of the OID of the result and the input OID you can determine how many and which subIds where not matched . |
136,477 | private static void validateReservedVariableNames ( Graph graph , List < String > errors ) { for ( Node node : graph . getNodes ( ) ) { if ( node instanceof BeanAsyncCallActivity ) { validateReservedVariablesFromMapping ( ( ( BeanAsyncCallActivity ) node ) . getResultMapping ( ) , graph , node , errors ) ; } else if ( ... | check through all the node types which use mappings which set Environment attributes |
136,478 | public SmiType createIntegerType ( IdToken idToken , IntKeywordToken intToken , Token applicationTagToken , List < SmiNamedNumber > namedNumbers , List < SmiRange > rangeConstraints ) { if ( idToken == null && intToken . getPrimitiveType ( ) == INTEGER && namedNumbers == null && rangeConstraints == null ) { return SmiC... | and resolve references to INTEGER BITS ... during the XRef phase |
136,479 | public static String asString ( Boolean flag ) { return flag == null ? null : ( flag ? YES_AS_STRING : NO_AS_STRING ) ; } | Converts the given flag into a string of either Y N or null . |
136,480 | public static Boolean asBoolean ( String flag ) { return flag == null ? null : flag . equals ( YES_AS_STRING ) ; } | Converts the given string into a Boolean flag of either true false or null . |
136,481 | protected PListAccessor getInfoPListAccessor ( XCodeContext . SourceCodeLocation location , String configuration , String sdk ) throws MojoExecutionException , XCodeException { File plistFile = getPListFile ( location , configuration , sdk ) ; if ( ! plistFile . isFile ( ) ) { throw new MojoExecutionException ( "The Xc... | Retrieves the Info Plist out of the effective Xcode project settings and returns the accessor to it . |
136,482 | public List < WorkUnit > findNewWorkUnits ( Date now , String clusterName ) { if ( sqlCache == null || ! ObjectUtils . equals ( cachedSqlClusterName , clusterName ) ) { sqlCache = getSql ( clusterName ) ; cachedSqlClusterName = clusterName ; } Object [ ] args = { now } ; return getJdbcTemplate ( ) . query ( sqlCache , ... | Retrieves the list of work units that can be performed at the given date . |
136,483 | @ SuppressWarnings ( "unchecked" ) public static < T extends Tuple > T create ( Object ... objects ) { Class < ? extends Tuple > tupleClass = classOfTuple ( objects . length ) ; try { return ( T ) tupleClass . getMethod ( "fromArray" , Object [ ] . class ) . invoke ( null , new Object [ ] { objects } ) ; } catch ( NoSu... | Builds a tuple from an array of objects . |
136,484 | public static Class < ? extends Tuple > classOfTuple ( int cardinality ) { switch ( cardinality ) { case 1 : return Unit . class ; case 2 : return Pair . class ; case 3 : return Triplet . class ; case 4 : return Quartet . class ; case 5 : return Quintet . class ; case 6 : return Sextet . class ; case 7 : return Septet ... | Returns the tuple class corresponding to the specified cardinality . |
136,485 | @ SuppressWarnings ( "unchecked" ) public static < T > Class < T > [ ] itemClasses ( Tuple tuple ) { Class < ? > [ ] itemClasses = new Class [ tuple . getSize ( ) ] ; int index = 0 ; for ( Object o : tuple ) { itemClasses [ index ++ ] = o . getClass ( ) ; } return ( Class < T > [ ] ) itemClasses ; } | Returns a list containing the classes of the elements of the tuple . |
136,486 | private String buildMessage ( String rawMessage ) { StringBuilder msg = new StringBuilder ( ) ; if ( changeLogName != null ) { msg . append ( changeLogName ) . append ( ": " ) ; } if ( changeSetName != null ) { msg . append ( changeSetName . replace ( changeLogName + "::" , "" ) ) . append ( ": " ) ; } msg . append ( r... | Build a log message with optional data if it exists . |
136,487 | public String toSqlString ( Object value ) { if ( value == null ) { return "null" ; } String val = String . valueOf ( value ) ; if ( value instanceof Integer || value instanceof Float || value instanceof Double || value instanceof Long ) { return val ; } else if ( value instanceof Boolean ) { return "'" + ( ( Boolean )... | Convert value object to sanitized SQL string |
136,488 | private static void createDirectory ( final File directory ) throws MojoExecutionException { try { com . sap . prd . mobile . ios . mios . FileUtils . deleteDirectory ( directory ) ; } catch ( IOException ex ) { throw new MojoExecutionException ( "" , ex ) ; } if ( ! directory . mkdirs ( ) ) throw new MojoExecutionExce... | Creates a directory . If the directory already exists the directory is deleted beforehand . |
136,489 | private Tree < Row > downRight ( Element token ) { return current = current . addChild ( Tree . of ( new Row ( token ) ) ) ; } | Starts a new row one indentation level to the right . |
136,490 | private Tree < Row > downLeft ( Element token ) { return current = current . getParent ( ) . addSibling ( Tree . of ( new Row ( token ) ) ) ; } | Starts a new row one indentation level to the left . |
136,491 | private Tree < Row > down ( Element token ) { return current = current . addSibling ( Tree . of ( new Row ( token ) ) ) ; } | Starts a new row at the same level of indentation . |
136,492 | private Tree < Row > here ( Element token ) { current . getContent ( ) . addToken ( token ) ; return current ; } | Adds element to the same row . |
136,493 | public static < I > Result < I > rangeResult ( List < I > result , long offset , long fullRequestSize ) { return new Result < > ( result , offset , fullRequestSize ) ; } | Creates a new Result . |
136,494 | T get ( long index ) { checkRange ( index ) ; if ( checkSubRange ( index ) ) { return subList . get ( ( int ) ( index - subListOffset ) ) ; } return null ; } | Gets the item at the index . |
136,495 | List < T > subList ( long from , long to ) { if ( fullListSize > 0 && to - from > 0 ) { checkRange ( from ) ; checkRange ( to - 1 ) ; assertSubRange ( from , to - 1 ) ; return subList . subList ( ( int ) ( from - subListOffset ) , ( int ) ( to - subListOffset ) ) ; } return new ArrayList < > ( ) ; } | Returns a portion of this list between the specified from inclusive and to exclusive . |
136,496 | private void assertSubRange ( long from , long to ) { if ( ! checkSubRange ( from ) || ! checkSubRange ( to ) ) { throw new IndexOutOfBoundsException ( "Required data for the sub list [" + from + "," + ( to + 1 ) + "[ have " + "not been loaded in the virtual list." ) ; } } | Asserts that the requested sub list is available in the virtual list . Otherwise it throws an IndexOutOfBoundsException . |
136,497 | public static Object getFieldValue ( Object candidate , Field field ) { try { return ReflectUtils . getValue ( ReflectUtils . makeAccessible ( field ) , candidate ) ; } catch ( Exception e ) { throw BusinessException . wrap ( e , BusinessErrorCode . ERROR_ACCESSING_FIELD ) . put ( "className" , candidate . getClass ( )... | Return the value contained in the specified field of the candidate object . |
136,498 | public static Optional < Field > resolveField ( Class < ? > someClass , String fieldName ) { return fieldCache . get ( new FieldReference ( someClass , fieldName ) ) ; } | Returns the specified field found on the specified class and its ancestors . |
136,499 | public static String removeBrackets ( String condition ) { String value = StringUtils . strip ( condition ) ; if ( value != null && value . length ( ) >= 3 ) { return value . substring ( 2 , value . length ( ) - 1 ) ; } return value ; } | After trimming the input removes two characters from the start and one from the end and returns the result . |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.