Package org.postgresql.pljava.internal
Class Checked.OptionalBase
- java.lang.Object
-
- org.postgresql.pljava.internal.Checked.OptionalBase
-
- Direct Known Subclasses:
Checked.OptionalBoolean
,Checked.OptionalByte
,Checked.OptionalChar
,Checked.OptionalFloat
,Checked.OptionalShort
public abstract static class Checked.OptionalBase extends Object
Head of a family ofOptional
-like types covering the Java primitives that thejava.util.Optional...
classes do not cover, and whose methods that expect functional interfaces will accept the checked-exception versions declared here.Each
Optional
Foo class here should be treated as if it were a Java "value-based" class; that they might have this class as an ancestor, or any superclass/subclass relationships at all, may change and should not be relied on. It may be convenient toimport static
theofNullable
methods of this class, however, which even cover thejava.util
-supplied primitive optionals.
-
-
Constructor Summary
Constructors Constructor Description OptionalBase()
-
Method Summary
Modifier and Type Method Description boolean
equals(Object obj)
int
hashCode()
boolean
isPresent()
If a value is present, returns true, otherwise false.static Checked.OptionalBoolean
ofNullable(Boolean value)
Return anOptionalBoolean
representing the argument, empty if the argument is null.static Checked.OptionalByte
ofNullable(Byte value)
Return anOptionalByte
representing the argument, empty if the argument is null.static Checked.OptionalChar
ofNullable(Character value)
Return anOptionalChar
representing the argument, empty if the argument is null.static OptionalDouble
ofNullable(Double value)
Return anOptionalDouble
representing the argument, empty if the argument is null.static Checked.OptionalFloat
ofNullable(Float value)
Return anOptionalFloat
representing the argument, empty if the argument is null.static OptionalInt
ofNullable(Integer value)
Return anOptionalInt
representing the argument, empty if the argument is null.static OptionalLong
ofNullable(Long value)
Return anOptionalLong
representing the argument, empty if the argument is null.static Checked.OptionalShort
ofNullable(Short value)
Return anOptionalShort
representing the argument, empty if the argument is null.String
toString()
-
-
-
Method Detail
-
isPresent
public boolean isPresent()
If a value is present, returns true, otherwise false.
-
ofNullable
public static OptionalDouble ofNullable(Double value)
Return anOptionalDouble
representing the argument, empty if the argument is null.
-
ofNullable
public static OptionalInt ofNullable(Integer value)
Return anOptionalInt
representing the argument, empty if the argument is null.
-
ofNullable
public static OptionalLong ofNullable(Long value)
Return anOptionalLong
representing the argument, empty if the argument is null.
-
ofNullable
public static Checked.OptionalBoolean ofNullable(Boolean value)
Return anOptionalBoolean
representing the argument, empty if the argument is null.
-
ofNullable
public static Checked.OptionalByte ofNullable(Byte value)
Return anOptionalByte
representing the argument, empty if the argument is null.
-
ofNullable
public static Checked.OptionalShort ofNullable(Short value)
Return anOptionalShort
representing the argument, empty if the argument is null.
-
ofNullable
public static Checked.OptionalChar ofNullable(Character value)
Return anOptionalChar
representing the argument, empty if the argument is null.
-
ofNullable
public static Checked.OptionalFloat ofNullable(Float value)
Return anOptionalFloat
representing the argument, empty if the argument is null.
-
-