-
Notifications
You must be signed in to change notification settings - Fork 101
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: changes + added documentation to features (#1844)
- Loading branch information
Showing
6 changed files
with
108 additions
and
50 deletions.
There are no files selected for viewing
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
38 changes: 38 additions & 0 deletions
38
main/src/main/java/org/mobilitydata/gtfsvalidator/report/model/FeatureMetadata.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 |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package org.mobilitydata.gtfsvalidator.report.model; | ||
|
||
import java.util.Objects; | ||
|
||
public class FeatureMetadata { | ||
private final String featureName; | ||
private final String featureGroup; | ||
private static final String BASE_DOC_URL = "https://gtfs.org/getting_started/features/"; | ||
|
||
public FeatureMetadata(String featureName, String featureGroup) { | ||
this.featureName = featureName; | ||
this.featureGroup = featureGroup != null ? featureGroup : "base_add-ons"; | ||
} | ||
|
||
public String getFeatureName() { | ||
return featureName; | ||
} | ||
|
||
public String getDocUrl() { | ||
String formattedFeatureName = featureName.toLowerCase().replace(' ', '-'); | ||
String formattedFeatureGroup = featureGroup.toLowerCase().replace(' ', '_'); | ||
return BASE_DOC_URL + formattedFeatureGroup + "/#" + formattedFeatureName; | ||
} | ||
|
||
// Override equals and hashCode to use featureName as key | ||
@Override | ||
public boolean equals(Object o) { | ||
if (this == o) return true; | ||
if (o == null || getClass() != o.getClass()) return false; | ||
FeatureMetadata that = (FeatureMetadata) o; | ||
return Objects.equals(featureName, that.featureName); | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
return Objects.hash(featureName); | ||
} | ||
} |
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