Class Resource<T extends Resource<T>>

    • Constructor Detail

      • Resource

        protected Resource​(String name,
                           double value)
    • Method Detail

      • merge

        public T merge​(T other)
      • subtract

        public T subtract​(T other)
      • multiply

        public T multiply​(BigDecimal multiplier)
      • multiply

        public T multiply​(int multiplier)
      • divide

        public T divide​(int by)
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • getName

        public String getName()
      • isZero

        public boolean isZero()
      • create

        protected abstract T create​(BigDecimal value)
        Create a new instance of the sub resource.
        Parameters:
        value - The value of the resource
        Returns:
        A new instance of the sub resource