Introduce ImmutableTargetInfo.

This is the (belated) next step for go/chooser-targetinfo-cleanup.
The new class isn't yet integrated anywhere (but it's covered by
thorough unit tests). In the next step(s) of this cleanup, we'll
replace the implementations of the per-target-type factory methods
(like `SelectableTargetInfo.newSelectableTargetInfo()`) with
calls against the new `ImmutableTargetInfo.Builder` API. Existing
type-specific tests in TargetInfoTest.kt cover the behavior of
those factory methods. Finally, we can merge all the APIs to a
single `TargetInfo` class, with the concrete implementation taken
from `ImmutableTargetInfo`, and all the (static) factory methods
pulled in to preserve the categorization that had previously been
established via the subclass design.

(In practice some pieces may shift along the way, e.g. API method
additions that will have to be propagated up to the base & out to
the new immutable type. The general plan won't be affected by
these kinds of minor disruptions.)

Test: new unit test (component isn't yet integrated anywhere)
Bug: 202167050
Change-Id: Iaa8b260efd3d01db5ce58068adcaf43082a64c90
2 files changed