-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #266 from ibi-group/feature/OTP-1372-plan-trip-for…
…-others Get dependent's mobility profile
- Loading branch information
Showing
7 changed files
with
217 additions
and
13 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
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
40 changes: 40 additions & 0 deletions
40
src/main/java/org/opentripplanner/middleware/models/MobilityProfileLite.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,40 @@ | ||
package org.opentripplanner.middleware.models; | ||
|
||
import java.util.Objects; | ||
|
||
import static org.apache.commons.lang3.ObjectUtils.isNotEmpty; | ||
|
||
public class MobilityProfileLite { | ||
public String userId; | ||
public String mobilityMode; | ||
public String email; | ||
public String name; | ||
|
||
/** This no-arg constructor exists to make MongoDB happy. */ | ||
public MobilityProfileLite() { | ||
} | ||
|
||
public MobilityProfileLite(OtpUser user) { | ||
this.userId = user.id; | ||
this.mobilityMode = isNotEmpty(user.mobilityProfile) ? user.mobilityProfile.mobilityMode : null; | ||
this.email = user.email; | ||
this.name = user.name; | ||
} | ||
|
||
@Override | ||
public boolean equals(Object o) { | ||
if (this == o) return true; | ||
if (o == null || getClass() != o.getClass()) return false; | ||
MobilityProfileLite that = (MobilityProfileLite) o; | ||
return | ||
Objects.equals(userId, that.userId) && | ||
Objects.equals(mobilityMode, that.mobilityMode) && | ||
Objects.equals(email, that.email) && | ||
Objects.equals(name, that.name); | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
return Objects.hash(userId, mobilityMode, email, name); | ||
} | ||
} |
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