Class ImmutableEnvelop<T>
- java.lang.Object
-
- org.pepstock.charba.client.commons.ImmutableEnvelop<T>
-
- Type Parameters:
T- type of envelop content.
- All Implemented Interfaces:
Envelop
- Direct Known Subclasses:
AnnotationEnvelop,BaseEnvelop,CallbacksEnvelop,ConfigurationEnvelop,DataEnvelop,DataLabelsEnvelop,ItemsEnvelop,LabelsEnvelop,OptionsEnvelop
public abstract class ImmutableEnvelop<T> extends Object implements Envelop
This object is a container of hidden object which can set by constructor and immutable afterwards.- Author:
- Andrea "Stock" Stocchero
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedImmutableEnvelop(T content)Create an envelop with the content passed as argument.protectedImmutableEnvelop(T content, boolean nullable)Create an envelop with the content passed as argument and a flag to set if the content can be nullable.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TgetContent()Returns the content of envelop.booleanhasContent()Returnstrueif the content of envelop is notnull.booleanisNullable()Returnstrueif the content of envelop can benull.
-
-
-
Constructor Detail
-
ImmutableEnvelop
protected ImmutableEnvelop(T content)
Create an envelop with the content passed as argument.- Parameters:
content- content to set as initial value
-
ImmutableEnvelop
protected ImmutableEnvelop(T content, boolean nullable)
Create an envelop with the content passed as argument and a flag to set if the content can be nullable.- Parameters:
content- content to set as initial valuenullable- iftrue, the content can benull
-
-
Method Detail
-
getContent
public final T getContent()
Returns the content of envelop.- Returns:
- the content of envelop
-
hasContent
public final boolean hasContent()
Description copied from interface:EnvelopReturnstrueif the content of envelop is notnull.- Specified by:
hasContentin interfaceEnvelop- Returns:
trueif the content of envelop is notnull
-
isNullable
public final boolean isNullable()
Description copied from interface:EnvelopReturnstrueif the content of envelop can benull.- Specified by:
isNullablein interfaceEnvelop- Returns:
trueif the content of envelop can benull
-
-