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
Head of a family of
Optional
-like types
covering the Java primitives that the java.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 to
import static
the ofNullable
methods of this class,
however, which even cover the java.util
-supplied primitive
optionals.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
int
hashCode()
boolean
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.toString()
-
Constructor Details
-
OptionalBase
public OptionalBase()
-
-
Method Details
-
isPresent
public boolean isPresent()If a value is present, returns true, otherwise false. -
equals
-
hashCode
public int hashCode() -
toString
-
ofNullable
Return anOptionalDouble
representing the argument, empty if the argument is null. -
ofNullable
Return anOptionalInt
representing the argument, empty if the argument is null. -
ofNullable
Return anOptionalLong
representing the argument, empty if the argument is null. -
ofNullable
Return anOptionalBoolean
representing the argument, empty if the argument is null. -
ofNullable
Return anOptionalByte
representing the argument, empty if the argument is null. -
ofNullable
Return anOptionalShort
representing the argument, empty if the argument is null. -
ofNullable
Return anOptionalChar
representing the argument, empty if the argument is null. -
ofNullable
Return anOptionalFloat
representing the argument, empty if the argument is null.
-