|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.github.fge.msgsimple.provider.LoadingMessageSourceProvider.Builder
public static final class LoadingMessageSourceProvider.Builder
Builder class for a LoadingMessageSourceProvider
Method Summary | |
---|---|
MessageSourceProvider |
build()
Build the provider |
LoadingMessageSourceProvider.Builder |
neverExpires()
Set this loading provider so that entries never expire |
LoadingMessageSourceProvider.Builder |
setDefaultSource(MessageSource defaultSource)
Set the default message source if the loader fails to load |
LoadingMessageSourceProvider.Builder |
setExpiryTime(long duration,
TimeUnit unit)
Set the source expiry time (10 minutes by default) |
LoadingMessageSourceProvider.Builder |
setLoader(MessageSourceLoader loader)
Set the message source loader |
LoadingMessageSourceProvider.Builder |
setLoadTimeout(long duration,
TimeUnit unit)
Set the load timeout (1 second by default) |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public LoadingMessageSourceProvider.Builder setLoader(MessageSourceLoader loader)
loader
- the loader
NullPointerException
- loader is nullpublic LoadingMessageSourceProvider.Builder setDefaultSource(MessageSource defaultSource)
defaultSource
- the default source
NullPointerException
- source is nullpublic LoadingMessageSourceProvider.Builder setLoadTimeout(long duration, TimeUnit unit)
If the loader passed as an argument fails to load a message source after the specified timeout is elapsed, then the default messagesource will be returned (if any).
duration
- number of unitsunit
- the time unit
IllegalArgumentException
- duration
is negative or zero
NullPointerException
- unit
is nullsetLoader(MessageSourceLoader)
,
setDefaultSource(MessageSource)
public LoadingMessageSourceProvider.Builder setExpiryTime(long duration, TimeUnit unit)
Do not use this method if you want no expiry at all; use
neverExpires()
instead.
duration
- number of unitsunit
- the time unit
IllegalArgumentException
- duration
is negative or zero
NullPointerException
- unit
is nullpublic LoadingMessageSourceProvider.Builder neverExpires()
public MessageSourceProvider build()
LoadingMessageSourceProvider
IllegalArgumentException
- no loader has been provided
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |