Class StringConfigEntry

    • Method Detail

      • accept

        public <R> reactor.core.publisher.Mono<R> accept​(ConfigEntryVisitor<R> visitor)
        Description copied from interface: ConfigEntry
        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
      • builder

        public static <D extends GuildConfigData<D>> ConfigEntryBuilder<D,​String> builder​(String key)
        Creates a builder for this ConfigEntry implementation.
        Type Parameters:
        D - the implementation type of GuildConfigData this entry affects
        Parameters:
        key - the unique key identifying the built entry
        Returns:
        a new builder
      • getGuildId

        public discord4j.common.util.Snowflake getGuildId()
        Description copied from interface: ConfigEntry
        Gets the ID of the guild this config entry is attached to.
        Specified by:
        getGuildId in interface ConfigEntry<T>
        Returns:
        the guild ID
      • getDisplayName

        public String getDisplayName()
        Description copied from interface: ConfigEntry
        Gets the display name of this entry.
        Specified by:
        getDisplayName in interface ConfigEntry<T>
        Returns:
        the name
      • getDescription

        public String getDescription()
        Description copied from interface: ConfigEntry
        Gets the description of this entry.
        Specified by:
        getDescription in interface ConfigEntry<T>
        Returns:
        the description
      • getKey

        public String getKey()
        Description copied from interface: ConfigEntry
        Gets the unique key of this entry.
        Specified by:
        getKey in interface ConfigEntry<T>
        Returns:
        the key
      • getValue

        public reactor.core.publisher.Mono<T> getValue()
        Description copied from interface: ConfigEntry
        Gets the current value of this entry.
        Specified by:
        getValue in interface ConfigEntry<T>
        Returns:
        the value
      • setValue

        public reactor.core.publisher.Mono<Void> setValue​(@Nullable
                                                          T newValue)
        Description copied from interface: ConfigEntry
        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.
        Specified by:
        setValue in interface ConfigEntry<T>
        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