idx int64 0 165k | question stringlengths 73 5.81k | target stringlengths 5 918 |
|---|---|---|
147,500 | public Date dateTime ( ImapRequestLineReader request ) throws ProtocolException { char next = request . nextWordChar ( ) ; String dateString ; if ( next == '"' ) { dateString = consumeQuoted ( request ) ; } else { throw new ProtocolException ( "DateTime values must be quoted." ) ; } try { return new SimpleDateFormat ( ... | Reads a date - time argument from the request . |
147,501 | protected String consumeWord ( ImapRequestLineReader request , CharacterValidator validator ) throws ProtocolException { StringBuilder atom = new StringBuilder ( ) ; char next = request . nextWordChar ( ) ; while ( ! isWhitespace ( next ) ) { if ( validator . isValid ( next ) ) { atom . append ( next ) ; request . cons... | Reads the next word from the request comprising all characters up to the next SPACE . Characters are tested by the supplied CharacterValidator and an exception is thrown if invalid characters are encountered . |
147,502 | protected void consumeChar ( ImapRequestLineReader request , char expected ) throws ProtocolException { char consumed = request . consume ( ) ; if ( consumed != expected ) { throw new ProtocolException ( "Expected:'" + expected + "' found:'" + consumed + '\'' ) ; } } | Consumes the next character in the request checking that it matches the expected one . This method should be used when the |
147,503 | protected String consumeQuoted ( ImapRequestLineReader request ) throws ProtocolException { consumeChar ( request , '"' ) ; StringBuilder quoted = new StringBuilder ( ) ; char next = request . nextChar ( ) ; while ( next != '"' ) { if ( next == '\\' ) { request . consume ( ) ; next = request . nextChar ( ) ; if ( ! isQ... | Reads a quoted string value from the request . |
147,504 | public Flags flagList ( ImapRequestLineReader request ) throws ProtocolException { Flags flags = new Flags ( ) ; request . nextWordChar ( ) ; consumeChar ( request , '(' ) ; CharacterValidator validator = new NoopCharValidator ( ) ; String nextWord = consumeWord ( request , validator ) ; while ( ! nextWord . endsWith (... | Reads a flags argument from the request . |
147,505 | public long number ( ImapRequestLineReader request ) throws ProtocolException { String digits = consumeWord ( request , new DigitCharValidator ( ) ) ; return Long . parseLong ( digits ) ; } | Reads an argument of type number from the request . |
147,506 | public IdRange [ ] parseIdRange ( ImapRequestLineReader request ) throws ProtocolException { CharacterValidator validator = new MessageSetCharValidator ( ) ; String nextWord = consumeWord ( request , validator ) ; int commaPos = nextWord . indexOf ( ',' ) ; if ( commaPos == - 1 ) { return new IdRange [ ] { IdRange . pa... | Reads a message set argument and parses into an IdSet . Currently only supports a single range of values . |
147,507 | public ServerSetup [ ] build ( Properties properties ) { List < ServerSetup > serverSetups = new ArrayList < > ( ) ; String hostname = properties . getProperty ( "greenmail.hostname" , ServerSetup . getLocalHostAddress ( ) ) ; long serverStartupTimeout = Long . parseLong ( properties . getProperty ( "greenmail.startup.... | Creates a server setup based on provided properties . |
147,508 | public static String format ( Flags flags ) { StringBuilder buf = new StringBuilder ( ) ; buf . append ( '(' ) ; if ( flags . contains ( Flags . Flag . ANSWERED ) ) { buf . append ( "\\Answered " ) ; } if ( flags . contains ( Flags . Flag . DELETED ) ) { buf . append ( "\\Deleted " ) ; } if ( flags . contains ( Flags .... | Returns IMAP formatted String of MessageFlags for named user |
147,509 | public void eol ( ) throws ProtocolException { char next = nextChar ( ) ; while ( next == ' ' ) { consume ( ) ; next = nextChar ( ) ; } if ( next == '\r' ) { consume ( ) ; next = nextChar ( ) ; } if ( next != '\n' ) { throw new ProtocolException ( "Expected end-of-line, found more character(s): " + next ) ; } dumpLine ... | Moves the request line reader to end of the line checking that no non - space character are found . |
147,510 | public void read ( byte [ ] holder ) throws ProtocolException { int readTotal = 0 ; try { while ( readTotal < holder . length ) { int count = input . read ( holder , readTotal , holder . length - readTotal ) ; if ( count == - 1 ) { throw new ProtocolException ( "Unexpected end of stream." ) ; } readTotal += count ; } n... | Reads and consumes a number of characters from the underlying reader filling the byte array provided . |
147,511 | public void commandContinuationRequest ( ) throws ProtocolException { try { output . write ( '+' ) ; output . write ( ' ' ) ; output . write ( 'O' ) ; output . write ( 'K' ) ; output . write ( '\r' ) ; output . write ( '\n' ) ; output . flush ( ) ; } catch ( IOException e ) { throw new ProtocolException ( "Unexpected e... | Sends a server command continuation request + back to the client requesting more data to be sent . |
147,512 | public static void createUsers ( GreenMailOperations greenMail , InternetAddress ... addresses ) { for ( InternetAddress address : addresses ) { greenMail . setUser ( address . getAddress ( ) , address . getAddress ( ) ) ; } } | Create users for the given array of addresses . The passwords will be set to the email addresses . |
147,513 | public static boolean containsUid ( IdRange [ ] idRanges , long uid ) { if ( null != idRanges && idRanges . length > 0 ) { for ( IdRange range : idRanges ) { if ( range . includes ( uid ) ) { return true ; } } } return false ; } | Checks if ranges contain the uid |
147,514 | SimpleJsonEncoder appendToJSON ( final String key , final Object value ) { if ( closed ) { throw new IllegalStateException ( "Encoder already closed" ) ; } if ( value != null ) { appendKey ( key ) ; if ( value instanceof Number ) { sb . append ( value . toString ( ) ) ; } else { sb . append ( QUOTE ) . append ( escapeS... | Append field with quotes and escape characters added if required . |
147,515 | SimpleJsonEncoder appendToJSONUnquoted ( final String key , final Object value ) { if ( closed ) { throw new IllegalStateException ( "Encoder already closed" ) ; } if ( value != null ) { appendKey ( key ) ; sb . append ( value ) ; } return this ; } | Append field with quotes and escape characters added in the key if required . The value is added without quotes and any escape characters . |
147,516 | @ SuppressWarnings ( "checkstyle:illegalcatch" ) private boolean sendMessage ( final byte [ ] messageToSend ) { try { connectionPool . execute ( new PooledObjectConsumer < TcpConnection > ( ) { public void accept ( final TcpConnection tcpConnection ) throws IOException { tcpConnection . write ( messageToSend ) ; } } ) ... | Send message to socket s output stream . |
147,517 | public void run ( ) { try { startBarrier . await ( ) ; int idleCount = 0 ; while ( ! isRunning . compareAndSet ( idleCount > lingerIterations && pidToProcessMap . isEmpty ( ) , false ) ) { idleCount = ( ! shutdown && process ( ) ) ? 0 : ( idleCount + 1 ) ; } } catch ( Exception e ) { isRunning . set ( false ) ; } } | The primary run loop of the event processor . |
147,518 | public static String dump ( final int displayOffset , final byte [ ] data , final int offset , final int len ) { StringBuilder sb = new StringBuilder ( ) ; Formatter formatter = new Formatter ( sb ) ; StringBuilder ascii = new StringBuilder ( ) ; int dataNdx = offset ; final int maxDataNdx = offset + len ; final int li... | Dump an array of bytes in hexadecimal . |
147,519 | public void run ( ) { try { startBarrier . await ( ) ; int idleCount = 0 ; while ( ! isRunning . compareAndSet ( idleCount > LINGER_ITERATIONS && deadPool . isEmpty ( ) && completionKeyToProcessMap . isEmpty ( ) , false ) ) { idleCount = ( ! shutdown && process ( ) ) ? 0 : ( idleCount + 1 ) ; } } catch ( Exception e ) ... | The primary run loop of the kqueue event processor . |
147,520 | public Snackbar actionLabel ( CharSequence actionButtonLabel ) { mActionLabel = actionButtonLabel ; if ( snackbarAction != null ) { snackbarAction . setText ( mActionLabel ) ; } return this ; } | Sets the action label to be displayed if any . Note that if this is not set the action button will not be displayed |
147,521 | public static void setBackgroundDrawable ( View view , Drawable drawable ) { if ( android . os . Build . VERSION . SDK_INT < android . os . Build . VERSION_CODES . JELLY_BEAN ) { view . setBackgroundDrawable ( drawable ) ; } else { view . setBackground ( drawable ) ; } } | Set a Background Drawable using the appropriate Android version api call |
147,522 | public void visitRequire ( String module , int access , String version ) { if ( mv != null ) { mv . visitRequire ( module , access , version ) ; } } | Visits a dependence of the current module . |
147,523 | public void visitExport ( String packaze , int access , String ... modules ) { if ( mv != null ) { mv . visitExport ( packaze , access , modules ) ; } } | Visit an exported package of the current module . |
147,524 | public void visitOpen ( String packaze , int access , String ... modules ) { if ( mv != null ) { mv . visitOpen ( packaze , access , modules ) ; } } | Visit an open package of the current module . |
147,525 | private int [ ] readTypeAnnotations ( final MethodVisitor mv , final Context context , int u , boolean visible ) { char [ ] c = context . buffer ; int [ ] offsets = new int [ readUnsignedShort ( u ) ] ; u += 2 ; for ( int i = 0 ; i < offsets . length ; ++ i ) { offsets [ i ] = u ; int target = readInt ( u ) ; switch ( ... | Parses a type annotation table to find the labels and to visit the try catch block annotations . |
147,526 | private void visitImplicitFirstFrame ( ) { int frameIndex = startFrame ( 0 , descriptor . length ( ) + 1 , 0 ) ; if ( ( access & Opcodes . ACC_STATIC ) == 0 ) { if ( ( access & ACC_CONSTRUCTOR ) == 0 ) { frame [ frameIndex ++ ] = Frame . OBJECT | cw . addType ( cw . thisName ) ; } else { frame [ frameIndex ++ ] = Frame... | Visit the implicit first frame of this method . |
147,527 | Item newStringishItem ( final int type , final String value ) { key2 . set ( type , value , null , null ) ; Item result = get ( key2 ) ; if ( result == null ) { pool . put12 ( type , newUTF8 ( value ) ) ; result = new Item ( index ++ , key2 ) ; put ( result ) ; } return result ; } | Adds a string reference a class reference a method type a module or a package to the constant pool of the class being build . Does nothing if the constant pool already contains a similar item . |
147,528 | public void visitParameter ( String name , int access ) { if ( mv != null ) { mv . visitParameter ( name , access ) ; } } | Visits a parameter of this method . |
147,529 | public void visitMethodInsn ( int opcode , String owner , String name , String desc , boolean itf ) { if ( mv != null ) { mv . visitMethodInsn ( opcode , owner , name , desc , itf ) ; } } | Visits a method instruction . A method instruction is an instruction that invokes a method . |
147,530 | public AnnotationVisitor visitLocalVariableAnnotation ( int typeRef , TypePath typePath , Label [ ] start , Label [ ] end , int [ ] index , String desc , boolean visible ) { if ( mv != null ) { return mv . visitLocalVariableAnnotation ( typeRef , typePath , start , end , index , desc , visible ) ; } return null ; } | Visits an annotation on a local variable type . |
147,531 | public void setHeader ( String header ) { headerLabel . getElement ( ) . setInnerSafeHtml ( SafeHtmlUtils . fromString ( header ) ) ; addStyleName ( CssName . WITH_HEADER ) ; ListItem item = new ListItem ( headerLabel ) ; UiHelper . addMousePressedHandlers ( item ) ; item . setStyleName ( CssName . COLLECTION_HEADER ) ... | Sets the header of the collection component . |
147,532 | public void setHtml ( String html ) { this . html = html ; if ( widget != null ) { if ( widget . isAttached ( ) ) { tooltipElement . find ( "span" ) . html ( html != null ? html : "" ) ; } else { widget . addAttachHandler ( event -> tooltipElement . find ( "span" ) . html ( html != null ? html : "" ) ) ; } } else { GWT... | Set the html as value inside the tooltip . |
147,533 | public void addItem ( T value , String text , boolean reload ) { values . add ( value ) ; listBox . addItem ( text , keyFactory . generateKey ( value ) ) ; if ( reload ) { reload ( ) ; } } | Adds an item to the list box specifying an initial value for the item . |
147,534 | public void addItem ( T value , Direction dir , String text ) { addItem ( value , dir , text , true ) ; } | Adds an item to the list box specifying its direction and an initial value for the item . |
147,535 | public void removeValue ( T value , boolean reload ) { int idx = getIndex ( value ) ; if ( idx >= 0 ) { removeItemInternal ( idx , reload ) ; } } | Removes a value from the list box . Nothing is done if the value isn t on the list box . |
147,536 | public void clear ( ) { values . clear ( ) ; listBox . clear ( ) ; clearStatusText ( ) ; if ( emptyPlaceHolder != null ) { insertEmptyPlaceHolder ( emptyPlaceHolder ) ; } reload ( ) ; if ( isAllowBlank ( ) ) { addBlankItemIfNeeded ( ) ; } } | Removes all items from the list box . |
147,537 | public String [ ] getItemsSelected ( ) { List < String > selected = new LinkedList < > ( ) ; for ( int i = getIndexOffset ( ) ; i < listBox . getItemCount ( ) ; i ++ ) { if ( listBox . isItemSelected ( i ) ) { selected . add ( listBox . getValue ( i ) ) ; } } return selected . toArray ( new String [ selected . size ( )... | Returns all selected values of the list box or empty array if none . |
147,538 | public void setValueSelected ( T value , boolean selected ) { int idx = getIndex ( value ) ; if ( idx >= 0 ) { setItemSelectedInternal ( idx , selected ) ; } } | Sets whether an individual list value is selected . |
147,539 | public int getIndex ( T value ) { int count = getItemCount ( ) ; for ( int i = 0 ; i < count ; i ++ ) { if ( Objects . equals ( getValue ( i ) , value ) ) { return i ; } } return - 1 ; } | Gets the index of the specified value . |
147,540 | public HandlerRegistration addSearchFinishHandler ( final SearchFinishEvent . SearchFinishHandler handler ) { return addHandler ( handler , SearchFinishEvent . TYPE ) ; } | This handler will be triggered when search is finish |
147,541 | public HandlerRegistration addSearchNoResultHandler ( final SearchNoResultEvent . SearchNoResultHandler handler ) { return addHandler ( handler , SearchNoResultEvent . TYPE ) ; } | This handler will be triggered when there s no search result |
147,542 | public void setSize ( ButtonSize size ) { if ( this . size != null ) { removeStyleName ( this . size . getCssName ( ) ) ; } this . size = size ; if ( size != null ) { addStyleName ( size . getCssName ( ) ) ; } } | Set the buttons size . |
147,543 | public void setText ( String text ) { span . setText ( text ) ; if ( ! span . isAttached ( ) ) { add ( span ) ; } } | Set the buttons span text . |
147,544 | public static < E extends Enum < ? extends Style . HasCssName > > E fromStyleName ( final String styleName , final Class < E > enumClass , final E defaultValue ) { return EnumHelper . fromStyleName ( styleName , enumClass , defaultValue , true ) ; } | Returns first enum constant found .. |
147,545 | public void stopAnimation ( ) { if ( widget != null ) { widget . removeStyleName ( "animated" ) ; widget . removeStyleName ( transition . getCssName ( ) ) ; widget . removeStyleName ( CssName . INFINITE ) ; } } | Stop an animation . |
147,546 | public void clear ( ) { valueBoxBase . setText ( "" ) ; clearStatusText ( ) ; if ( getPlaceholder ( ) == null || getPlaceholder ( ) . isEmpty ( ) ) { label . removeStyleName ( CssName . ACTIVE ) ; } } | Resets the text box by removing its content and resetting visual state . |
147,547 | protected void updateLabelActiveStyle ( ) { if ( this . valueBoxBase . getText ( ) != null && ! this . valueBoxBase . getText ( ) . isEmpty ( ) ) { label . addStyleName ( CssName . ACTIVE ) ; } else { label . removeStyleName ( CssName . ACTIVE ) ; } } | Updates the style of the field label according to the field value if the field value is empty - null or - removes the label active style else will add the active style to the field label . |
147,548 | protected void checkActiveState ( Widget child ) { String href = child . getElement ( ) . getAttribute ( "href" ) ; String url = Window . Location . getHref ( ) ; int pos = url . indexOf ( "#" ) ; String location = pos >= 0 ? url . substring ( pos , url . length ( ) ) : "" ; if ( ! href . isEmpty ( ) && location . star... | Checks if this child holds the current active state . If the child is or contains the active state it is applied . |
147,549 | public void setActive ( boolean active ) { this . active = active ; if ( parent != null ) { fireCollapsibleHandler ( ) ; removeStyleName ( CssName . ACTIVE ) ; if ( header != null ) { header . removeStyleName ( CssName . ACTIVE ) ; } if ( active ) { if ( parent != null && parent . isAccordion ( ) ) { parent . clearActi... | Make this item active . |
147,550 | public void setDateMin ( Date dateMin ) { this . dateMin = dateMin ; if ( isAttached ( ) && dateMin != null ) { getPicker ( ) . set ( "min" , JsDate . create ( ( double ) dateMin . getTime ( ) ) ) ; } } | Set the minimum date limit . |
147,551 | public void setDateMax ( Date dateMax ) { this . dateMax = dateMax ; if ( isAttached ( ) && dateMax != null ) { getPicker ( ) . set ( "max" , JsDate . create ( ( double ) dateMax . getTime ( ) ) ) ; } } | Set the maximum date limit . |
147,552 | protected Date getPickerDate ( ) { try { JsDate pickerDate = getPicker ( ) . get ( "select" ) . obj ; return new Date ( ( long ) pickerDate . getTime ( ) ) ; } catch ( Exception e ) { e . printStackTrace ( ) ; return null ; } } | Get the pickers date . |
147,553 | public void setSelectionType ( MaterialDatePickerType selectionType ) { this . selectionType = selectionType ; switch ( selectionType ) { case MONTH_DAY : options . selectMonths = true ; break ; case YEAR_MONTH_DAY : options . selectYears = yearsToDisplay ; options . selectMonths = true ; break ; case YEAR : options . ... | Set the pickers selection type . |
147,554 | public void setAutoClose ( boolean autoClose ) { this . autoClose = autoClose ; if ( autoCloseHandlerRegistration != null ) { autoCloseHandlerRegistration . removeHandler ( ) ; autoCloseHandlerRegistration = null ; } if ( autoClose ) { autoCloseHandlerRegistration = registerHandler ( addValueChangeHandler ( event -> cl... | Enables or disables auto closing when selecting a date . |
147,555 | public void setAllowBlank ( boolean allowBlank ) { this . allowBlank = allowBlank ; if ( ! allowBlank ) { if ( blankValidator == null ) { blankValidator = createBlankValidator ( ) ; } setupBlurValidation ( ) ; addValidator ( blankValidator ) ; } else { removeValidator ( blankValidator ) ; } } | Enable or disable the default blank validator . |
147,556 | protected String ensureTextColorFormat ( String textColor ) { String formatted = "" ; boolean mainColor = true ; for ( String style : textColor . split ( " " ) ) { if ( mainColor ) { if ( ! style . endsWith ( "-text" ) ) { style += "-text" ; } mainColor = false ; } else { if ( ! style . startsWith ( "text-" ) ) { style... | Allow for the use of text shading and auto formatting . |
147,557 | public void selectTab ( ) { for ( Widget child : getChildren ( ) ) { if ( child instanceof HasHref ) { String href = ( ( HasHref ) child ) . getHref ( ) ; if ( parent != null && ! href . isEmpty ( ) ) { parent . selectTab ( href . replaceAll ( "[^a-zA-Z\\d\\s:]" , "" ) ) ; parent . reload ( ) ; break ; } } } } | Select this tab item . |
147,558 | public static String format ( String pattern , Object ... arguments ) { String msg = pattern ; if ( arguments != null ) { for ( int index = 0 ; index < arguments . length ; index ++ ) { msg = msg . replaceAll ( "\\{" + ( index + 1 ) + "\\}" , String . valueOf ( arguments [ index ] ) ) ; } } return msg ; } | Format the message using the pattern and the arguments . |
147,559 | public void setValue ( Boolean value , boolean fireEvents ) { boolean oldValue = getValue ( ) ; if ( value ) { input . getElement ( ) . setAttribute ( "checked" , "true" ) ; } else { input . getElement ( ) . removeAttribute ( "checked" ) ; } if ( fireEvents && oldValue != value ) { ValueChangeEvent . fire ( this , getV... | Set the value of switch component . |
147,560 | public static < E extends Style . HasCssName , F extends Enum < ? extends Style . HasCssName > > void addUniqueEnumStyleName ( final UIObject uiObject , final Class < F > enumClass , final E style ) { removeEnumStyleNames ( uiObject , enumClass ) ; addEnumStyleName ( uiObject , style ) ; } | Convenience method for first removing all enum style constants and then adding the single one . |
147,561 | public static void toggleStyleName ( final UIObject uiObject , final boolean toggleStyle , final String styleName ) { if ( toggleStyle ) { uiObject . addStyleName ( styleName ) ; } else { uiObject . removeStyleName ( styleName ) ; } } | Toggles a style name on a ui object |
147,562 | protected void setupRegistration ( ) { if ( isServiceWorkerSupported ( ) ) { Navigator . serviceWorker . register ( getResource ( ) ) . then ( object -> { logger . info ( "Service worker has been successfully registered" ) ; registration = ( ServiceWorkerRegistration ) object ; onRegistered ( new ServiceEvent ( ) , reg... | Initial setup of the service worker registration . |
147,563 | public HandlerRegistration addChangeHandler ( final ChangeHandler handler ) { return getRangeInputElement ( ) . addDomHandler ( handler , ChangeEvent . getType ( ) ) ; } | Register the ChangeHandler to become notified if the user changes the slider . The Handler is called when the user releases the mouse only at the end of the slide operation . |
147,564 | public ViewPort then ( Functions . Func1 < ViewPortChange > then , ViewPortFallback fallback ) { assert then != null : "'then' callback cannot be null" ; this . then = then ; this . fallback = fallback ; return load ( ) ; } | Load the view port execution . |
147,565 | protected ViewPort load ( ) { resize = Window . addResizeHandler ( event -> { execute ( event . getWidth ( ) , event . getHeight ( ) ) ; } ) ; execute ( window ( ) . width ( ) , ( int ) window ( ) . height ( ) ) ; return viewPort ; } | Load the windows resize handler with initial view port detection . |
147,566 | public static String format ( String format ) { if ( format == null ) { format = DEFAULT_FORMAT ; } else { if ( format . contains ( "M" ) ) { format = format . replace ( "M" , "m" ) ; } if ( format . contains ( "Y" ) ) { format = format . replace ( "Y" , "y" ) ; } if ( format . contains ( "D" ) ) { format = format . re... | Will auto format the given string to provide support for pickadate . js formats . |
147,567 | public void setWidth ( int width ) { this . width = width ; getElement ( ) . getStyle ( ) . setWidth ( width , Style . Unit . PX ) ; } | Set the menu s width in pixels . |
147,568 | public void setAccordion ( boolean accordion ) { getElement ( ) . setAttribute ( "data-collapsible" , accordion ? CssName . ACCORDION : CssName . EXPANDABLE ) ; reload ( ) ; } | Configure if you want this collapsible container to accordion its child elements or use expandable . |
147,569 | public String getInvalidMessage ( String key ) { return invalidMessageOverride == null ? messageMixin . lookup ( key , messageValueArgs ) : MessageFormat . format ( invalidMessageOverride , messageValueArgs ) ; } | Gets the invalid message . |
147,570 | public void installApp ( Functions . Func callback ) { if ( isPwaSupported ( ) ) { appInstaller = new AppInstaller ( callback ) ; appInstaller . prompt ( ) ; } } | Will prompt a user the Add to Homescreen feature |
147,571 | public void show ( ) { if ( ! ( container instanceof RootPanel ) ) { if ( ! ( container instanceof MaterialDialog ) ) { container . getElement ( ) . getStyle ( ) . setPosition ( Style . Position . RELATIVE ) ; } div . getElement ( ) . getStyle ( ) . setPosition ( Style . Position . ABSOLUTE ) ; } if ( scrollDisabled ) ... | Shows the Loader component |
147,572 | public void hide ( ) { div . removeFromParent ( ) ; if ( scrollDisabled ) { RootPanel . get ( ) . getElement ( ) . getStyle ( ) . setOverflow ( Style . Overflow . AUTO ) ; } if ( type == LoaderType . CIRCULAR ) { preLoader . removeFromParent ( ) ; } else if ( type == LoaderType . PROGRESS ) { progress . removeFromParen... | Hides the Loader component |
147,573 | public static void detectAndApply ( Widget widget ) { if ( ! widget . isAttached ( ) ) { widget . addAttachHandler ( event -> { if ( event . isAttached ( ) ) { detectAndApply ( ) ; } } ) ; } else { detectAndApply ( ) ; } } | Detect and apply waves now or when the widget is attached . |
147,574 | public void setType ( CheckBoxType type ) { this . type = type ; switch ( type ) { case FILLED : Element input = DOM . getChild ( getElement ( ) , 0 ) ; input . setAttribute ( "class" , CssName . FILLED_IN ) ; break ; case INTERMEDIATE : addStyleName ( type . getCssName ( ) + "-checkbox" ) ; break ; default : addStyleN... | Setting the type of Checkbox . |
147,575 | ArgumentsBuilder param ( String param , Integer value ) { if ( value != null ) { args . add ( param ) ; args . add ( value . toString ( ) ) ; } return this ; } | Adds a parameter to the argument list if the given integer is non - null . If the value is null then the argument list remains unchanged . |
147,576 | ArgumentsBuilder param ( String param , String value ) { if ( value != null ) { args . add ( param ) ; args . add ( value ) ; } return this ; } | Adds a parameter that requires a string argument to the argument list . If the given argument is null then the argument list remains unchanged . |
147,577 | protected List < String > arguments ( ) { List < String > args = new ArgumentsBuilder ( ) . flag ( "-v" , verbose ) . flag ( "--package-dir" , packageDir ) . param ( "-d" , outputDirectory . getPath ( ) ) . param ( "-p" , packageName ) . map ( "--package:" , packageNameMap ( ) ) . param ( "--class-prefix" , classPrefix... | Returns the command line options to be used for scalaxb excluding the input file names . |
147,578 | Map < String , String > packageNameMap ( ) { if ( packageNames == null ) { return emptyMap ( ) ; } Map < String , String > names = new LinkedHashMap < String , String > ( ) ; for ( PackageName name : packageNames ) { names . put ( name . getUri ( ) , name . getPackage ( ) ) ; } return names ; } | Returns a map of URIs to package name as specified by the packageNames parameter . |
147,579 | public static String placeholders ( final int numberOfPlaceholders ) { if ( numberOfPlaceholders == 1 ) { return "?" ; } else if ( numberOfPlaceholders == 0 ) { return "" ; } else if ( numberOfPlaceholders < 0 ) { throw new IllegalArgumentException ( "numberOfPlaceholders must be >= 0, but was = " + numberOfPlaceholder... | Generates required number of placeholders as string . |
147,580 | public Tuple get ( RowKey key ) { AssociationOperation result = currentState . get ( key ) ; if ( result == null ) { return cleared ? null : snapshot . get ( key ) ; } else if ( result . getType ( ) == REMOVE ) { return null ; } return result . getValue ( ) ; } | Returns the association row with the given key . |
147,581 | public void remove ( RowKey key ) { currentState . put ( key , new AssociationOperation ( key , null , REMOVE ) ) ; } | Removes the row with the specified key from this association . |
147,582 | public boolean isEmpty ( ) { int snapshotSize = cleared ? 0 : snapshot . size ( ) ; if ( snapshotSize == 0 && currentState . isEmpty ( ) ) { return true ; } if ( snapshotSize > currentState . size ( ) ) { return false ; } return size ( ) == 0 ; } | Whether this association contains no rows . |
147,583 | public int size ( ) { int size = cleared ? 0 : snapshot . size ( ) ; for ( Map . Entry < RowKey , AssociationOperation > op : currentState . entrySet ( ) ) { switch ( op . getValue ( ) . getType ( ) ) { case PUT : if ( cleared || ! snapshot . containsKey ( op . getKey ( ) ) ) { size ++ ; } break ; case REMOVE : if ( ! ... | Returns the number of rows within this association . |
147,584 | public Iterable < RowKey > getKeys ( ) { if ( currentState . isEmpty ( ) ) { if ( cleared ) { return Collections . emptyList ( ) ; } else { return snapshot . getRowKeys ( ) ; } } else { Set < RowKey > keys = CollectionHelper . newLinkedHashSet ( cleared ? currentState . size ( ) : snapshot . size ( ) + currentState . s... | Returns all keys of all rows contained within this association . |
147,585 | public Object getColumnValue ( String columnName ) { for ( int j = 0 ; j < columnNames . length ; j ++ ) { if ( columnNames [ j ] . equals ( columnName ) ) { return columnValues [ j ] ; } } return null ; } | Get the value of the specified column . |
147,586 | public boolean contains ( String column ) { for ( String columnName : columnNames ) { if ( columnName . equals ( column ) ) { return true ; } } return false ; } | Check if a column is part of the row key columns . |
147,587 | private void loadResourceFile ( URL configurationResourceUrl , Properties hotRodConfiguration ) { if ( configurationResourceUrl != null ) { try ( InputStream openStream = configurationResourceUrl . openStream ( ) ) { hotRodConfiguration . load ( openStream ) ; } catch ( IOException e ) { throw log . failedLoadingHotRod... | Load the properties from the resource file if one is specified |
147,588 | private static < D extends DatastoreConfiguration < G > , G extends GlobalContext < ? , ? > > AppendableConfigurationContext invokeOptionConfigurator ( OptionConfigurator configurator ) { ConfigurableImpl configurable = new ConfigurableImpl ( ) ; configurator . configure ( configurable ) ; return configurable . getCont... | Invokes the given configurator obtaining the correct global context type via the datastore configuration type of the current datastore provider . |
147,589 | public boolean isKeyColumn ( String columnName ) { for ( String keyColumName : getColumnNames ( ) ) { if ( keyColumName . equals ( columnName ) ) { return true ; } } return false ; } | Whether the given column is part of this key family or not . |
147,590 | public List < Object > loadEntitiesFromTuples ( SharedSessionContractImplementor session , LockOptions lockOptions , OgmLoadingContext ogmContext ) { return loadEntity ( null , null , session , lockOptions , ogmContext ) ; } | Load a list of entities using the information in the context |
147,591 | public final void loadCollection ( final SharedSessionContractImplementor session , final Serializable id , final Type type ) throws HibernateException { if ( log . isDebugEnabled ( ) ) { log . debug ( "loading collection: " + MessageHelper . collectionInfoString ( getCollectionPersisters ( ) [ 0 ] , id , getFactory ( ... | Called by subclasses that initialize collections |
147,592 | private List < Object > doQueryAndInitializeNonLazyCollections ( SharedSessionContractImplementor session , QueryParameters qp , OgmLoadingContext ogmLoadingContext , boolean returnProxies ) { final PersistenceContext persistenceContext = session . getPersistenceContext ( ) ; boolean defaultReadOnlyOrig = persistenceCo... | Load the entity activating the persistence context execution boundaries |
147,593 | private List < Object > doQuery ( SharedSessionContractImplementor session , QueryParameters qp , OgmLoadingContext ogmLoadingContext , boolean returnProxies ) { int entitySpan = entityPersisters . length ; final List < Object > hydratedObjects = entitySpan == 0 ? null : new ArrayList < Object > ( entitySpan * 10 ) ; f... | Execute the physical query and initialize the various entities and collections |
147,594 | private void readCollectionElement ( final Object optionalOwner , final Serializable optionalKey , final CollectionPersister persister , final CollectionAliases descriptor , final ResultSet rs , final SharedSessionContractImplementor session ) throws HibernateException , SQLException { final PersistenceContext persiste... | Read one collection element from the current row of the JDBC result set |
147,595 | private void instanceAlreadyLoaded ( final Tuple resultset , final int i , final OgmEntityPersister persister , final org . hibernate . engine . spi . EntityKey key , final Object object , final LockMode lockMode , final SharedSessionContractImplementor session ) throws HibernateException { if ( ! persister . isInstanc... | The entity instance is already in the session cache |
147,596 | private Object instanceNotYetLoaded ( final Tuple resultset , final int i , final Loadable persister , final String rowIdAlias , final org . hibernate . engine . spi . EntityKey key , final LockMode lockMode , final org . hibernate . engine . spi . EntityKey optionalObjectKey , final Object optionalObject , final List ... | The entity instance is not in the session cache |
147,597 | private void registerNonExists ( final org . hibernate . engine . spi . EntityKey [ ] keys , final Loadable [ ] persisters , final SharedSessionContractImplementor session ) { final int [ ] owners = getOwners ( ) ; if ( owners != null ) { EntityType [ ] ownerAssociationTypes = getOwnerAssociationTypes ( ) ; for ( int i... | For missing objects associated by one - to - one with another object in the result set register the fact that the object is missing with the session . |
147,598 | public Rule CriteriaOnlyFindQuery ( ) { return Sequence ( ! peek ( ) . isCliQuery ( ) , JsonParameter ( JsonObject ( ) ) , peek ( ) . setOperation ( Operation . FIND ) , peek ( ) . setCriteria ( match ( ) ) ) ; } | A find query only given as criterion . Leave it to MongoDB s own parser to handle it . |
147,599 | public static Map < String , Object > introspect ( Object obj ) throws IntrospectionException , InvocationTargetException , IllegalAccessException { Map < String , Object > result = new HashMap < > ( ) ; BeanInfo info = Introspector . getBeanInfo ( obj . getClass ( ) ) ; for ( PropertyDescriptor pd : info . getProperty... | Introspect the given object . |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.