Class TripApi


  • public class TripApi
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Constructor Description
      TripApi()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static Result<Trip> annotate​(android.content.Context context, Trip trip, java.lang.String purpose, java.lang.String[] reasons, java.lang.String metadata, boolean validation)
      Annotate the trip with a purpose, metadata and the validation
      static Result<Trip> setMetadata​(android.content.Context context, Trip trip, java.lang.String metadata)
      Set the metadata for the trip
      static Result<Trip> setPurpose​(android.content.Context context, Trip trip, java.lang.String purpose)
      Set the purpose for the trip
      static Result<Trip> setReasons​(android.content.Context context, Trip trip, java.lang.String[] reasons)
      Set the reasons for the trip
      static Result<Trip> validateTrip​(android.content.Context context, Trip trip, boolean validation)
      Set the validation for the trip
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • TripApi

        public TripApi()
    • Method Detail

      • setMetadata

        public static Result<Trip> setMetadata​(@NonNull
                                               android.content.Context context,
                                               Trip trip,
                                               java.lang.String metadata)
        Set the metadata for the trip
        Parameters:
        context - the context
        trip - the trip
        metadata - the metadata
        Returns:
        the trip with the set metadata
      • validateTrip

        public static Result<Trip> validateTrip​(@NonNull
                                                android.content.Context context,
                                                Trip trip,
                                                boolean validation)
        Set the validation for the trip
        Parameters:
        context - the context
        trip - the trip
        validation - the validation flag
        Returns:
        the validated trip
      • setPurpose

        public static Result<Trip> setPurpose​(@NonNull
                                              android.content.Context context,
                                              Trip trip,
                                              java.lang.String purpose)
        Set the purpose for the trip
        Parameters:
        context - the context
        trip - the trip
        purpose - the purpose
      • setReasons

        public static Result<Trip> setReasons​(@NonNull
                                              android.content.Context context,
                                              Trip trip,
                                              java.lang.String[] reasons)
        Set the reasons for the trip
        Parameters:
        context - the context
        trip - the trip
        reasons - the reasoning for this trip
      • annotate

        public static Result<Trip> annotate​(@NonNull
                                            android.content.Context context,
                                            Trip trip,
                                            java.lang.String purpose,
                                            java.lang.String[] reasons,
                                            java.lang.String metadata,
                                            boolean validation)
        Annotate the trip with a purpose, metadata and the validation
        Parameters:
        context - the context
        trip - the trip
        purpose - the purpose
        reasons - the reasons
        metadata - the metadata
        validation - the validation flag
        Returns:
        the annotated trip