/** * Alias of {@link #pair(Object, Object)}. * @param first the first object in the pair. * @param other the other object in the pair. * @param <T1> the type of the first object in the pair * @param <T2> the type of the second object in the pair * @return a new pair of the two parameters. */ public static <T1, T2> Pair<T1, T2> of( final T1 first, final T2 other ) { return pair( first, other ); }
private Map<String,Object> toNeo4jValue( Map<?,?> attributeValue ) { // Build a new map with the same keys, but each value passed // through `toNeo4jValue` return attributeValue.entrySet().stream() .map( e -> pair( e.getKey().toString(), toNeo4jValue( e.getValue() ) ) ) .collect( CollectorsUtil.pairsToMap() ); }
private static Map<String, String> parseConfigOverrides( Args arguments ) { Collection<Pair<String, String>> options = arguments.interpretOptions( "c", Converters.optional(), s -> { if ( s.contains( "=" ) ) { String[] keyVal = s.split( "=", 2 ); return pair( keyVal[0], keyVal[1] ); } // Shortcut to specify boolean flags ("-c dbms.enableTheFeature") return pair( s, "true" ); } ); Map<String,String> ret = stringMap(); options.forEach( pair -> ret.put( pair.first(), pair.other() ) ); return ret; }
private Map<Path, Description> describeRecursively( Path directory ) throws IOException { return Files.walk( directory ) .map( path -> pair( directory.relativize( path ), describe( path ) ) ) .collect( HashMap::new, ( pathDescriptionHashMap, pathDescriptionPair ) -> pathDescriptionHashMap.put( pathDescriptionPair.first(), pathDescriptionPair.other() ), HashMap::putAll ); }
pair( // change from CET to CEST - second time of day after first datetime( date( 2017, 3, 20 ), localTime( 13, 37, 0, 0 ), ZoneId.of( "Europe/Stockholm" ) ), datetime( date( 2017, 3, 26 ), localTime( 19, 40, 0, 0 ), ZoneId.of( "Europe/Stockholm" ) ) ), pair( // change from CET to CEST - second time of day before first datetime( date( 2017, 3, 20 ), localTime( 13, 37, 0, 0 ), ZoneId.of( "Europe/Stockholm" ) ), datetime( date( 2017, 3, 26 ), localTime( 11, 40, 0, 0 ), ZoneId.of( "Europe/Stockholm" ) ) ), pair( // change from CEST to CET - second time of day after first datetime( date( 2017, 10, 20 ), localTime( 13, 37, 0, 0 ), ZoneId.of( "Europe/Stockholm" ) ), datetime( date( 2017, 10, 29 ), localTime( 19, 40, 0, 0 ), ZoneId.of( "Europe/Stockholm" ) ) ), pair( // change from CEST to CET - second time of day before first datetime( date( 2017, 10, 20 ), localTime( 13, 37, 0, 0 ), ZoneId.of( "Europe/Stockholm" ) ), datetime( date( 2017, 10, 29 ), localTime( 11, 40, 0, 0 ), ZoneId.of( "Europe/Stockholm" ) ) ),
/** * Alias of {@link #pair(Object, Object)}. * @param first the first object in the pair. * @param other the other object in the pair. * @param <T1> the type of the first object in the pair * @param <T2> the type of the second object in the pair * @return a new pair of the two parameters. */ public static <T1, T2> Pair<T1, T2> of( final T1 first, final T2 other ) { return pair( first, other ); }
private Map<String,Object> toNeo4jValue( Map<?,?> attributeValue ) { // Build a new map with the same keys, but each value passed // through `toNeo4jValue` return attributeValue.entrySet().stream() .map( e -> pair( e.getKey().toString(), toNeo4jValue( e.getValue() ) ) ) .collect( CollectorsUtil.pairsToMap() ); }
private static Map<String, String> parseConfigOverrides( Args arguments ) { Collection<Pair<String, String>> options = arguments.interpretOptions( "c", Converters.optional(), s -> { if ( s.contains( "=" ) ) { String[] keyVal = s.split( "=", 2 ); return pair( keyVal[0], keyVal[1] ); } // Shortcut to specify boolean flags ("-c dbms.enableTheFeature") return pair( s, "true" ); } ); Map<String,String> ret = stringMap(); options.forEach( pair -> ret.put( pair.first(), pair.other() ) ); return ret; }