Module watamebot

Interface Property<L,M extends PropertyMapping>

All Superinterfaces:
ImmutableProperty<L,M>
All Known Subinterfaces:
LCKProperty, PluginProperty

public interface Property<L,M extends PropertyMapping> extends ImmutableProperty<L,M>
  • Method Summary

    Modifier and Type
    Method
    Description
    default void
    checkUserInput(boolean user)
    Method checks if this property is allowed to be modified by the user.
    default boolean
    Check if this property can be modified by user input.
    boolean
    remove(L lookup, boolean isUserInput)
    Remove this property from the configuration
    static byte[]
    serialize(@NotNull PropertyInfo info, @NotNull Serializable obj)
    Serialize a object into a byte array.
    default boolean
    set(L lookup, byte[] data, boolean isUserInput)
    Set an array of bytes in the configuration
    boolean
    set(L lookup, @NotNull InputStream in, boolean isUserInput)
    Set a property inside the configuration with the data read from the specified InputStream.
    default boolean
    set(L lookup, @NotNull Serializable obj, boolean isUserInput)
    Set a Serializable object in the configuration.

    Methods inherited from interface net.foxgenesis.property.ImmutableProperty

    get, get, get, getInfo, getOr, isPresent
  • Method Details

    • set

      default boolean set(@NotNull L lookup, @NotNull @NotNull Serializable obj, boolean isUserInput)
      Set a Serializable object in the configuration.
      Parameters:
      lookup - - property lookup
      obj - - object to store
      isUserInput - - if this call is by the user
      Returns:
      Returns true if the object was stored, false otherwise
    • set

      default boolean set(@NotNull L lookup, byte[] data, boolean isUserInput)
      Set an array of bytes in the configuration
      Parameters:
      lookup - - property lookup
      data - - array of data to store
      isUserInput - - if this call is by the user
      Returns:
      Returns true if the data was stored, false otherwise
    • set

      boolean set(@NotNull L lookup, @NotNull @NotNull InputStream in, boolean isUserInput)
      Set a property inside the configuration with the data read from the specified InputStream.
      Parameters:
      lookup - - property lookup
      in - - stream of data
      isUserInput - - if this call is by the user
      Returns:
      Returns true if the data was stored, false otherwise
    • remove

      boolean remove(@NotNull L lookup, boolean isUserInput)
      Remove this property from the configuration
      Parameters:
      lookup - - property lookup
      isUserInput - - if this call is by the user
      Returns:
      Returns true if the property with the specified lookup was removed from the configuration
    • isUserModifiable

      default boolean isUserModifiable()
      Check if this property can be modified by user input.
      Returns:
      Returns true if the user is allowed to modify this property. false otherwise
    • checkUserInput

      default void checkUserInput(boolean user)
      Method checks if this property is allowed to be modified by the user. If user is true and isUserModifiable() is false, this method will throw a UnmodifiablePropertyException to stop further execution.
      Parameters:
      user - - if this call is from the user
      Throws:
      UnmodifiablePropertyException - Thrown if user is true and isUserModifiable() is false
    • serialize

      static byte[] serialize(@NotNull @NotNull PropertyInfo info, @NotNull @NotNull Serializable obj)
      Serialize a object into a byte array.
      Parameters:
      info - - property information
      obj - - object to serialize
      Returns:
      Returns the serialized data