Interface EitherHolder<T>
public interface EitherHolder<T>
- 
Method SummaryModifier and TypeMethodDescriptionbooleanReturns true if this holder is backed by a direct value.booleanhasKey()Returns true if this holder has a resource key.holder()Returns the value of this holder.key()Returns the resource key.static <T> EitherHolder<T>Returns a direct or indirect value holder.static <T> EitherHolder<T>Returns an indirect holder via the resource key.
- 
Method Details- 
ofReturns a direct or indirect value holder.- Type Parameters:
- T- the type of the value
- Parameters:
- value- the value
- Returns:
- a new direct holder
 
- 
ofReturns an indirect holder via the resource key.- Type Parameters:
- T- the type of the value
- Parameters:
- key- the resource key
- Returns:
- a new holder with the given resource key
 
- 
hasHolderboolean hasHolder()Returns true if this holder is backed by a direct value.- Returns:
- true if the holder is direct
- See Also:
 
- 
hasKeyboolean hasKey()Returns true if this holder has a resource key.- Returns:
- true if this holder has a resource key
- See Also:
 
- 
holderReturns the value of this holder.- Returns:
- the value of this holder
- Throws:
- IllegalArgumentException- if this contains a resource key instead of a holder
- See Also:
 
- 
keyString key()Returns the resource key.- Returns:
- the resource key
- Throws:
- IllegalArgumentException- if this contains a holder instead of a resource key
- See Also:
 
 
-