mayBe method

TarFormat mayBe(
  1. TarFormat? other
)

Returns a new TarFormat that signifies that it can be either this or other's format.

Example:

TarFormat format = TarFormat.PAX;
format = format.mayBe(TarFormat.USTAR);

The above code would signify that we learnt that in addition to being a PAX format, it could also be of the USTAR format.

Implementation

TarFormat mayBe(TarFormat? other) {
  if (other == null) return this;
  return TarFormat._internal(_value | other._value);
}