@Override public Iterable<AdminCommand.Provider> getAllProviders() { return Service.load( AdminCommand.Provider.class ); } };
private static IndexEntryConflictException buildCauseChain( Set<IndexEntryConflictException> conflicts ) { IndexEntryConflictException chainedConflicts = null; for ( IndexEntryConflictException conflict : conflicts ) { chainedConflicts = Exceptions.chain( chainedConflicts, conflict ); } return chainedConflicts; }
/** * Textual representation format for a listen socket address. * @param hostname of the address. * @param port of the address. * @return a string representing the address. */ public static String listenAddress( String hostname, int port ) { return new ListenSocketAddress( hostname, port ).toString(); } }
@Override public HostnamePort apply( String value ) { return new HostnamePort( value ); }
/** * Textual representation format for an advertised socket address. * @param hostname of the address. * @param port of the address. * @return a string representing the address. */ public static String advertisedAddress( String hostname, int port ) { return new AdvertisedSocketAddress( hostname, port ).toString(); } }
@Override public String asString() { return Exceptions.stringify( failure ); }
@Override public String toString() { return Strings.prettyPrint( array ); } }
@Override protected boolean extract0( char[] data, int offset, int length, CSVHeaderInformation optionalData ) { value = safeCastLongToInt( extractLong( data, offset, length ) ); return true; }
/** * Tokenizes a string, regarding quotes. * * @param string the string to tokenize. * @return the tokens from the line. */ public static String[] tokenizeStringWithQuotes( String string ) { return tokenizeStringWithQuotes( string, true, false ); }
@Override public boolean equals( Object obj ) { return obj instanceof ArrayEqualityObject && ArrayUtil.equals( array, ((ArrayEqualityObject) obj).array ); }
@Override public String clientAddress() { return format( clientAddress ); }
@Override public void addListener( AvailabilityListener listener ) { listeners.add( listener ); }
@Override public String timestamp( long timeWritten, TimeZone timeZone ) { return Format.date( timeWritten, timeZone ) + "/" + timeWritten; } }
private boolean isCacheable( long size ) { return isPowerOfTwo( size ) && size <= maxCacheableBlockSize; } }
@Override protected boolean extract0( char[] data, int offset, int length, CSVHeaderInformation optionalData ) { value = safeCastLongToShort( extractLong( data, offset, length ) ); return true; }
@Override public int hashCode() { return ArrayUtil.hashCode( array ); }
private static <T> void notifySingleListener( T listener, Notification<T> notification ) { synchronized ( listener ) { notification.notify( listener ); } }
/** * Suitable for main( String[] args ) * @param flags list of possible flags (e.g -v or -skip-bad). A flag differs from an option in that it * has no value after it. This list of flags is used for distinguishing between the two. * @param args the arguments to parse. */ private Args( Function<String,Option<String>> optionParser, String[] flags, String[] args ) { this.flags = flags; this.args = args; parseArgs( optionParser, args ); }
@Override public String requestURI() { return serverAddress == null ? requestPath : protocol + "://" + format( serverAddress ) + requestPath; }