Class BtGenericEventAttribute<T>

  • Type Parameters:
    T - type of event data. See also BtConnectionEvent BtBondStateEvent etc.,
    All Implemented Interfaces:
    android.os.Parcelable

    public class BtGenericEventAttribute<T>
    extends BtEventAttribute
    Generic class template for any type of event data that shall be provided to clients
    • Nested Class Summary

      • Nested classes/interfaces inherited from interface android.os.Parcelable

        android.os.Parcelable.ClassLoaderCreator<T extends java.lang.Object>, android.os.Parcelable.Creator<T extends java.lang.Object>
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private T data  
      • Fields inherited from interface android.os.Parcelable

        CONTENTS_FILE_DESCRIPTOR, PARCELABLE_WRITE_RETURN_VALUE
    • Constructor Summary

      Constructors 
      Constructor Description
      BtGenericEventAttribute​(android.os.Parcel source)
      Constructor accepts Parcel object as parameter
      BtGenericEventAttribute​(T _data)
      Constructor accepts T object as parameter
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int describeContents()  
      boolean isValid()
      Check if the data is valid to use or not
      T toEvent()
      Get the type of data object which contain event specific information
      void writeToParcel​(android.os.Parcel dest, int flags)  
      • Methods inherited from class java.lang.Object

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

      • data

        private T data
    • Constructor Detail

      • BtGenericEventAttribute

        public BtGenericEventAttribute​(@NonNull
                                       T _data)
        Constructor accepts T object as parameter
        Parameters:
        _data - T : Event type class object can be passed. See BtBondStateEvent BtConnectionEvent
      • BtGenericEventAttribute

        public BtGenericEventAttribute​(@NonNull
                                       android.os.Parcel source)
        Constructor accepts Parcel object as parameter
        Parameters:
        source - Parcel : Parcel object is passed
    • Method Detail

      • describeContents

        public int describeContents()
      • toEvent

        public T toEvent()
        Get the type of data object which contain event specific information
        Returns:
        reference to T type object
      • isValid

        public boolean isValid()
        Check if the data is valid to use or not
        Returns:
        true, if the data is valid. false otherwise.
      • writeToParcel

        public void writeToParcel​(android.os.Parcel dest,
                                  int flags)