com.github.fge.msgsimple.bundle
Class MessageBundleBuilder

java.lang.Object
  extended by com.github.fge.msgsimple.bundle.MessageBundleBuilder
All Implemented Interfaces:
Thawed<MessageBundle>

public final class MessageBundleBuilder
extends Object
implements Thawed<MessageBundle>

Builder class for a message bundle

You cannot instantiate this class directly: use MessageBundle.newBuilder(), or thaw another bundle.

This class is the Thawed counterpart of a MessageBundle.

See Also:
MessageBundle

Method Summary
 MessageBundleBuilder appendBundle(MessageBundle bundle)
          Append all message source providers from another bundle
 MessageBundleBuilder appendProvider(MessageSourceProvider provider)
          Append a message provider
 MessageBundleBuilder appendSource(Locale locale, MessageSource source)
          Convenience method to append a single-source provider for a given locale
 MessageBundleBuilder appendSource(MessageSource source)
          Convenience method to append a single-source provider
 MessageBundle freeze()
           
 MessageBundleBuilder prependBundle(MessageBundle bundle)
          Prepend all message source providers from another bundle
 MessageBundleBuilder prependProvider(MessageSourceProvider provider)
          Prepend a message provider
 MessageBundleBuilder prependSource(Locale locale, MessageSource source)
          Convenience method to prepend a single-source provider for a given locale
 MessageBundleBuilder prependSource(MessageSource source)
          Convenience method to prepend a single-source provider
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

appendProvider

public MessageBundleBuilder appendProvider(MessageSourceProvider provider)
Append a message provider

Parameters:
provider - the provider
Returns:
this
Throws:
NullPointerException - provider is null

prependProvider

public MessageBundleBuilder prependProvider(MessageSourceProvider provider)
Prepend a message provider

Parameters:
provider - the provider
Returns:
this
Throws:
NullPointerException - provider is null

appendSource

public MessageBundleBuilder appendSource(MessageSource source)
Convenience method to append a single-source provider

Parameters:
source - the message source
Returns:
this
See Also:
StaticMessageSourceProvider.withSingleSource(MessageSource)

prependSource

public MessageBundleBuilder prependSource(MessageSource source)
Convenience method to prepend a single-source provider

Parameters:
source - the message source
Returns:
this
See Also:
StaticMessageSourceProvider.withSingleSource(MessageSource)

appendSource

public MessageBundleBuilder appendSource(Locale locale,
                                         MessageSource source)
Convenience method to append a single-source provider for a given locale

Parameters:
source - the message source
Returns:
this
See Also:
StaticMessageSourceProvider.withSingleSource(Locale, MessageSource)

prependSource

public MessageBundleBuilder prependSource(Locale locale,
                                          MessageSource source)
Convenience method to prepend a single-source provider for a given locale

Parameters:
source - the message source
Returns:
this
See Also:
StaticMessageSourceProvider.withSingleSource(Locale, MessageSource)

appendBundle

public MessageBundleBuilder appendBundle(MessageBundle bundle)
Append all message source providers from another bundle

Parameters:
bundle - the bundle
Returns:
this
Throws:
NullPointerException - bundle is null

prependBundle

public MessageBundleBuilder prependBundle(MessageBundle bundle)
Prepend all message source providers from another bundle

Parameters:
bundle - the bundle
Returns:
this
Throws:
NullPointerException - bundle is null

freeze

public MessageBundle freeze()
Specified by:
freeze in interface Thawed<MessageBundle>