Class Try.Success<T>

  • Type Parameters:
    T - component type of this Success
    All Implemented Interfaces:
    Iterable<T>, Value<T>, java.io.Serializable, java.lang.Iterable<T>
    Enclosing class:
    Try<T>

    @Deprecated
    public static final class Try.Success<T>
    extends Try<T>
    implements java.io.Serializable
    Deprecated.
    will be removed from the public API
    A succeeded Try.
    See Also:
    Serialized Form
    • Method Detail

      • get

        public T get()
        Deprecated.
        Description copied from class: Try
        Gets the result of this Try if this is a Success or throws if this is a Failure.

        IMPORTANT! If this is a Try.Failure, the underlying cause of type Throwable is thrown.

        The thrown exception is exactly the same as the result of Try.getCause().

        Specified by:
        get in interface Value<T>
        Specified by:
        get in class Try<T>
        Returns:
        The result of this Try.
      • getCause

        public java.lang.Throwable getCause()
        Deprecated.
        Description copied from class: Try
        Gets the cause if this is a Failure or throws if this is a Success.
        Specified by:
        getCause in class Try<T>
        Returns:
        The cause if this is a Failure
      • isEmpty

        public boolean isEmpty()
        Deprecated.
        Description copied from class: Try
        Checks whether this Try has no result, i.e. is a Failure.
        Specified by:
        isEmpty in interface Value<T>
        Specified by:
        isEmpty in class Try<T>
        Returns:
        true if this is a Failure, returns false if this is a Success.
      • isFailure

        public boolean isFailure()
        Deprecated.
        Description copied from class: Try
        Checks if this is a Failure.
        Specified by:
        isFailure in class Try<T>
        Returns:
        true, if this is a Failure, otherwise false, if this is a Success
      • isSuccess

        public boolean isSuccess()
        Deprecated.
        Description copied from class: Try
        Checks if this is a Success.
        Specified by:
        isSuccess in class Try<T>
        Returns:
        true, if this is a Success, otherwise false, if this is a Failure
      • equals

        public boolean equals​(java.lang.Object obj)
        Deprecated.
        Description copied from interface: Value
        Clarifies that values have a proper equals() method implemented.

        See Object.equals(Object).

        Specified by:
        equals in interface Value<T>
        Overrides:
        equals in class java.lang.Object
        Parameters:
        obj - An object
        Returns:
        true, if this equals o, false otherwise
      • hashCode

        public int hashCode()
        Deprecated.
        Description copied from interface: Value
        Clarifies that values have a proper hashCode() method implemented.

        See Object.hashCode().

        Specified by:
        hashCode in interface Value<T>
        Overrides:
        hashCode in class java.lang.Object
        Returns:
        The hashcode of this object
      • stringPrefix

        public java.lang.String stringPrefix()
        Deprecated.
        Description copied from interface: Value
        Returns the name of this Value type, which is used by toString().
        Specified by:
        stringPrefix in interface Value<T>
        Returns:
        This type name.
      • toString

        public java.lang.String toString()
        Deprecated.
        Description copied from interface: Value
        Clarifies that values have a proper toString() method implemented.

        See Object.toString().

        Specified by:
        toString in interface Value<T>
        Overrides:
        toString in class java.lang.Object
        Returns:
        A String representation of this object