Interface ConfigEntry<T>

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      <R> reactor.core.publisher.Mono<R> accept​(ConfigEntryVisitor<R> visitor)
      Accepts a visitor to visit the concrete type of this config entry.
      String getDisplayName()
      Gets the display name of this entry.
      discord4j.rest.util.Snowflake getGuildId()
      Gets the ID of the guild this config entry is attached to.
      String getKey()
      Gets the unique key of this entry.
      reactor.core.publisher.Mono<T> getValue()
      Gets the current value of this entry.
      boolean isReadOnly()
      Tells whether this entry is read-only.
      reactor.core.publisher.Mono<Void> setValue​(T newValue)
      Sets a new value for this entry.
    • Method Detail

      • getGuildId

        discord4j.rest.util.Snowflake getGuildId()
        Gets the ID of the guild this config entry is attached to.
        Returns:
        the guild ID
      • getDisplayName

        String getDisplayName()
        Gets the display name of this entry.
        Returns:
        the name
      • getKey

        String getKey()
        Gets the unique key of this entry.
        Returns:
        the key
      • getValue

        reactor.core.publisher.Mono<T> getValue()
        Gets the current value of this entry.
        Returns:
        the value
      • setValue

        reactor.core.publisher.Mono<Void> setValue​(@Nullable
                                                   T newValue)
        Sets a new value for this entry. The value is first validated using the validator held by this entry. If validation is successful, the value is set and the returned Mono completes. If the validation fails, the value is not set, and ValidationException is emitted instead.
        Parameters:
        newValue - the new value for this entry, may be null
        Returns:
        a Mono completing when value is validated and set, or ValidationException if validation fails
      • accept

        <R> reactor.core.publisher.Mono<R> accept​(ConfigEntryVisitor<R> visitor)
        Accepts a visitor to visit the concrete type of this config entry.
        Type Parameters:
        R - the return value type of the visitor
        Parameters:
        visitor - the visitor to accept
        Returns:
        a Mono emitting the result of the visit