public static < T > StaticValue < T > mutateStaticValue ( StaticValue < T > staticValue , Callable < T > initializer ) { if ( multiplex ) { // Multiplexing case; must check for existing StaticValue if ( staticValue == null ) { // no existing value; create new one with no constructor initializer staticValue = StaticValue . createStaticValue ( null ) ; } // initialize this thread only with the initializer staticValue . initialize ( getThreadGroup ( ) , initializer ) ; return staticValue ; } // Final singleton case; just create a new StaticValue return StaticValue . createStaticValue ( initializer ) ; }
Mutates a static value . Note that if not multiplexing then this method returns a new StaticValue object with the value as obtained by the initializer .