Package com.github.skopylov58.functional
Record Class Option.None<T>
java.lang.Object
java.lang.Record
com.github.skopylov58.functional.Option.None<T>
- All Implemented Interfaces:
Monad<T>,MonadAccessor<T>,Option<T>
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.github.skopylov58.functional.Option
Option.None<T>, Option.Some<T> -
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<R> Monad<R>final booleanIndicates whether some other object is "equal to" this one.<R> Option<R>getOrDefault(T defaultValue) final inthashCode()Returns a hash code value for this object.<R> Option<R>optional()stream()toString()Returns a string representation of this record class.
-
Constructor Details
-
None
public None()Creates an instance of aNonerecord class.
-
-
Method Details
-
map
-
flatMap
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
bind
-
getOrDefault
- Specified by:
getOrDefaultin interfaceMonadAccessor<T>
-
stream
- Specified by:
streamin interfaceMonadAccessor<T>
-
optional
- Specified by:
optionalin interfaceMonadAccessor<T>
-
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal.
-