setOrOption method

  1. @override
Option<T> setOrOption(
  1. T value
)
override

Sets the contents of the cell to value. Returns a None if the value is already set. Otherwise returns Some of the input value.

Implementation

@override
Option<T> setOrOption(T value) {
  if (_val != null) {
    return None;
  }
  _val = value;
  return Some(value);
}