Class AccessLog

java.lang.Object
net.commuty.parking.model.AccessLog

public class AccessLog
extends java.lang.Object

This corresponds to a user that entered or exited a parking site at a point in time.

You can construct this entity using the createInAccessLog(UserId, LocalDateTime) or createOutAccessLog(UserId, LocalDateTime) methods, depending on the type of access log you want to report.

  • Method Summary

    Modifier and Type Method Description
    static AccessLog createInAccessLog​(UserId userId, java.time.LocalDateTime at)
    Create a report for a user that entered the parking site at the specified time.
    static AccessLog createOutAccessLog​(UserId userId, java.time.LocalDateTime at)
    Create a report for a user that exited the parking site at the specified time.
    java.time.LocalDateTime getAt()
    The moment when the user entered/exited the parking site.
    java.lang.String getUserId()
    The identifier of the user.
    UserIdType getUserIdType()
    The UserIdType of the identifier of the user.
    AccessDirection getWay()
    The direction (either AccessDirection.IN or AccessDirection.OUT) of the user entering/exiting the parking site.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • createInAccessLog

      public static AccessLog createInAccessLog​(UserId userId, java.time.LocalDateTime at)
      Create a report for a user that entered the parking site at the specified time.
      Parameters:
      userId - The UserId concerned by the access log. Cannot be null.
      at - The moment when the user entered the parking site, in UTC. Cannot be null.
      Returns:
      the AccessLog entity.
    • createOutAccessLog

      public static AccessLog createOutAccessLog​(UserId userId, java.time.LocalDateTime at)
      Create a report for a user that exited the parking site at the specified time.
      Parameters:
      userId - The UserId concerned by the access log. Cannot be null.
      at - The moment when the user exited the parking site, in UTC. Cannot be null.
      Returns:
      the AccessLog entity.
    • getUserId

      public java.lang.String getUserId()
      The identifier of the user. This is linked with the getUserIdType() property.
    • getUserIdType

      public UserIdType getUserIdType()
      The UserIdType of the identifier of the user. This is linked with the getUserId() property.
    • getWay

      public AccessDirection getWay()
      The direction (either AccessDirection.IN or AccessDirection.OUT) of the user entering/exiting the parking site.
    • getAt

      public java.time.LocalDateTime getAt()
      The moment when the user entered/exited the parking site.