This PR changes the usages of Set<ReadOnlyFateStore.TStatus> to EnumSet<ReadOnlyFateStore.TStatus>. EnumSet is typically more efficient.
The only thing that is a bit different after this conversion is the public static final EnumSet<TStatus> ALL_STATUSES within the TStatus enum used to be unmodifiable since it was constructed via Collectors.toUnmodifiableSet(). I could not find a way to create an unmodifiable EnumSet, so ALL_STATUSES is technically modifiable now. ALL_STATUSES is just used for convenience so we don't have to write out the code to create a set of this Enum each time. Looking at the calling code I don't think it is an issue that it is modifiable now.
This PR changes the usages of
Set<ReadOnlyFateStore.TStatus>
toEnumSet<ReadOnlyFateStore.TStatus>
. EnumSet is typically more efficient.The only thing that is a bit different after this conversion is the
public static final EnumSet<TStatus> ALL_STATUSES
within the TStatus enum used to be unmodifiable since it was constructed viaCollectors.toUnmodifiableSet()
. I could not find a way to create an unmodifiable EnumSet, soALL_STATUSES
is technically modifiable now.ALL_STATUSES
is just used for convenience so we don't have to write out the code to create a set of this Enum each time. Looking at the calling code I don't think it is an issue that it is modifiable now.