-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Take NeTEx hierarchy into account when mapping lots
- Loading branch information
1 parent
c6ae01a
commit acaa41f
Showing
8 changed files
with
83 additions
and
25 deletions.
There are no files selected for viewing
21 changes: 21 additions & 0 deletions
21
src/main/java/org/opentripplanner/inspector/vector/KeyValue.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,28 @@ | ||
package org.opentripplanner.inspector.vector; | ||
|
||
import java.util.Collection; | ||
import java.util.stream.Collectors; | ||
import org.opentripplanner.transit.model.framework.FeedScopedId; | ||
|
||
public record KeyValue(String key, Object value) { | ||
public static KeyValue kv(String key, Object value) { | ||
return new KeyValue(key, value); | ||
} | ||
public static KeyValue kv(String key, FeedScopedId value) { | ||
if(value !=null){ | ||
return new KeyValue(key, value.toString()); | ||
} | ||
else { | ||
return new KeyValue(key, null); | ||
} | ||
} | ||
|
||
/** | ||
* Takes a key and a collection of values, calls toString on the values and joins them using | ||
* comma as the separator. | ||
*/ | ||
public static KeyValue kColl(String key, Collection<?> value) { | ||
var values = value.stream().map(Object::toString).collect(Collectors.joining(",")); | ||
return new KeyValue(key, values); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters