Interface CachedMetaData

  • All Superinterfaces:
    CachedData

    public interface CachedMetaData
    extends CachedData
    Holds cached meta lookup data for a specific set of contexts.
    • Method Detail

      • getMetaValue

        @Nullable String getMetaValue​(@NonNull String key)
        Gets a value for the given meta key.
        Parameters:
        key - the key
        Returns:
        the value
      • getMetaValue

        default <T> @NonNull Optional<T> getMetaValue​(@NonNull String key,
                                                      @NonNull Function<String,​? extends T> valueTransformer)
        Gets a value for the given meta key, and runs it through the given transformer.

        If no such meta value exists, an empty optional is returned. (the transformer will never be passed a null argument)

        The transformer is allowed to throw IllegalArgumentException or return null. This will also result in an empty optional being returned.

        For example, to parse and return an integer meta value, use:

             getMetaValue("my-int-val", Integer::parseInt).orElse(0);
         
        Type Parameters:
        T - the type of the transformed result
        Parameters:
        key - the key
        valueTransformer - the transformer used to transform the value
        Returns:
        the meta value
        Since:
        5.3
      • getPrefix

        @Nullable String getPrefix()
        Gets the holder's highest priority prefix, or null if the holder has no prefixes
        Returns:
        a prefix string, or null
      • getSuffix

        @Nullable String getSuffix()
        Gets the holder's highest priority suffix, or null if the holder has no suffixes
        Returns:
        a suffix string, or null
      • getPrefixes

        @NonNull @Unmodifiable SortedMap<Integer,​String> getPrefixes()
        Gets an immutable sorted map of all of the prefixes the holder has, whereby the first value is the highest priority prefix.
        Returns:
        a sorted map of prefixes
      • getSuffixes

        @NonNull @Unmodifiable SortedMap<Integer,​String> getSuffixes()
        Gets an immutable sorted map of all of the suffixes the holder has, whereby the first value is the highest priority suffix.
        Returns:
        a sorted map of suffixes
      • getPrimaryGroup

        @Nullable String getPrimaryGroup()
        Gets the name of the holders primary group.

        Will return null for Group holder types.

        Returns:
        the name of the primary group
        Since:
        5.1
      • getPrefixStackDefinition

        @NonNull MetaStackDefinition getPrefixStackDefinition()
        Gets the definition used for the prefix stack
        Returns:
        the definition used for the prefix stack
      • getSuffixStackDefinition

        @NonNull MetaStackDefinition getSuffixStackDefinition()
        Gets the definition used for the suffix stack
        Returns:
        the definition used for the suffix stack