Package 

Class DefaultExtras

  • All Implemented Interfaces:
    com.patrykandpatrick.vico.core.context.Extras

    
    public final class DefaultExtras
     implements Extras
                        

    The default implementation of Extras.

    • Constructor Summary

      Constructors 
      Constructor Description
      DefaultExtras()
    • Method Summary

      Modifier and Type Method Description
      Unit putExtra(Object key, Object value) Saves an extra.
      Boolean hasExtra(Object key) Checks whether an extra with the given key exists.
      <T extends Any> T getExtra(Object key) Retrieves the value of the extra with the given key, unless no such extra exists.
      <T extends Any> T consumeExtra(Object key) Retrieves the value of the extra with the given key, unless no such extra exists.
      Unit clearExtras() Removes all stored extras.
      • Methods inherited from class com.patrykandpatrick.vico.core.context.DefaultExtras

        get, set
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DefaultExtras

        DefaultExtras()
    • Method Detail

      • putExtra

         Unit putExtra(Object key, Object value)

        Saves an extra.

        Parameters:
        key - the extra’s unique identifier.
        value - the extra’s value.
      • getExtra

         <T extends Any> T getExtra(Object key)

        Retrieves the value of the extra with the given key, unless no such extra exists.

      • consumeExtra

         <T extends Any> T consumeExtra(Object key)

        Retrieves the value of the extra with the given key, unless no such extra exists. Once the value of the extra is retrieved, the extra is removed. Use getExtra to prevent the extra from being removed.