Scala Either : simplest way to get a property that exists on right and left
<p>I have a template using a valueObject that might be one of two flavours depending on where it is used in our app. So I am  importing it as an Either: </p>

<pre><code>valueObject: Either[ ObjectA, ObjectB ]
</code></pre>

<p>Both objects have an identically named property on them so I would like to retrieve it just by calling</p>

<pre><code>valueObject.propertyA
</code></pre>

<p>Which doesn't work. </p>

<p>What is the most concise/ best way of doing this?</p>