Package cs2030s.fp

Class Actually.Success<T>

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private T value  
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private Success​(T value)  
    • Field Detail

      • value

        private final T value
    • Constructor Detail

      • Success

        private Success​(T value)
    • Method Detail

      • unless

        public <U extends TT unless​(U other)
        Specified by:
        unless in class Actually<T>
      • transform

        public <R> Actually<R> transform​(Immutator<? extends R,​? super T> immutator)
        Description copied from interface: Immutatorable
        The method to produce another container with immutated element.
        Type Parameters:
        R - the return type
        Parameters:
        immutator - The immutator.
        Returns:
        A new container containing the immutated element.
      • act

        public void act​(Action<? super T> action)
        Description copied from interface: Actionable
        The method to act on its content.
        Parameters:
        action - The action.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object