Class SingleSharableData<T>

java.lang.Object
org.mvplugins.multiverse.inventories.profile.data.SingleSharableData<T>
All Implemented Interfaces:
ProfileData

public final class SingleSharableData<T> extends Object implements ProfileData
  • Constructor Details

    • SingleSharableData

      public SingleSharableData(Sharable<T> sharable, T value)
  • Method Details

    • get

      public <S> S get(Sharable<S> sharable)
      Description copied from interface: ProfileData
      Retrieves the profile's value of the Sharable passed in.
      Specified by:
      get in interface ProfileData
      Type Parameters:
      S - 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

      public <S> void set(Sharable<S> sharable, S value)
      Description copied from interface: ProfileData
      Sets the profile's value for the Sharable passed in.
      Specified by:
      set in interface ProfileData
      Type Parameters:
      S - The type of value to be expected.
      Parameters:
      sharable - Represents the key for the data to store.
      value - The value of the data.
    • getData

      public Map<Sharable,Object> getData()
      Specified by:
      getData in interface ProfileData
    • update

      public void update(ProfileData snapshot)
      Description copied from interface: ProfileData
      Updates this profile with the data from another profile data.
      Specified by:
      update in interface ProfileData
      Parameters:
      snapshot - The snapshot data to update from.
    • update

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

      public boolean isEmpty()
      Description copied from interface: ProfileData
      Checks whether this profile contains any data.
      Specified by:
      isEmpty in interface ProfileData
      Returns:
      True if the profile is empty.