Class StringData

java.lang.Object
xyz.srnyx.javautilities.parents.Stringable
xyz.srnyx.annoyingapi.data.Data<String>
xyz.srnyx.annoyingapi.data.StringData
All Implemented Interfaces:
Annoyable
Direct Known Subclasses:
EntityData

public class StringData extends Data<String>
A data class for storing and retrieving string data from SQL databases
  • Field Details

    • TARGET_COLUMN

      @NotNull public static final @NotNull String TARGET_COLUMN
      The primary target column name
      See Also:
    • useCache

      public boolean useCache
      Whether to use the cache for this data
  • Constructor Details

  • Method Details

    • useCache

      @NotNull public @NotNull StringData useCache(@Nullable @Nullable Boolean useCache)
      Whether to use the cache for this data (if caching is enabled in the storage config)
      Defaults to DataOptions.useCacheDefault
      Parameters:
      useCache - the new value or null to use DataOptions.useCacheDefault
      Returns:
      this for chaining
    • get

      @Nullable public @Nullable String get(@NotNull @NotNull String key)
      Description copied from class: Data
      Get the data value for the given key
      Specified by:
      get in class Data<String>
      Parameters:
      key - the key to get the data value for
      Returns:
      the data value, or null if not found
    • set

      protected boolean set(@NotNull @NotNull String key, @NotNull @NotNull String value)
      Description copied from class: Data
      Set the data value for the given key. If the key already exists, it will be overwritten
      Specified by:
      set in class Data<String>
      Parameters:
      key - the key to set the data value for
      value - the data value to set
      Returns:
      true if the data value was set successfully, false otherwise
    • remove

      public boolean remove(@NotNull @NotNull String key)
      Description copied from class: Data
      Remove the data value with the given key
      Specified by:
      remove in class Data<String>
      Parameters:
      key - the key to remove the data value for
      Returns:
      true if the data value was removed successfully, false otherwise