Interface Specializable<S>

    • Method Detail

      • as

        default <T extends SOptional<T> as​(Class<T> type)
        Get this instance as a desired subtype.

        If the instance is not castable to the specified type, the Optional will be empty.

        Type Parameters:
        T - The desired type.
        type - The type as which to obtain this instance.
        Returns an Optional of this instance if it could be cast, otherwise an empty result.
        NullPointerException - If the type is null.