Class ExplainMap

    • Method Detail

      • of

        public static ExplainMap of​(Map<ExplainKey<?>,​Object> map)
        Creates an instance from a populated map.
        Parameters:
        map - the map
        Returns:
        the explanatory map
      • empty

        public static ExplainMap empty()
        Creates an instance with no entries.
        Returns:
        the explanatory map
      • builder

        public static ExplainMapBuilder builder()
        Returns a builder for creating the map.
        Returns:
        the builder
      • get

        public <R> Optional<R> get​(ExplainKey<R> key)
        Gets a value by key.
        Type Parameters:
        R - the type of the key
        Parameters:
        key - the key to lookup
        Returns:
        the value associated with the key
      • explanationString

        public String explanationString()
        Gets the explanation as a string.

        This returns a multi-line string containing the string form of the entries.

        Returns:
        the explanation as a string
      • convertedTo

        public ExplainMap convertedTo​(Currency resultCurrency,
                                      FxRateProvider rateProvider)
        Description copied from interface: FxConvertible
        Converts this instance to an equivalent amount in the specified currency.

        The result, which may be of a different type, will be expressed in terms of the given currency. Any FX conversion that is required will use rates from the provider.

        Specified by:
        convertedTo in interface FxConvertible<ExplainMap>
        Parameters:
        resultCurrency - the currency of the result
        rateProvider - the provider of FX rates
        Returns:
        the converted instance, which should be expressed in the specified currency
      • isEmpty

        public boolean isEmpty()
        Returns whether the explanatory map contains no entries.
        Returns:
        true if no entries are present in the map, false otherwise
      • meta

        public static ExplainMap.Meta meta()
        The meta-bean for ExplainMap.
        Returns:
        the meta-bean, not null
      • metaBean

        public ExplainMap.Meta metaBean()
        Specified by:
        metaBean in interface org.joda.beans.Bean
      • getMap

        public ImmutableMap<ExplainKey<?>,​Object> getMap()
        Gets the map of explanatory values.
        Returns:
        the value of the property, not null
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object