Class AbstractNullableBean<T>
java.lang.Object
ch.tocco.nice2.templating.spi.freemarker.bean.AbstractNullableBean<T>
- All Implemented Interfaces:
NullableBean
- Direct Known Subclasses:
AbstractDateBean, BinaryBean, DurationBean, PhoneBean
Base class for beans which may contain null delegates.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
delegate
-
-
Constructor Details
-
AbstractNullableBean
-
-
Method Details
-
isNull
public boolean isNull()- Specified by:
isNullin interfaceNullableBean- Returns:
- true, if the bean contains a null value, else false.
-
or
Description copied from interface:NullableBeanGet the value or a given fallback value, if the value is null.- Specified by:
orin interfaceNullableBean- Parameters:
fallback- the fallback value- Returns:
- the bean itself or the given fallback, if the value is null.
-
strict
Description copied from interface:NullableBeanGet the value or null, if the value is null. Please note, that freemarker doesn't allow null values, so you should handle them somehow if no exception should be thrown. The following expressions are equivalent: 1. user.firstname.strict()!'fallback' 2. user.firstname.or('fallback')- Specified by:
strictin interfaceNullableBean- Returns:
- the value or null, if the value is null.
-
getDelegate
-