Interface ProfileData

All Known Implementing Classes:
PlayerProfile, ProfileDataSnapshot, SingleSharableData

public interface ProfileData
  • Method Summary

    Modifier and Type
    Method
    Description
    Gets an immutable empty profile data constant.
    <T> T
    get(Sharable<T> sharable)
    Retrieves the profile's value of the Sharable passed in.
     
    boolean
    Checks whether this profile contains any data.
    <T> void
    set(Sharable<T> sharable, T value)
    Sets the profile's value for the Sharable passed in.
    void
    update(ProfileData snapshot)
    Updates this profile with the data from another profile data.
    void
    update(ProfileData snapshot, Shares shares)
    Updates this profile with the data from another profile data for a specific set of Sharables.
  • Method Details

    • empty

      static ProfileData empty()
      Gets an immutable empty profile data constant.
      Returns:
      An empty profile data.
    • get

      <T> T get(Sharable<T> sharable)
      Retrieves the profile's value of the Sharable passed in.
      Type Parameters:
      T - This indicates the type of return value to be expected.
      Parameters:
      sharable - Represents the key for the data wanted from the profile.
      Returns:
      The value of the sharable for this profile. Null if no value is set.
    • set

      <T> void set(Sharable<T> sharable, T value)
      Sets the profile's value for the Sharable passed in.
      Type Parameters:
      T - The type of value to be expected.
      Parameters:
      sharable - Represents the key for the data to store.
      value - The value of the data.
    • getData

      Map<Sharable,Object> getData()
    • update

      void update(ProfileData snapshot)
      Updates this profile with the data from another profile data.
      Parameters:
      snapshot - The snapshot data to update from.
    • update

      void update(ProfileData snapshot, Shares shares)
      Updates this profile with the data from another profile data for a specific set of Sharables.
      Parameters:
      snapshot - The snapshot data to update from.
      shares - The set of Sharables to update.
    • isEmpty

      boolean isEmpty()
      Checks whether this profile contains any data.
      Returns:
      True if the profile is empty.