net.shibboleth.utilities.java.support.primitive
Class LazilyFormattedString

java.lang.Object
  extended by net.shibboleth.utilities.java.support.primitive.LazilyFormattedString

public class LazilyFormattedString
extends Object

An object that represents a string containing a Formatter string and a set of values. When toString() is called the format string is filled in with the given values. This allows for lazy evaluation of the value objects formatting function which may be expensive.


Field Summary
private  Object[] arguments
          The values that are filled in to the template string.
private  String template
          The template that is filled in with the values.
 
Constructor Summary
LazilyFormattedString(String stringTemplate, Object... templateArguments)
          Constructor.
 
Method Summary
 String toString()
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

template

private final String template
The template that is filled in with the values.


arguments

private final Object[] arguments
The values that are filled in to the template string.

Constructor Detail

LazilyFormattedString

public LazilyFormattedString(@Nonnull
                             String stringTemplate,
                             @Nullable
                             Object... templateArguments)
Constructor.

Parameters:
stringTemplate - the Formatter template string
templateArguments - the arguments to the template
Method Detail

toString

public String toString()

Overrides:
toString in class Object


Copyright © 1999-2012. All Rights Reserved.