EMEmvOptional
Objective-C
@interface EMEmvOptional<__covariant ObjectType> : NSObject
Swift
class EMEmvOptional<ObjectType> : NSObject where ObjectType : AnyObject
EMEmvOptional.
Since
5.0-
Constructs an instance with the described value.
Since
5.0Declaration
Objective-C
+ (instancetype)optional; -
Returns an
EMEmvOptionaldescribing the given value, if non-null, otherwise returns an emptyEMEmvOptional.Declaration
Objective-C
+ (instancetype)optionalOf:(ObjectType)aValue;Swift
convenience init!(of aValue: ObjectType!)Parameters
aValuethe possibly-
nullvalue to describeReturn Value
an
EMEmvOptionalwith a present value if the specified value is non-null, otherwise an emptyEMEmvOptional -
Returns an
EMEmvOptionaldescribing the given value, if non-null, otherwise returns an emptyEMEmvOptional.Declaration
Objective-C
+ (instancetype)optionalOfNullable:(ObjectType)aValue;Swift
convenience init!(ofNullable aValue: ObjectType!)Parameters
aValuethe possibly-
nullvalue to describeReturn Value
an
EMEmvOptionalwith a present value if the specified value is non-null, otherwise an emptyEMEmvOptional -
Returns the value if present, otherwise throws
NSInternalInconsistencyException.See
EMEmvOptional#isPresent()Declaration
Objective-C
- (ObjectType)get;Swift
func get() -> ObjectType!Return Value
the non-
nullvalue described by thisEMEmvOptional@throws NSInternalInconsistencyException if no value is present -
Returns
YESif present, otherwiseNO.Declaration
Objective-C
- (BOOL)isPresent;Swift
func isPresent() -> Bool -
Returns the value if present, otherwise returns
ObjectType.Declaration
Objective-C
- (ObjectType)orElse:(ObjectType)anOther;Swift
func orElse(_ anOther: ObjectType!) -> ObjectType!Parameters
anOtherthe value to be returned, if no value is present. May be
null.Return Value
the value, if present, otherwise
ObjectType
EMEmvOptional Class Reference