public final class java.util.Optional<T>
minor version: 0
major version: 59
flags: flags: (0x0031) ACC_PUBLIC, ACC_FINAL, ACC_SUPER
this_class: java.util.Optional
super_class: java.lang.Object
{
private static final java.util.Optional<?> EMPTY;
descriptor: Ljava/util/Optional;
flags: (0x001a) ACC_PRIVATE, ACC_STATIC, ACC_FINAL
Signature: Ljava/util/Optional<*>;
private final T value;
descriptor: Ljava/lang/Object;
flags: (0x0012) ACC_PRIVATE, ACC_FINAL
Signature: TT;
static void <clinit>();
descriptor: ()V
flags: (0x0008) ACC_STATIC
Code:
stack=2, locals=0, args_size=0
0: new java.util.Optional
dup
invokespecial java.util.Optional.<init>:()V
putstatic java.util.Optional.EMPTY:Ljava/util/Optional;
return
LocalVariableTable:
Start End Slot Name Signature
private void <init>();
descriptor: ()V
flags: (0x0002) ACC_PRIVATE
Code:
stack=2, locals=1, args_size=1
start local 0 0: aload 0
invokespecial java.lang.Object.<init>:()V
1: aload 0
aconst_null
putfield java.util.Optional.value:Ljava/lang/Object;
2: return
end local 0 LocalVariableTable:
Start End Slot Name Signature
0 3 0 this Ljava/util/Optional<TT;>;
public static <T> java.util.Optional<T> empty();
descriptor: ()Ljava/util/Optional;
flags: (0x0009) ACC_PUBLIC, ACC_STATIC
Code:
stack=1, locals=1, args_size=0
0: getstatic java.util.Optional.EMPTY:Ljava/util/Optional;
astore 0
start local 0 1: aload 0
areturn
end local 0 LocalVariableTable:
Start End Slot Name Signature
1 2 0 t Ljava/util/Optional<TT;>;
Signature: <T:Ljava/lang/Object;>()Ljava/util/Optional<TT;>;
private void <init>();
descriptor: (Ljava/lang/Object;)V
flags: (0x0002) ACC_PRIVATE
Code:
stack=2, locals=2, args_size=2
start local 0 start local 1 0: aload 0
invokespecial java.lang.Object.<init>:()V
1: aload 0
aload 1
invokestatic java.util.Objects.requireNonNull:(Ljava/lang/Object;)Ljava/lang/Object;
putfield java.util.Optional.value:Ljava/lang/Object;
2: return
end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 3 0 this Ljava/util/Optional<TT;>;
0 3 1 value TT;
Signature: (TT;)V
MethodParameters:
Name Flags
value
public static <T> java.util.Optional<T> of(T);
descriptor: (Ljava/lang/Object;)Ljava/util/Optional;
flags: (0x0009) ACC_PUBLIC, ACC_STATIC
Code:
stack=3, locals=1, args_size=1
start local 0 0: new java.util.Optional
dup
aload 0
invokespecial java.util.Optional.<init>:(Ljava/lang/Object;)V
areturn
end local 0 LocalVariableTable:
Start End Slot Name Signature
0 1 0 value TT;
Signature: <T:Ljava/lang/Object;>(TT;)Ljava/util/Optional<TT;>;
MethodParameters:
Name Flags
value
public static <T> java.util.Optional<T> ofNullable(T);
descriptor: (Ljava/lang/Object;)Ljava/util/Optional;
flags: (0x0009) ACC_PUBLIC, ACC_STATIC
Code:
stack=1, locals=1, args_size=1
start local 0 0: aload 0
ifnonnull 1
invokestatic java.util.Optional.empty:()Ljava/util/Optional;
goto 2
StackMap locals:
StackMap stack:
1: aload 0
invokestatic java.util.Optional.of:(Ljava/lang/Object;)Ljava/util/Optional;
StackMap locals:
StackMap stack: java.util.Optional
2: areturn
end local 0 LocalVariableTable:
Start End Slot Name Signature
0 3 0 value TT;
Signature: <T:Ljava/lang/Object;>(TT;)Ljava/util/Optional<TT;>;
MethodParameters:
Name Flags
value
public T get();
descriptor: ()Ljava/lang/Object;
flags: (0x0001) ACC_PUBLIC
Code:
stack=3, locals=1, args_size=1
start local 0 0: aload 0
getfield java.util.Optional.value:Ljava/lang/Object;
ifnonnull 2
1: new java.util.NoSuchElementException
dup
ldc "No value present"
invokespecial java.util.NoSuchElementException.<init>:(Ljava/lang/String;)V
athrow
2: StackMap locals:
StackMap stack:
aload 0
getfield java.util.Optional.value:Ljava/lang/Object;
areturn
end local 0 LocalVariableTable:
Start End Slot Name Signature
0 3 0 this Ljava/util/Optional<TT;>;
Signature: ()TT;
public boolean isPresent();
descriptor: ()Z
flags: (0x0001) ACC_PUBLIC
Code:
stack=1, locals=1, args_size=1
start local 0 0: aload 0
getfield java.util.Optional.value:Ljava/lang/Object;
ifnull 1
iconst_1
ireturn
StackMap locals:
StackMap stack:
1: iconst_0
ireturn
end local 0 LocalVariableTable:
Start End Slot Name Signature
0 2 0 this Ljava/util/Optional<TT;>;
public boolean isEmpty();
descriptor: ()Z
flags: (0x0001) ACC_PUBLIC
Code:
stack=1, locals=1, args_size=1
start local 0 0: aload 0
getfield java.util.Optional.value:Ljava/lang/Object;
ifnonnull 1
iconst_1
ireturn
StackMap locals:
StackMap stack:
1: iconst_0
ireturn
end local 0 LocalVariableTable:
Start End Slot Name Signature
0 2 0 this Ljava/util/Optional<TT;>;
public void ifPresent(java.util.function.Consumer<? super T>);
descriptor: (Ljava/util/function/Consumer;)V
flags: (0x0001) ACC_PUBLIC
Code:
stack=2, locals=2, args_size=2
start local 0 start local 1 0: aload 0
getfield java.util.Optional.value:Ljava/lang/Object;
ifnull 2
1: aload 1
aload 0
getfield java.util.Optional.value:Ljava/lang/Object;
invokeinterface java.util.function.Consumer.accept:(Ljava/lang/Object;)V
2: StackMap locals:
StackMap stack:
return
end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 3 0 this Ljava/util/Optional<TT;>;
0 3 1 action Ljava/util/function/Consumer<-TT;>;
Signature: (Ljava/util/function/Consumer<-TT;>;)V
MethodParameters:
Name Flags
action
public void ifPresentOrElse(java.util.function.Consumer<? super T>, java.lang.Runnable);
descriptor: (Ljava/util/function/Consumer;Ljava/lang/Runnable;)V
flags: (0x0001) ACC_PUBLIC
Code:
stack=2, locals=3, args_size=3
start local 0 start local 1 start local 2 0: aload 0
getfield java.util.Optional.value:Ljava/lang/Object;
ifnull 3
1: aload 1
aload 0
getfield java.util.Optional.value:Ljava/lang/Object;
invokeinterface java.util.function.Consumer.accept:(Ljava/lang/Object;)V
2: goto 4
3: StackMap locals:
StackMap stack:
aload 2
invokeinterface java.lang.Runnable.run:()V
4: StackMap locals:
StackMap stack:
return
end local 2 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 5 0 this Ljava/util/Optional<TT;>;
0 5 1 action Ljava/util/function/Consumer<-TT;>;
0 5 2 emptyAction Ljava/lang/Runnable;
Signature: (Ljava/util/function/Consumer<-TT;>;Ljava/lang/Runnable;)V
MethodParameters:
Name Flags
action
emptyAction
public java.util.Optional<T> filter(java.util.function.Predicate<? super T>);
descriptor: (Ljava/util/function/Predicate;)Ljava/util/Optional;
flags: (0x0001) ACC_PUBLIC
Code:
stack=2, locals=2, args_size=2
start local 0 start local 1 0: aload 1
invokestatic java.util.Objects.requireNonNull:(Ljava/lang/Object;)Ljava/lang/Object;
pop
1: aload 0
invokevirtual java.util.Optional.isPresent:()Z
ifne 3
2: aload 0
areturn
3: StackMap locals:
StackMap stack:
aload 1
aload 0
getfield java.util.Optional.value:Ljava/lang/Object;
invokeinterface java.util.function.Predicate.test:(Ljava/lang/Object;)Z
ifeq 4
aload 0
goto 5
StackMap locals:
StackMap stack:
4: invokestatic java.util.Optional.empty:()Ljava/util/Optional;
StackMap locals:
StackMap stack: java.util.Optional
5: areturn
end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 6 0 this Ljava/util/Optional<TT;>;
0 6 1 predicate Ljava/util/function/Predicate<-TT;>;
Signature: (Ljava/util/function/Predicate<-TT;>;)Ljava/util/Optional<TT;>;
MethodParameters:
Name Flags
predicate
public <U> java.util.Optional<U> map(java.util.function.Function<? super T, ? extends U>);
descriptor: (Ljava/util/function/Function;)Ljava/util/Optional;
flags: (0x0001) ACC_PUBLIC
Code:
stack=2, locals=2, args_size=2
start local 0 start local 1 0: aload 1
invokestatic java.util.Objects.requireNonNull:(Ljava/lang/Object;)Ljava/lang/Object;
pop
1: aload 0
invokevirtual java.util.Optional.isPresent:()Z
ifne 3
2: invokestatic java.util.Optional.empty:()Ljava/util/Optional;
areturn
3: StackMap locals:
StackMap stack:
aload 1
aload 0
getfield java.util.Optional.value:Ljava/lang/Object;
invokeinterface java.util.function.Function.apply:(Ljava/lang/Object;)Ljava/lang/Object;
invokestatic java.util.Optional.ofNullable:(Ljava/lang/Object;)Ljava/util/Optional;
areturn
end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 4 0 this Ljava/util/Optional<TT;>;
0 4 1 mapper Ljava/util/function/Function<-TT;+TU;>;
Signature: <U:Ljava/lang/Object;>(Ljava/util/function/Function<-TT;+TU;>;)Ljava/util/Optional<TU;>;
MethodParameters:
Name Flags
mapper
public <U> java.util.Optional<U> flatMap(java.util.function.Function<? super T, ? extends java.util.Optional<? extends U>>);
descriptor: (Ljava/util/function/Function;)Ljava/util/Optional;
flags: (0x0001) ACC_PUBLIC
Code:
stack=2, locals=3, args_size=2
start local 0 start local 1 0: aload 1
invokestatic java.util.Objects.requireNonNull:(Ljava/lang/Object;)Ljava/lang/Object;
pop
1: aload 0
invokevirtual java.util.Optional.isPresent:()Z
ifne 3
2: invokestatic java.util.Optional.empty:()Ljava/util/Optional;
areturn
3: StackMap locals:
StackMap stack:
aload 1
aload 0
getfield java.util.Optional.value:Ljava/lang/Object;
invokeinterface java.util.function.Function.apply:(Ljava/lang/Object;)Ljava/lang/Object;
checkcast java.util.Optional
astore 2
start local 2 4: aload 2
invokestatic java.util.Objects.requireNonNull:(Ljava/lang/Object;)Ljava/lang/Object;
checkcast java.util.Optional
areturn
end local 2 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 5 0 this Ljava/util/Optional<TT;>;
0 5 1 mapper Ljava/util/function/Function<-TT;+Ljava/util/Optional<+TU;>;>;
4 5 2 r Ljava/util/Optional<TU;>;
Signature: <U:Ljava/lang/Object;>(Ljava/util/function/Function<-TT;+Ljava/util/Optional<+TU;>;>;)Ljava/util/Optional<TU;>;
MethodParameters:
Name Flags
mapper
public java.util.Optional<T> or(java.util.function.Supplier<? extends java.util.Optional<? extends T>>);
descriptor: (Ljava/util/function/Supplier;)Ljava/util/Optional;
flags: (0x0001) ACC_PUBLIC
Code:
stack=1, locals=3, args_size=2
start local 0 start local 1 0: aload 1
invokestatic java.util.Objects.requireNonNull:(Ljava/lang/Object;)Ljava/lang/Object;
pop
1: aload 0
invokevirtual java.util.Optional.isPresent:()Z
ifeq 3
2: aload 0
areturn
3: StackMap locals:
StackMap stack:
aload 1
invokeinterface java.util.function.Supplier.get:()Ljava/lang/Object;
checkcast java.util.Optional
astore 2
start local 2 4: aload 2
invokestatic java.util.Objects.requireNonNull:(Ljava/lang/Object;)Ljava/lang/Object;
checkcast java.util.Optional
areturn
end local 2 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 5 0 this Ljava/util/Optional<TT;>;
0 5 1 supplier Ljava/util/function/Supplier<+Ljava/util/Optional<+TT;>;>;
4 5 2 r Ljava/util/Optional<TT;>;
Signature: (Ljava/util/function/Supplier<+Ljava/util/Optional<+TT;>;>;)Ljava/util/Optional<TT;>;
MethodParameters:
Name Flags
supplier
public java.util.stream.Stream<T> stream();
descriptor: ()Ljava/util/stream/Stream;
flags: (0x0001) ACC_PUBLIC
Code:
stack=1, locals=1, args_size=1
start local 0 0: aload 0
invokevirtual java.util.Optional.isPresent:()Z
ifne 2
1: invokestatic java.util.stream.Stream.empty:()Ljava/util/stream/Stream;
areturn
2: StackMap locals:
StackMap stack:
aload 0
getfield java.util.Optional.value:Ljava/lang/Object;
invokestatic java.util.stream.Stream.of:(Ljava/lang/Object;)Ljava/util/stream/Stream;
areturn
end local 0 LocalVariableTable:
Start End Slot Name Signature
0 3 0 this Ljava/util/Optional<TT;>;
Signature: ()Ljava/util/stream/Stream<TT;>;
public T orElse();
descriptor: (Ljava/lang/Object;)Ljava/lang/Object;
flags: (0x0001) ACC_PUBLIC
Code:
stack=1, locals=2, args_size=2
start local 0 start local 1 0: aload 0
getfield java.util.Optional.value:Ljava/lang/Object;
ifnull 1
aload 0
getfield java.util.Optional.value:Ljava/lang/Object;
goto 2
StackMap locals:
StackMap stack:
1: aload 1
StackMap locals:
StackMap stack: java.lang.Object
2: areturn
end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 3 0 this Ljava/util/Optional<TT;>;
0 3 1 other TT;
Signature: (TT;)TT;
MethodParameters:
Name Flags
other
public T orElseGet(java.util.function.Supplier<? extends T>);
descriptor: (Ljava/util/function/Supplier;)Ljava/lang/Object;
flags: (0x0001) ACC_PUBLIC
Code:
stack=1, locals=2, args_size=2
start local 0 start local 1 0: aload 0
getfield java.util.Optional.value:Ljava/lang/Object;
ifnull 1
aload 0
getfield java.util.Optional.value:Ljava/lang/Object;
goto 2
StackMap locals:
StackMap stack:
1: aload 1
invokeinterface java.util.function.Supplier.get:()Ljava/lang/Object;
StackMap locals:
StackMap stack: java.lang.Object
2: areturn
end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 3 0 this Ljava/util/Optional<TT;>;
0 3 1 supplier Ljava/util/function/Supplier<+TT;>;
Signature: (Ljava/util/function/Supplier<+TT;>;)TT;
MethodParameters:
Name Flags
supplier
public T orElseThrow();
descriptor: ()Ljava/lang/Object;
flags: (0x0001) ACC_PUBLIC
Code:
stack=3, locals=1, args_size=1
start local 0 0: aload 0
getfield java.util.Optional.value:Ljava/lang/Object;
ifnonnull 2
1: new java.util.NoSuchElementException
dup
ldc "No value present"
invokespecial java.util.NoSuchElementException.<init>:(Ljava/lang/String;)V
athrow
2: StackMap locals:
StackMap stack:
aload 0
getfield java.util.Optional.value:Ljava/lang/Object;
areturn
end local 0 LocalVariableTable:
Start End Slot Name Signature
0 3 0 this Ljava/util/Optional<TT;>;
Signature: ()TT;
public <X extends java.lang.Throwable> T orElseThrow(java.util.function.Supplier<? extends X>) throws X;
descriptor: (Ljava/util/function/Supplier;)Ljava/lang/Object;
flags: (0x0001) ACC_PUBLIC
Code:
stack=1, locals=2, args_size=2
start local 0 start local 1 0: aload 0
getfield java.util.Optional.value:Ljava/lang/Object;
ifnull 2
1: aload 0
getfield java.util.Optional.value:Ljava/lang/Object;
areturn
2: StackMap locals:
StackMap stack:
aload 1
invokeinterface java.util.function.Supplier.get:()Ljava/lang/Object;
checkcast java.lang.Throwable
athrow
end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 3 0 this Ljava/util/Optional<TT;>;
0 3 1 exceptionSupplier Ljava/util/function/Supplier<+TX;>;
Exceptions:
throws java.lang.Throwable
Signature: <X:Ljava/lang/Throwable;>(Ljava/util/function/Supplier<+TX;>;)TT;^TX;
MethodParameters:
Name Flags
exceptionSupplier
public boolean equals(java.lang.Object);
descriptor: (Ljava/lang/Object;)Z
flags: (0x0001) ACC_PUBLIC
Code:
stack=2, locals=3, args_size=2
start local 0 start local 1 0: aload 0
aload 1
if_acmpne 2
1: iconst_1
ireturn
2: StackMap locals:
StackMap stack:
aload 1
instanceof java.util.Optional
ifne 4
3: iconst_0
ireturn
4: StackMap locals:
StackMap stack:
aload 1
checkcast java.util.Optional
astore 2
start local 2 5: aload 0
getfield java.util.Optional.value:Ljava/lang/Object;
aload 2
getfield java.util.Optional.value:Ljava/lang/Object;
invokestatic java.util.Objects.equals:(Ljava/lang/Object;Ljava/lang/Object;)Z
ireturn
end local 2 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 6 0 this Ljava/util/Optional<TT;>;
0 6 1 obj Ljava/lang/Object;
5 6 2 other Ljava/util/Optional<*>;
MethodParameters:
Name Flags
obj
public int hashCode();
descriptor: ()I
flags: (0x0001) ACC_PUBLIC
Code:
stack=1, locals=1, args_size=1
start local 0 0: aload 0
getfield java.util.Optional.value:Ljava/lang/Object;
invokestatic java.util.Objects.hashCode:(Ljava/lang/Object;)I
ireturn
end local 0 LocalVariableTable:
Start End Slot Name Signature
0 1 0 this Ljava/util/Optional<TT;>;
public java.lang.String toString();
descriptor: ()Ljava/lang/String;
flags: (0x0001) ACC_PUBLIC
Code:
stack=5, locals=1, args_size=1
start local 0 0: aload 0
getfield java.util.Optional.value:Ljava/lang/Object;
ifnull 2
1: ldc "Optional[%s]"
iconst_1
anewarray java.lang.Object
dup
iconst_0
aload 0
getfield java.util.Optional.value:Ljava/lang/Object;
aastore
invokestatic java.lang.String.format:(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;
goto 3
2: StackMap locals:
StackMap stack:
ldc "Optional.empty"
3: StackMap locals:
StackMap stack: java.lang.String
areturn
end local 0 LocalVariableTable:
Start End Slot Name Signature
0 4 0 this Ljava/util/Optional<TT;>;
}
Signature: <T:Ljava/lang/Object;>Ljava/lang/Object;
SourceFile: "Optional.java"