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 protected
ImmutableEnvelop(T content)
Create an envelop with the content passed as argument.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.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description T
getContent()
Returns the content of envelop.boolean
hasContent()
Returnstrue
if the content of envelop is notnull
.boolean
isNullable()
Returnstrue
if 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:Envelop
Returnstrue
if the content of envelop is notnull
.- Specified by:
hasContent
in interfaceEnvelop
- Returns:
true
if the content of envelop is notnull
-
isNullable
public final boolean isNullable()
Description copied from interface:Envelop
Returnstrue
if the content of envelop can benull
.- Specified by:
isNullable
in interfaceEnvelop
- Returns:
true
if the content of envelop can benull
-
-