idx int64 0 41.2k | question stringlengths 73 5.81k | target stringlengths 5 918 |
|---|---|---|
13,100 | public RequestHeader withUri ( URI uri ) { return new RequestHeader ( method , uri , protocol , acceptedResponseProtocols , principal , headers , lowercaseHeaders ) ; } | Return a copy of this request header with the given uri set . |
13,101 | public RequestHeader withAcceptedResponseProtocols ( PSequence < MessageProtocol > acceptedResponseProtocols ) { return new RequestHeader ( method , uri , protocol , acceptedResponseProtocols , principal , headers , lowercaseHeaders ) ; } | Return a copy of this request header with the given accepted response protocols set . |
13,102 | public RequestHeader withPrincipal ( Principal principal ) { return new RequestHeader ( method , uri , protocol , acceptedResponseProtocols , Optional . ofNullable ( principal ) , headers , lowercaseHeaders ) ; } | Return a copy of this request header with the principal set . |
13,103 | public RequestHeader clearPrincipal ( ) { return new RequestHeader ( method , uri , protocol , acceptedResponseProtocols , Optional . empty ( ) , headers , lowercaseHeaders ) ; } | Return a copy of this request header with the principal cleared . |
13,104 | public Optional < String > getHeader ( String name ) { PSequence < String > values = lowercaseHeaders . get ( name . toLowerCase ( Locale . ENGLISH ) ) ; if ( values == null || values . isEmpty ( ) ) { return Optional . empty ( ) ; } else { return Optional . of ( values . get ( 0 ) ) ; } } | Get the header with the given name . |
13,105 | @ SuppressWarnings ( "unchecked" ) public < Metadata > Optional < Metadata > get ( MetadataKey < Metadata > key ) { return Optional . ofNullable ( ( Metadata ) metadataMap . get ( key ) ) ; } | Get the metadata for the given metadata key . |
13,106 | public < Metadata > Message < Payload > add ( MetadataKey < Metadata > key , Metadata metadata ) { return new Message < > ( payload , metadataMap . plus ( key , metadata ) ) ; } | Add a metadata key and value to this message . |
13,107 | public static < Payload > Message < Payload > create ( Payload payload ) { return new Message < > ( payload , HashTreePMap . empty ( ) ) ; } | Create a message with the given payload . |
13,108 | public static Binder binder ( Object module ) { if ( module instanceof AbstractModule ) { try { Method method = AbstractModule . class . getDeclaredMethod ( "binder" ) ; if ( ! method . isAccessible ( ) ) { method . setAccessible ( true ) ; } return ( Binder ) method . invoke ( module ) ; } catch ( Exception e ) { thro... | Get the binder from an AbstractModule . |
13,109 | public Descriptor withCalls ( Call < ? , ? > ... calls ) { return replaceAllCalls ( this . calls . plusAll ( Arrays . asList ( calls ) ) ) ; } | Add the given service calls to this service . |
13,110 | public Descriptor replaceAllCalls ( PSequence < Call < ? , ? > > calls ) { return new Descriptor ( name , calls , pathParamSerializers , messageSerializers , serializerFactory , exceptionSerializer , autoAcl , acls , headerFilter , locatableService , circuitBreaker , topicCalls ) ; } | Replace all the service calls provided by this descriptor with the the given service calls . |
13,111 | public Descriptor replaceAllPathParamSerializers ( PMap < Type , PathParamSerializer < ? > > pathParamSerializers ) { return new Descriptor ( name , calls , pathParamSerializers , messageSerializers , serializerFactory , exceptionSerializer , autoAcl , acls , headerFilter , locatableService , circuitBreaker , topicCall... | Replace all the path param serializers registered with this descriptor with the the given path param serializers . |
13,112 | public Descriptor replaceAllMessageSerializers ( PMap < Type , MessageSerializer < ? , ? > > messageSerializers ) { return new Descriptor ( name , calls , pathParamSerializers , messageSerializers , serializerFactory , exceptionSerializer , autoAcl , acls , headerFilter , locatableService , circuitBreaker , topicCalls ... | Replace all the message serializers registered with this descriptor with the the given message serializers . |
13,113 | public Descriptor replaceAllTopicCalls ( PSequence < TopicCall < ? > > topicCalls ) { return new Descriptor ( name , calls , pathParamSerializers , messageSerializers , serializerFactory , exceptionSerializer , autoAcl , acls , headerFilter , locatableService , circuitBreaker , topicCalls ) ; } | Replace all the topic calls provided by this descriptor with the the given topic calls . |
13,114 | public Descriptor withExceptionSerializer ( ExceptionSerializer exceptionSerializer ) { return new Descriptor ( name , calls , pathParamSerializers , messageSerializers , serializerFactory , exceptionSerializer , autoAcl , acls , headerFilter , locatableService , circuitBreaker , topicCalls ) ; } | Use the given exception serializer to serialize and deserialized exceptions handled by this service . |
13,115 | public Descriptor withServiceAcls ( ServiceAcl ... acls ) { return replaceAllAcls ( this . acls . plusAll ( Arrays . asList ( acls ) ) ) ; } | Add the given manual ACLs . |
13,116 | public Descriptor replaceAllAcls ( PSequence < ServiceAcl > acls ) { return new Descriptor ( name , calls , pathParamSerializers , messageSerializers , serializerFactory , exceptionSerializer , autoAcl , acls , headerFilter , locatableService , circuitBreaker , topicCalls ) ; } | Replace all the ACLs with the given ACL sequence . |
13,117 | public Descriptor withTopics ( TopicCall < ? > ... topicCalls ) { return new Descriptor ( name , calls , pathParamSerializers , messageSerializers , serializerFactory , exceptionSerializer , autoAcl , acls , headerFilter , locatableService , circuitBreaker , this . topicCalls . plusAll ( Arrays . asList ( topicCalls ) ... | Add the given topic calls to this service . |
13,118 | public static < Message > Topic < Message > singleStreamWithOffset ( Function < Offset , Source < Pair < Message , Offset > , ? > > eventStream ) { return taggedStreamWithOffset ( SINGLETON_TAG , ( tag , offset ) -> eventStream . apply ( offset ) ) ; } | Publish a single stream . |
13,119 | public static < Message , Event extends AggregateEvent < Event > > Topic < Message > taggedStreamWithOffset ( PSequence < AggregateEventTag < Event > > tags , BiFunction < AggregateEventTag < Event > , Offset , Source < Pair < Message , Offset > , ? > > eventStream ) { return new TaggedOffsetTopicProducer < > ( tags , ... | Publish a stream that is sharded across many tags . |
13,120 | public static < Message , Event extends AggregateEvent < Event > > Topic < Message > taggedStreamWithOffset ( AggregateEventShards < Event > shards , BiFunction < AggregateEventTag < Event > , Offset , Source < Pair < Message , Offset > , ? > > eventStream ) { return new TaggedOffsetTopicProducer < > ( shards . allTags... | Publish all tags of a stream that is sharded across many tags . |
13,121 | public static TransportErrorCode fromHttp ( int code ) { TransportErrorCode builtIn = HTTP_ERROR_CODE_MAP . get ( code ) ; if ( builtIn == null ) { if ( code > 599 || code < 100 ) { throw new IllegalArgumentException ( "Invalid http status code: " + code ) ; } else if ( code < 400 ) { throw new IllegalArgumentException... | Get a transport error code from the given HTTP error code . |
13,122 | public static TransportErrorCode fromWebSocket ( int code ) { TransportErrorCode builtIn = WEBSOCKET_ERROR_CODE_MAP . get ( code ) ; if ( builtIn == null ) { if ( code < 0 || code > 65535 ) { throw new IllegalArgumentException ( "Invalid WebSocket status code: " + code ) ; } else if ( code >= 4400 && code <= 4599 ) { r... | Get a transport error code from the given WebSocket close code . |
13,123 | private Behavior becomePostAdded ( BlogState newState ) { BehaviorBuilder b = newBehaviorBuilder ( newState ) ; b . setCommandHandler ( ChangeBody . class , ( cmd , ctx ) -> ctx . thenPersist ( new BodyChanged ( entityId ( ) , cmd . getBody ( ) ) , evt -> ctx . reply ( Done . getInstance ( ) ) ) ) ; b . setEventHandler... | Behavior can be changed in the event handlers . |
13,124 | public static GoogleLogger forEnclosingClass ( ) { String loggingClass = Platform . getCallerFinder ( ) . findLoggingClass ( GoogleLogger . class ) ; return new GoogleLogger ( Platform . getBackend ( loggingClass ) ) ; } | Returns a new Google specific logger instance using printf style message formatting . |
13,125 | public static GoogleLogger forInjectedClassName ( String className ) { checkArgument ( ! className . isEmpty ( ) , "injected class name is empty" ) ; return new GoogleLogger ( Platform . getBackend ( className . replace ( '/' , '.' ) ) ) ; } | Returns a new Google specific logger instance for the given class using printf style message formatting . |
13,126 | public Tags merge ( Tags other ) { if ( other . isEmpty ( ) ) { return this ; } if ( this . isEmpty ( ) ) { return other ; } SortedMap < String , SortedSet < Object > > merged = new TreeMap < String , SortedSet < Object > > ( ) ; for ( Map . Entry < String , SortedSet < Object > > e : map . entrySet ( ) ) { SortedSet <... | Merges two tags instances combining values for any name contained in both . |
13,127 | private static < T > T resolveAttribute ( String attributeName , Class < T > type ) { String getter = readProperty ( attributeName ) ; if ( getter == null ) { return null ; } int idx = getter . indexOf ( '#' ) ; if ( idx <= 0 || idx == getter . length ( ) - 1 ) { error ( "invalid getter (expected <class>#<method>): %s\... | Helper to call a static no - arg getter to obtain an instance of a specified type . This is used for platform aspects which are optional but are expected to have a singleton available . |
13,128 | private static Parameter wrapHexParameter ( final FormatOptions options , int index ) { return new Parameter ( options , index ) { protected void accept ( ParameterVisitor visitor , Object value ) { visitor . visit ( value . hashCode ( ) , FormatChar . HEX , getFormatOptions ( ) ) ; } public String getFormat ( ) { retu... | Static method so the anonymous synthetic parameter is static rather than an inner class . |
13,129 | void log ( LogRecord record , boolean wasForced ) { if ( ! wasForced || logger . isLoggable ( record . getLevel ( ) ) ) { logger . log ( record ) ; } else { Filter filter = logger . getFilter ( ) ; if ( filter != null ) { filter . isLoggable ( record ) ; } if ( logger . getClass ( ) == Logger . class || cannotUseForcin... | loggability check . |
13,130 | private static void publish ( Logger logger , LogRecord record ) { for ( Handler handler : logger . getHandlers ( ) ) { handler . publish ( record ) ; } if ( logger . getUseParentHandlers ( ) ) { logger = logger . getParent ( ) ; if ( logger != null ) { publish ( logger , record ) ; } } } | rate limiting . Thus we don t have to care about using iterative methods vs recursion here . |
13,131 | void forceLoggingViaChildLogger ( LogRecord record ) { Logger forcingLogger = getForcingLogger ( logger ) ; try { forcingLogger . setLevel ( Level . ALL ) ; } catch ( SecurityException e ) { cannotUseForcingLogger = true ; Logger . getLogger ( "" ) . log ( Level . SEVERE , "Forcing log statements with Flogger has been ... | subclasses of Logger to be used . |
13,132 | public static String checkMetadataIdentifier ( String s ) { if ( s . isEmpty ( ) ) { throw new IllegalArgumentException ( "identifier must not be empty" ) ; } if ( ! isLetter ( s . charAt ( 0 ) ) ) { throw new IllegalArgumentException ( "identifier must start with an ASCII letter: " + s ) ; } for ( int n = 1 ; n < s . ... | Checks if the given string is a valid metadata identifier . |
13,133 | public static StackTraceElement findCallerOf ( Class < ? > target , Throwable throwable , int skip ) { checkNotNull ( target , "target" ) ; checkNotNull ( throwable , "throwable" ) ; if ( skip < 0 ) { throw new IllegalArgumentException ( "skip count cannot be negative: " + skip ) ; } StackTraceElement [ ] stack = ( sta... | Returns the stack trace element of the immediate caller of the specified class . |
13,134 | public static StackTraceElement [ ] getStackForCallerOf ( Class < ? > target , Throwable throwable , int maxDepth ) { checkNotNull ( target , "target" ) ; checkNotNull ( throwable , "throwable" ) ; if ( maxDepth <= 0 && maxDepth != - 1 ) { throw new IllegalArgumentException ( "invalid maximum depth: " + maxDepth ) ; } ... | Returns a synthetic stack trace starting at the immediate caller of the specified target . |
13,135 | public final T build ( ) { getParser ( ) . parseImpl ( this ) ; if ( ( pmask & ( pmask + 1 ) ) != 0 || ( maxIndex > 31 && pmask != - 1 ) ) { int firstMissing = Integer . numberOfTrailingZeros ( ~ pmask ) ; throw ParseException . generic ( String . format ( "unreferenced arguments [first missing index=%d]" , firstMissin... | Builds a log message using the current message context . |
13,136 | public static FluentLogger forEnclosingClass ( ) { String loggingClass = Platform . getCallerFinder ( ) . findLoggingClass ( FluentLogger . class ) ; return new FluentLogger ( Platform . getBackend ( loggingClass ) ) ; } | Returns a new logger instance which parses log messages using printf format for the enclosing class using the system default logging backend . |
13,137 | @ SuppressWarnings ( "ReferenceEquality" ) private void logImpl ( String message , Object ... args ) { this . args = args ; for ( int n = 0 ; n < args . length ; n ++ ) { if ( args [ n ] instanceof LazyArg ) { args [ n ] = ( ( LazyArg < ? > ) args [ n ] ) . evaluate ( ) ; } } if ( message != LITERAL_VALUE_MESSAGE ) { t... | Make the backend logging call . This is the point at which we have paid the price of creating a varargs array and doing any necessary auto - boxing . |
13,138 | private static SimpleParameter [ ] createParameterArray ( FormatChar formatChar ) { SimpleParameter [ ] parameters = new SimpleParameter [ MAX_CACHED_PARAMETERS ] ; for ( int index = 0 ; index < MAX_CACHED_PARAMETERS ; index ++ ) { parameters [ index ] = new SimpleParameter ( index , formatChar , FormatOptions . getDef... | Helper to make reusable default parameter instances for the commonest indices . |
13,139 | public static LoggerConfig getConfig ( String name ) { LoggerConfig config = strongRefMap . get ( checkNotNull ( name , "logger name" ) ) ; if ( config == null ) { config = new LoggerConfig ( name ) ; strongRefMap . put ( name , config ) ; } return config ; } | Returns a configuration instance suitable for configuring a logger with the same name . |
13,140 | final void write ( LogData data ) { checkNotNull ( data , "data" ) ; try { backend . log ( data ) ; } catch ( RuntimeException error ) { try { backend . handleError ( error , data ) ; } catch ( LoggingException allowed ) { throw allowed ; } catch ( RuntimeException wtf ) { System . err . println ( "logging error: " + w... | Invokes the logging backend to write a log statement . |
13,141 | private static void safeFormatTo ( Formattable value , StringBuilder out , FormatOptions options ) { int formatFlags = options . getFlags ( ) & ( FLAG_LEFT_ALIGN | FLAG_UPPER_CASE | FLAG_SHOW_ALT_FORM ) ; if ( formatFlags != 0 ) { formatFlags = ( ( formatFlags & FLAG_LEFT_ALIGN ) != 0 ? FormattableFlags . LEFT_JUSTIFY ... | Returns a string representation of the user supplied formattable accounting for any possible runtime exceptions . |
13,142 | static org . apache . log4j . Level toLog4jLevel ( java . util . logging . Level level ) { if ( level . intValue ( ) >= java . util . logging . Level . SEVERE . intValue ( ) ) { return org . apache . log4j . Level . ERROR ; } else if ( level . intValue ( ) >= java . util . logging . Level . WARNING . intValue ( ) ) { r... | Converts java . util . logging . Level to org . apache . log4j . Level . |
13,143 | public static ParseException withBounds ( String errorMessage , String logMessage , int start , int end ) { return new ParseException ( msg ( errorMessage , logMessage , start , end ) , logMessage ) ; } | Creates a new parse exception for situations in which both the start and end positions of the error are known . |
13,144 | public static ParseException atPosition ( String errorMessage , String logMessage , int position ) { return new ParseException ( msg ( errorMessage , logMessage , position , position + 1 ) , logMessage ) ; } | Creates a new parse exception for situations in which the position of the error is known . |
13,145 | public static ParseException withStartPosition ( String errorMessage , String logMessage , int start ) { return new ParseException ( msg ( errorMessage , logMessage , start , - 1 ) , logMessage ) ; } | Creates a new parse exception for situations in which only the start position of the error is known . |
13,146 | private static String msg ( String errorMessage , String logMessage , int errorStart , int errorEnd ) { if ( errorEnd < 0 ) { errorEnd = logMessage . length ( ) ; } StringBuilder out = new StringBuilder ( errorMessage ) . append ( ": " ) ; if ( errorStart > SNIPPET_LENGTH + ELLIPSIS . length ( ) ) { out . append ( ELLI... | Helper to format a human readable error message for this exception . |
13,147 | static void formatBadLogData ( RuntimeException error , LogData badLogData , SimpleLogHandler receiver ) { StringBuilder errorMsg = new StringBuilder ( "LOGGING ERROR: " ) . append ( error . getMessage ( ) ) . append ( '\n' ) ; int length = errorMsg . length ( ) ; try { appendLogData ( badLogData , errorMsg ) ; } catch... | Formats the log message in response to an exception during a previous logging attempt . A synthetic error message is generated from the original log data and the given exception is set as the cause . The level of this record is the maximum of WARNING or the original level . |
13,148 | public static FormatOptions of ( int flags , int width , int precision ) { if ( ! checkFlagConsistency ( flags , width != UNSET ) ) { throw new IllegalArgumentException ( "invalid flags: 0x" + Integer . toHexString ( flags ) ) ; } if ( ( width < 1 || width > MAX_ALLOWED_WIDTH ) && width != UNSET ) { throw new IllegalAr... | Creates a options instance with the given values . |
13,149 | public static FormatOptions parse ( String message , int pos , int end , boolean isUpperCase ) throws ParseException { if ( pos == end && ! isUpperCase ) { return DEFAULT ; } int flags = isUpperCase ? FLAG_UPPER_CASE : 0 ; char c ; while ( true ) { if ( pos == end ) { return new FormatOptions ( flags , UNSET , UNSET ) ... | Parses a sub - sequence of a log message to extract and return its options . Note that callers cannot rely on this method producing new instances each time it is called as caching of common option values may occur . |
13,150 | static int parseValidFlags ( String flagChars , boolean hasUpperVariant ) { int flags = hasUpperVariant ? FLAG_UPPER_CASE : 0 ; for ( int i = 0 ; i < flagChars . length ( ) ; i ++ ) { int flagIdx = indexOfFlagCharacter ( flagChars . charAt ( i ) ) ; if ( flagIdx < 0 ) { throw new IllegalArgumentException ( "invalid fla... | Internal helper method for creating a bit - mask from a string of valid flag characters . |
13,151 | public FormatOptions filter ( int allowedFlags , boolean allowWidth , boolean allowPrecision ) { if ( isDefault ( ) ) { return this ; } int newFlags = allowedFlags & flags ; int newWidth = allowWidth ? width : UNSET ; int newPrecision = allowPrecision ? precision : UNSET ; if ( newFlags == 0 && newWidth == UNSET && new... | Returns a possibly new FormatOptions instance possibly containing a subset of the formatting information . This is useful if a backend implementation wishes to create formatting options that ignore some of the specified formatting information . |
13,152 | static boolean checkFlagConsistency ( int flags , boolean hasWidth ) { if ( ( flags & ( FLAG_PREFIX_PLUS_FOR_POSITIVE_VALUES | FLAG_PREFIX_SPACE_FOR_POSITIVE_VALUES ) ) == ( FLAG_PREFIX_PLUS_FOR_POSITIVE_VALUES | FLAG_PREFIX_SPACE_FOR_POSITIVE_VALUES ) ) { return false ; } if ( ( flags & ( FLAG_LEFT_ALIGN | FLAG_SHOW_L... | Helper to check for legal combinations of flags . |
13,153 | public Class resolveTypeVariable ( TypeVariable typeVariable ) { for ( int i = argumentsSize - 2 ; i >= 0 ; i -= 2 ) if ( arguments [ i ] == typeVariable ) return ( Class ) arguments [ i + 1 ] ; return null ; } | Returns the class for the specified type variable or null if it is not known . |
13,154 | static public Type resolveType ( Class fromClass , Class toClass , Type type ) { if ( type instanceof Class ) return ( Class ) type ; if ( type instanceof TypeVariable ) return resolveTypeVariable ( fromClass , toClass , type , true ) ; if ( type instanceof ParameterizedType ) return ( Class ) ( ( ParameterizedType ) t... | Returns the class for the specified type after replacing any type variables using the class hierarchy between the specified classes . |
13,155 | static private Type resolveTypeVariable ( Class fromClass , Class current , Type type , boolean first ) { Type genericSuper = current . getGenericSuperclass ( ) ; if ( ! ( genericSuper instanceof ParameterizedType ) ) return type ; Class superClass = current . getSuperclass ( ) ; if ( superClass != fromClass ) { Type r... | Returns the class for the specified type variable by finding the first class in the hierarchy between the specified classes which explicitly specifies the type variable s class . |
13,156 | static public Type [ ] resolveTypeParameters ( Class fromClass , Class toClass , Type type ) { if ( type instanceof ParameterizedType ) { Type [ ] actualArgs = ( ( ParameterizedType ) type ) . getActualTypeArguments ( ) ; int n = actualArgs . length ; Type [ ] generics = new Type [ n ] ; for ( int i = 0 ; i < n ; i ++ ... | Resolves type variables for the type parameters of the specified type by using the class hierarchy between the specified classes . |
13,157 | protected int require ( int required ) throws KryoException { int remaining = limit - position ; if ( remaining >= required ) return remaining ; if ( required > capacity ) throw new KryoException ( "Buffer too small: capacity: " + capacity + ", required: " + required ) ; int count ; if ( remaining > 0 ) { count = fill ... | Fills the buffer with at least the number of bytes specified . |
13,158 | protected int optional ( int optional ) throws KryoException { int remaining = limit - position ; if ( remaining >= optional ) return optional ; optional = Math . min ( optional , capacity ) ; int count ; count = fill ( buffer , limit , capacity - limit ) ; if ( count == - 1 ) return remaining == 0 ? - 1 : Math . min (... | Fills the buffer with at least the number of bytes specified if possible . |
13,159 | public int readInt ( ) throws KryoException { require ( 4 ) ; byte [ ] buffer = this . buffer ; int p = this . position ; this . position = p + 4 ; return buffer [ p ] & 0xFF | ( buffer [ p + 1 ] & 0xFF ) << 8 | ( buffer [ p + 2 ] & 0xFF ) << 16 | ( buffer [ p + 3 ] & 0xFF ) << 24 ; } | Reads a 4 byte int . |
13,160 | public int readVarInt ( boolean optimizePositive ) throws KryoException { if ( require ( 1 ) < 5 ) return readVarInt_slow ( optimizePositive ) ; int b = buffer [ position ++ ] ; int result = b & 0x7F ; if ( ( b & 0x80 ) != 0 ) { byte [ ] buffer = this . buffer ; int p = position ; b = buffer [ p ++ ] ; result |= ( b & ... | Reads a 1 - 5 byte int . |
13,161 | public long readLong ( ) throws KryoException { require ( 8 ) ; byte [ ] buffer = this . buffer ; int p = position ; position = p + 8 ; return buffer [ p ] & 0xFF | ( buffer [ p + 1 ] & 0xFF ) << 8 | ( buffer [ p + 2 ] & 0xFF ) << 16 | ( long ) ( buffer [ p + 3 ] & 0xFF ) << 24 | ( long ) ( buffer [ p + 4 ] & 0xFF ) <<... | Reads an 8 byte long . |
13,162 | public long readVarLong ( boolean optimizePositive ) throws KryoException { if ( require ( 1 ) < 9 ) return readVarLong_slow ( optimizePositive ) ; int p = position ; int b = buffer [ p ++ ] ; long result = b & 0x7F ; if ( ( b & 0x80 ) != 0 ) { byte [ ] buffer = this . buffer ; b = buffer [ p ++ ] ; result |= ( b & 0x7... | Reads a 1 - 9 byte long . |
13,163 | public float readFloat ( ) throws KryoException { require ( 4 ) ; byte [ ] buffer = this . buffer ; int p = this . position ; this . position = p + 4 ; return Float . intBitsToFloat ( buffer [ p ] & 0xFF | ( buffer [ p + 1 ] & 0xFF ) << 8 | ( buffer [ p + 2 ] & 0xFF ) << 16 | ( buffer [ p + 3 ] & 0xFF ) << 24 ) ; } | Reads a 4 byte float . |
13,164 | public double readDouble ( ) throws KryoException { require ( 8 ) ; byte [ ] buffer = this . buffer ; int p = position ; position = p + 8 ; return Double . longBitsToDouble ( buffer [ p ] & 0xFF | ( buffer [ p + 1 ] & 0xFF ) << 8 | ( buffer [ p + 2 ] & 0xFF ) << 16 | ( long ) ( buffer [ p + 3 ] & 0xFF ) << 24 | ( long ... | Reads an 8 byte double . |
13,165 | public short readShort ( ) throws KryoException { require ( 2 ) ; int p = position ; position = p + 2 ; return ( short ) ( ( buffer [ p ] & 0xFF ) | ( ( buffer [ p + 1 ] & 0xFF ) ) << 8 ) ; } | Reads a 2 byte short . |
13,166 | public int readShortUnsigned ( ) throws KryoException { require ( 2 ) ; int p = position ; position = p + 2 ; return ( buffer [ p ] & 0xFF ) | ( ( buffer [ p + 1 ] & 0xFF ) ) << 8 ; } | Reads a 2 byte short as an int from 0 to 65535 . |
13,167 | public char readChar ( ) throws KryoException { require ( 2 ) ; int p = position ; position = p + 2 ; return ( char ) ( ( buffer [ p ] & 0xFF ) | ( ( buffer [ p + 1 ] & 0xFF ) ) << 8 ) ; } | Reads a 2 byte char . |
13,168 | public int [ ] readInts ( int length ) throws KryoException { int [ ] array = new int [ length ] ; if ( optional ( length << 2 ) == length << 2 ) { byte [ ] buffer = this . buffer ; int p = this . position ; for ( int i = 0 ; i < length ; i ++ , p += 4 ) { array [ i ] = buffer [ p ] & 0xFF | ( buffer [ p + 1 ] & 0xFF )... | Reads an int array in bulk . This may be more efficient than reading them individually . |
13,169 | public long [ ] readLongs ( int length ) throws KryoException { long [ ] array = new long [ length ] ; if ( optional ( length << 3 ) == length << 3 ) { byte [ ] buffer = this . buffer ; int p = this . position ; for ( int i = 0 ; i < length ; i ++ , p += 8 ) { array [ i ] = buffer [ p ] & 0xFF | ( buffer [ p + 1 ] & 0x... | Reads a long array in bulk . This may be more efficient than reading them individually . |
13,170 | public float [ ] readFloats ( int length ) throws KryoException { float [ ] array = new float [ length ] ; if ( optional ( length << 2 ) == length << 2 ) { byte [ ] buffer = this . buffer ; int p = this . position ; for ( int i = 0 ; i < length ; i ++ , p += 4 ) { array [ i ] = Float . intBitsToFloat ( buffer [ p ] & 0... | Reads a float array in bulk . This may be more efficient than reading them individually . |
13,171 | public double [ ] readDoubles ( int length ) throws KryoException { double [ ] array = new double [ length ] ; if ( optional ( length << 3 ) == length << 3 ) { byte [ ] buffer = this . buffer ; int p = this . position ; for ( int i = 0 ; i < length ; i ++ , p += 8 ) { array [ i ] = Double . longBitsToDouble ( buffer [ ... | Reads a double array in bulk . This may be more efficient than reading them individually . |
13,172 | public short [ ] readShorts ( int length ) throws KryoException { short [ ] array = new short [ length ] ; if ( optional ( length << 1 ) == length << 1 ) { byte [ ] buffer = this . buffer ; int p = this . position ; for ( int i = 0 ; i < length ; i ++ , p += 2 ) array [ i ] = ( short ) ( ( buffer [ p ] & 0xFF ) | ( ( b... | Reads a short array in bulk . This may be more efficient than reading them individually . |
13,173 | public char [ ] readChars ( int length ) throws KryoException { char [ ] array = new char [ length ] ; if ( optional ( length << 1 ) == length << 1 ) { byte [ ] buffer = this . buffer ; int p = this . position ; for ( int i = 0 ; i < length ; i ++ , p += 2 ) array [ i ] = ( char ) ( ( buffer [ p ] & 0xFF ) | ( ( buffer... | Reads a char array in bulk . This may be more efficient than reading them individually . |
13,174 | public boolean [ ] readBooleans ( int length ) throws KryoException { boolean [ ] array = new boolean [ length ] ; if ( optional ( length ) == length ) { byte [ ] buffer = this . buffer ; int p = this . position ; for ( int i = 0 ; i < length ; i ++ , p ++ ) array [ i ] = buffer [ p ] != 0 ; position = p ; } else { for... | Reads a boolean array in bulk . This may be more efficient than reading them individually . |
13,175 | public CachedField getField ( String fieldName ) { for ( CachedField cachedField : cachedFields . fields ) if ( cachedField . name . equals ( fieldName ) ) return cachedField ; throw new IllegalArgumentException ( "Field \"" + fieldName + "\" not found on class: " + type . getName ( ) ) ; } | Returns the field with the specified name allowing field specific settings to be configured . |
13,176 | static public ByteBuffer newDirectBuffer ( long address , int size ) { if ( directByteBufferConstructor == null ) throw new UnsupportedOperationException ( "No direct ByteBuffer constructor is available." ) ; try { return directByteBufferConstructor . newInstance ( address , size , null ) ; } catch ( Exception ex ) { t... | Create a ByteBuffer that uses the specified off - heap memory address instead of allocating a new one . |
13,177 | static public void dispose ( ByteBuffer buffer ) { if ( ! ( buffer instanceof DirectBuffer ) ) return ; if ( cleanerMethod != null ) { try { cleanMethod . invoke ( cleanerMethod . invoke ( buffer ) ) ; } catch ( Throwable ignored ) { } } } | Release a direct buffer immediately rather than waiting for GC . |
13,178 | public void endChunk ( ) { flush ( ) ; if ( TRACE ) trace ( "kryo" , "End chunk." ) ; try { getOutputStream ( ) . write ( 0 ) ; } catch ( IOException ex ) { throw new KryoException ( ex ) ; } } | Marks the curent written data as the end of a chunk . This chunk can then be skipped when reading . |
13,179 | public V put ( K key , V value ) { if ( key == null ) throw new IllegalArgumentException ( "key cannot be null." ) ; K [ ] keyTable = this . keyTable ; int mask = this . mask ; int hashCode = key . hashCode ( ) ; int index1 = hashCode & mask ; K key1 = keyTable [ index1 ] ; if ( key . equals ( key1 ) ) { V oldValue = v... | Returns the old value associated with the specified key or null . |
13,180 | public V remove ( K key ) { int hashCode = key . hashCode ( ) ; int index = hashCode & mask ; if ( key . equals ( keyTable [ index ] ) ) { keyTable [ index ] = null ; V oldValue = valueTable [ index ] ; valueTable [ index ] = null ; size -- ; return oldValue ; } index = hash2 ( hashCode ) ; if ( key . equals ( keyTable... | Returns the value associated with the key or null . |
13,181 | public void shrink ( int maximumCapacity ) { if ( maximumCapacity < 0 ) throw new IllegalArgumentException ( "maximumCapacity must be >= 0: " + maximumCapacity ) ; if ( size > maximumCapacity ) maximumCapacity = size ; if ( capacity <= maximumCapacity ) return ; maximumCapacity = nextPowerOfTwo ( maximumCapacity ) ; re... | Reduces the size of the backing arrays to be the specified capacity or less . If the capacity is already less nothing is done . If the map contains more items than the specified capacity the next highest power of two capacity is used instead . |
13,182 | public Serializer getDefaultSerializer ( Class type ) { if ( type == null ) throw new IllegalArgumentException ( "type cannot be null." ) ; Serializer serializerForAnnotation = getDefaultSerializerForAnnotatedType ( type ) ; if ( serializerForAnnotation != null ) return serializerForAnnotation ; for ( int i = 0 , n = d... | Returns the best matching serializer for a class . This method can be overridden to implement custom logic to choose a serializer . |
13,183 | public Registration writeClass ( Output output , Class type ) { if ( output == null ) throw new IllegalArgumentException ( "output cannot be null." ) ; try { return classResolver . writeClass ( output , type ) ; } finally { if ( depth == 0 && autoReset ) reset ( ) ; } } | Writes a class and returns its registration . |
13,184 | public void writeObject ( Output output , Object object ) { if ( output == null ) throw new IllegalArgumentException ( "output cannot be null." ) ; if ( object == null ) throw new IllegalArgumentException ( "object cannot be null." ) ; beginObject ( ) ; try { if ( references && writeReferenceOrNull ( output , object , ... | Writes an object using the registered serializer . |
13,185 | public void writeObject ( Output output , Object object , Serializer serializer ) { if ( output == null ) throw new IllegalArgumentException ( "output cannot be null." ) ; if ( object == null ) throw new IllegalArgumentException ( "object cannot be null." ) ; if ( serializer == null ) throw new IllegalArgumentException... | Writes an object using the specified serializer . The registered serializer is ignored . |
13,186 | public void writeObjectOrNull ( Output output , Object object , Serializer serializer ) { if ( output == null ) throw new IllegalArgumentException ( "output cannot be null." ) ; if ( serializer == null ) throw new IllegalArgumentException ( "serializer cannot be null." ) ; beginObject ( ) ; try { if ( references ) { if... | Writes an object or null using the specified serializer . The registered serializer is ignored . |
13,187 | public void writeClassAndObject ( Output output , Object object ) { if ( output == null ) throw new IllegalArgumentException ( "output cannot be null." ) ; beginObject ( ) ; try { if ( object == null ) { writeClass ( output , null ) ; return ; } Registration registration = writeClass ( output , object . getClass ( ) ) ... | Writes the class and object or null using the registered serializer . |
13,188 | public Registration readClass ( Input input ) { if ( input == null ) throw new IllegalArgumentException ( "input cannot be null." ) ; try { return classResolver . readClass ( input ) ; } finally { if ( depth == 0 && autoReset ) reset ( ) ; } } | Reads a class and returns its registration . |
13,189 | public < T > T readObject ( Input input , Class < T > type ) { if ( input == null ) throw new IllegalArgumentException ( "input cannot be null." ) ; if ( type == null ) throw new IllegalArgumentException ( "type cannot be null." ) ; beginObject ( ) ; try { T object ; if ( references ) { int stackSize = readReferenceOrN... | Reads an object using the registered serializer . |
13,190 | public Object readClassAndObject ( Input input ) { if ( input == null ) throw new IllegalArgumentException ( "input cannot be null." ) ; beginObject ( ) ; try { Registration registration = readClass ( input ) ; if ( registration == null ) return null ; Class type = registration . getType ( ) ; Object object ; if ( refe... | Reads the class and object or null using the registered serializer . |
13,191 | public void setReferenceResolver ( ReferenceResolver referenceResolver ) { if ( referenceResolver == null ) throw new IllegalArgumentException ( "referenceResolver cannot be null." ) ; this . references = true ; this . referenceResolver = referenceResolver ; if ( TRACE ) trace ( "kryo" , "Reference resolver: " + refere... | Sets the reference resolver and enables references . |
13,192 | public void clear ( int maximumCapacity ) { if ( capacity <= maximumCapacity ) { clear ( ) ; return ; } zeroValue = null ; hasZeroValue = false ; size = 0 ; resize ( maximumCapacity ) ; } | Clears the map and reduces the size of the backing arrays to be the specified capacity if they are larger . |
13,193 | public void setPortProbeDetails ( java . util . Collection < PortProbeDetail > portProbeDetails ) { if ( portProbeDetails == null ) { this . portProbeDetails = null ; return ; } this . portProbeDetails = new java . util . ArrayList < PortProbeDetail > ( portProbeDetails ) ; } | A list of port probe details objects . |
13,194 | public EncryptionContext withContext ( String key , String value ) { this . context . put ( key , value ) ; return this ; } | Fluent API to add encryption context . |
13,195 | public void setEgressEndpoints ( java . util . Collection < ChannelEgressEndpoint > egressEndpoints ) { if ( egressEndpoints == null ) { this . egressEndpoints = null ; return ; } this . egressEndpoints = new java . util . ArrayList < ChannelEgressEndpoint > ( egressEndpoints ) ; } | The endpoints where outgoing connections initiate from |
13,196 | public void setInputAttachments ( java . util . Collection < InputAttachment > inputAttachments ) { if ( inputAttachments == null ) { this . inputAttachments = null ; return ; } this . inputAttachments = new java . util . ArrayList < InputAttachment > ( inputAttachments ) ; } | List of input attachments for channel . |
13,197 | public java . util . concurrent . Future < DescribeSeverityLevelsResult > describeSeverityLevelsAsync ( com . amazonaws . handlers . AsyncHandler < DescribeSeverityLevelsRequest , DescribeSeverityLevelsResult > asyncHandler ) { return describeSeverityLevelsAsync ( new DescribeSeverityLevelsRequest ( ) , asyncHandler ) ... | Simplified method form for invoking the DescribeSeverityLevels operation with an AsyncHandler . |
13,198 | public void setState ( TransferState state ) { super . setState ( state ) ; switch ( state ) { case Waiting : fireProgressEvent ( ProgressEventType . TRANSFER_PREPARING_EVENT ) ; break ; case InProgress : if ( subTransferStarted . compareAndSet ( false , true ) ) { fireProgressEvent ( ProgressEventType . TRANSFER_START... | Override this method so that TransferState updates are also sent out to the progress listener chain in forms of ProgressEvent . |
13,199 | public void setAudioDescriptionNames ( java . util . Collection < String > audioDescriptionNames ) { if ( audioDescriptionNames == null ) { this . audioDescriptionNames = null ; return ; } this . audioDescriptionNames = new java . util . ArrayList < String > ( audioDescriptionNames ) ; } | The names of the AudioDescriptions used as audio sources for this output . |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.