Interface DefaultResourceSpec

All Superinterfaces:
Cloneable, Serializable
All Known Subinterfaces:
UserData

public interface DefaultResourceSpec extends Serializable, Cloneable

DefaultResourceSpec -- .

Since:
1.0.0 2023-01-19
Author:
rlichti <rlichti@kaiserpfalz-edv.de>
  • Method Details

    • getProperty

      default Optional<String> getProperty(String key)
      Returns a property.
      Parameters:
      key - The unique key of the property within the user dataset.
      Returns:
      The property saved with the user.
    • getDefaultProperties

      default String[] getDefaultProperties()
      Returns an array of property names which should be saved by a StoreService implementation. You should really overwrite it when needed.
      Returns:
      the names of the default properties of this resource.
    • getResourcePointer

      default Optional<Pointer> getResourcePointer(String key)
      Reads a resource pointer from a property.
      Parameters:
      key - The name of the property.
      Returns:
      The resource pointer.
      Throws:
      IllegalStateException - If the property can't be converted.
      IllegalArgumentException - If the UUID of the pointer can't be read from the property.
      NoSuchElementException - There is no such property.
    • getResourcePointers

      default List<Pointer> getResourcePointers(String key)
    • convertStringToResourcePointer

      Pointer convertStringToResourcePointer(String property)
    • saveResourcePointer

      default void saveResourcePointer(String key, Pointer pointer)
      Saves a resource pointer as property.
      Parameters:
      key - The name of the property.
      pointer - the pointer to save.
    • convertResourcePointerToString

      default String convertResourcePointerToString(Pointer pointer)
    • saveResourcePointers

      void saveResourcePointers(String key, Collection<Pointer> pointers)
    • getProperties

      Map<String,String> getProperties()