Table of Contents

Class Optional<T>

Namespace
Java.Util
Assembly
MASES.JNet.dll
public class Optional<T> : JVMBridgeBase<Optional<T>>, IDynamicMetaObjectProvider, IJVMBridgeCore, IDisposable, IJVMBridgeBaseStatic, IJVMBridgeBase, IJVMBridgeDefinition

Type Parameters

T
Inheritance
JVMBridgeBase
JVMBridgeBase<Optional<T>>
Optional<T>
Implements
IJVMBridgeCore
IJVMBridgeBaseStatic
IJVMBridgeBase
IJVMBridgeDefinition
Inherited Members
JVMBridgeBase<Optional<T>>.IsAssignableFrom(IJavaType)
JVMBridgeBase<Optional<T>>.IsAssignableFrom<T>()
JVMBridgeBase<Optional<T>>.Execute<T>(params T[])
JVMBridgeBase<Optional<T>>.DynBridgeClazz
JVMBridgeBase<Optional<T>>.BridgeClazz
JVMBridgeBase.RuntimeClassNameOf<T>()
JVMBridgeBase.ClassNameOf<T>()
JVMBridgeBase.ClassOf<T>()
JVMBridgeBase.WrapsDirect<TNewClass>(IJavaObject)
JVMBridgeBase.Wraps<TNewClass>(IJavaObject)
JVMBridgeBase.Wraps<TNewClass, TReturn>(IJavaObject)
JVMBridgeBase.Wraps<TNewClass, TReturn, TConverter>(IJavaObject)
JVMBridgeBase.MonitorEnter()
JVMBridgeBase.MonitorExit()
JVMBridgeBase.IsInstanceOf(IJavaType)
JVMBridgeBase.IsInstanceOf<T>()
JVMBridgeBase.RuntimeIsInstanceOf<T>()
JVMBridgeBase.CastTo<TNewClass>()
JVMBridgeBase.CastDirect<TNewClass>()
JVMBridgeBase.Dispose()
JVMBridgeBase.ToString()
JVMBridgeBase.GetHashCode()
JVMBridgeBase.Notify()
JVMBridgeBase.NotifyAll()
JVMBridgeBase.Wait()
JVMBridgeBase.DynBridgeInstance
JVMBridgeBase.BridgeInstance
JVMBridgeBase.IsBridgeListener
Extension Methods

Constructors

Optional()

Default constructor: even if the corresponding Java class does not have one, it is mandatory for JCOBridge

public Optional()

Optional(params object[])

Generic constructor: it is useful for JCOBridge when there is a derived class which needs to pass arguments to the highest JVMBridgeBase class

public Optional(params object[] args)

Parameters

args object[]

Properties

BridgeClassName

public override string BridgeClassName { get; }

Property Value

string

IsBridgeAbstract

public override bool IsBridgeAbstract { get; }

Property Value

bool

IsBridgeCloseable

public override bool IsBridgeCloseable { get; }

Property Value

bool

IsBridgeInterface

public override bool IsBridgeInterface { get; }

Property Value

bool

IsBridgeStatic

public override bool IsBridgeStatic { get; }

Property Value

bool

Methods

Empty()

public static Optional<T> Empty()

Returns

Optional<T>

Optional

Filter<Arg0objectSuperT>(Predicate<Arg0objectSuperT>)

public Optional<T> Filter<Arg0objectSuperT>(Predicate<Arg0objectSuperT> arg0) where Arg0objectSuperT : T

Parameters

arg0 Predicate<Arg0objectSuperT>

Predicate

Returns

Optional<T>

Optional

Type Parameters

Arg0objectSuperT

T

FlatMap<U, Arg0objectSuperT, Arg0ExtendsJava_Util_Optional_Arg0ExtendsU_, Arg0ExtendsU>(Function<Arg0objectSuperT, Arg0ExtendsJava_Util_Optional_Arg0ExtendsU_>)

public Optional<U> FlatMap<U, Arg0objectSuperT, Arg0ExtendsJava_Util_Optional_Arg0ExtendsU_, Arg0ExtendsU>(Function<Arg0objectSuperT, Arg0ExtendsJava_Util_Optional_Arg0ExtendsU_> arg0) where Arg0objectSuperT : T where Arg0ExtendsJava_Util_Optional_Arg0ExtendsU_ : Optional<Arg0ExtendsU> where Arg0ExtendsU : U

Parameters

arg0 Function<Arg0objectSuperT, Arg0ExtendsJava_Util_Optional_Arg0ExtendsU_>

Function

Returns

Optional<U>

Optional

Type Parameters

U
Arg0objectSuperT

T

Arg0ExtendsJava_Util_Optional_Arg0ExtendsU_

Optional<T>

Arg0ExtendsU

U

Get()

public T Get()

Returns

T

T

IfPresentOrElse<Arg0objectSuperT>(Consumer<Arg0objectSuperT>, Runnable)

public void IfPresentOrElse<Arg0objectSuperT>(Consumer<Arg0objectSuperT> arg0, Runnable arg1) where Arg0objectSuperT : T

Parameters

arg0 Consumer<Arg0objectSuperT>

Consumer

arg1 Runnable

Runnable

Type Parameters

Arg0objectSuperT

T

IfPresent<Arg0objectSuperT>(Consumer<Arg0objectSuperT>)

public void IfPresent<Arg0objectSuperT>(Consumer<Arg0objectSuperT> arg0) where Arg0objectSuperT : T

Parameters

arg0 Consumer<Arg0objectSuperT>

Consumer

Type Parameters

Arg0objectSuperT

T

IsEmpty()

public bool IsEmpty()

Returns

bool

bool

IsPresent()

public bool IsPresent()

Returns

bool

bool

Map<U, Arg0objectSuperT, Arg0ExtendsU>(Function<Arg0objectSuperT, Arg0ExtendsU>)

public Optional<U> Map<U, Arg0objectSuperT, Arg0ExtendsU>(Function<Arg0objectSuperT, Arg0ExtendsU> arg0) where Arg0objectSuperT : T where Arg0ExtendsU : U

Parameters

arg0 Function<Arg0objectSuperT, Arg0ExtendsU>

Function

Returns

Optional<U>

Optional

Type Parameters

U
Arg0objectSuperT

T

Arg0ExtendsU

U

Of(T)

public static Optional<T> Of(T arg0)

Parameters

arg0 T

T

Returns

Optional<T>

Optional

OfNullable(T)

public static Optional<T> OfNullable(T arg0)

Parameters

arg0 T

T

Returns

Optional<T>

Optional

OrElse(T)

public T OrElse(T arg0)

Parameters

arg0 T

T

Returns

T

T

OrElseGet<Arg0ExtendsT>(Supplier<Arg0ExtendsT>)

public T OrElseGet<Arg0ExtendsT>(Supplier<Arg0ExtendsT> arg0) where Arg0ExtendsT : T

Parameters

arg0 Supplier<Arg0ExtendsT>

Supplier

Returns

T

T

Type Parameters

Arg0ExtendsT

T

OrElseThrow()

public T OrElseThrow()

Returns

T

T

OrElseThrow<Arg0ExtendsX, X>(Supplier<Arg0ExtendsX>)

public T OrElseThrow<Arg0ExtendsX, X>(Supplier<Arg0ExtendsX> arg0) where Arg0ExtendsX : X

Parameters

arg0 Supplier<Arg0ExtendsX>

Supplier

Returns

T

T

Type Parameters

Arg0ExtendsX

X

X

Exceptions

Throwable

Or<Arg0ExtendsJava_Util_Optional_Arg0ExtendsT_, Arg0ExtendsT>(Supplier<Arg0ExtendsJava_Util_Optional_Arg0ExtendsT_>)

public Optional<T> Or<Arg0ExtendsJava_Util_Optional_Arg0ExtendsT_, Arg0ExtendsT>(Supplier<Arg0ExtendsJava_Util_Optional_Arg0ExtendsT_> arg0) where Arg0ExtendsJava_Util_Optional_Arg0ExtendsT_ : Optional<Arg0ExtendsT> where Arg0ExtendsT : T

Parameters

arg0 Supplier<Arg0ExtendsJava_Util_Optional_Arg0ExtendsT_>

Supplier

Returns

Optional<T>

Optional

Type Parameters

Arg0ExtendsJava_Util_Optional_Arg0ExtendsT_

Optional<T>

Arg0ExtendsT

T

Stream()

public Stream<T> Stream()

Returns

Stream<T>

Stream

Operators

implicit operator Optional(Optional<T>)

Converter from Optional<T> to Optional

public static implicit operator Optional(Optional<T> t)

Parameters

t Optional<T>

Returns

Optional