Package com.adobe.acs.commons.data
Class CompositeVariant<T>
- java.lang.Object
-
- com.adobe.acs.commons.data.CompositeVariant<T>
-
- Type Parameters:
T- Can be of any class supported by Variant, used for direct conversion in getValue, etc.
@ProviderType public final class CompositeVariant<T> extends Object
Represents a value which could be either a list of variants or a single variant. The idea is that this supports a transition from a singular to a multi-value property for easier conversion.
-
-
Constructor Summary
Constructors Constructor Description CompositeVariant(T initial)Create a variant either as a preferred type (set value later with addValue) or with an initial value and the preferred type is assumed by the value provided.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddValue(Object val)Class<T>getSingularType()TgetValue()<U> UgetValueAs(Class<U> otherType)List<T>getValues()<U> List<U>getValuesAs(Class<U> otherType)booleanisArray()booleanisEmpty()ObjecttoPropertyValue()StringtoString()
-
-
-
Constructor Detail
-
CompositeVariant
public CompositeVariant(T initial)
Create a variant either as a preferred type (set value later with addValue) or with an initial value and the preferred type is assumed by the value provided.- Parameters:
initial-
-
-