signature:
public class Constitution { /** * Walks to the enclosing type ' s simple names and applies naming convention .
 * This shortcut / fix shows deficiency of model ( it ' s probably more complicated than needed ) .
 * @ return enclosing immutable name */
@ Value . Lazy String typeImmutableEnclosingSimpleName ( ) { } }

implementation:
DeclaringType declaringType = protoclass ( ) . enclosingOf ( ) . get ( ) ; String enclosingSimpleName = declaringType . element ( ) . getSimpleName ( ) . toString ( ) ; String enclosingRawName = names ( ) . rawFromAbstract ( enclosingSimpleName ) ; // Here we checking for having both enclosing and value
// if we had protoclass it would be kind ( ) . isEnclosing ( ) & & kind ( ) . isValue ( )
Naming naming = declaringType . isImmutable ( ) ? names ( ) . namings . typeImmutable : names ( ) . namings . typeImmutableEnclosing ; return naming . apply ( enclosingRawName ) ;


signature:
public class TypeAdapters { /** * safe unchecked , typecheck performed by type token equality */
@ SuppressWarnings ( "unchecked" ) @ Override @ Nullable public < T > TypeAdapter < T > create ( Gson gson , TypeToken < T > type ) { } }

implementation: if ( ID_TYPE_TOKEN . equals ( type ) ) { return ( TypeAdapter < T > ) WRAPPED_ID_ADAPTER ; } if ( TIME_INSTANT_TYPE_TOKEN . equals ( type ) ) { return ( TypeAdapter < T > ) WRAPPED_TIME_INSTANT_ADAPTER ; } if ( BINARY_TYPE_TOKEN . equals ( type ) ) { return ( TypeAdapter < T > ) WRAPPED_BINARY_ADAPTER ; } if ( PATTERN_TYPE_TOKEN . equals ( type ) ) { return ( TypeAdapter < T > ) PATTERN_ADAPTER ; } if ( DECIMAL128_TYPE_TOKEN . equals ( type ) ) { return ( TypeAdapter < T > ) DECIMAL128_ADAPTER ; } return null ;


signature:
public class ImmutableOrdinalSet { /** * Returns singleton empty immutable ordinal set
 * @ param < E > element type
 * @ return empty set */
@ SuppressWarnings ( "unchecked" ) public static < E extends OrdinalValue < E > > ImmutableOrdinalSet < E > of ( ) { } }

implementation:
// safe unchecked : will contain no elements
return ( ImmutableOrdinalSet < E > ) EMPTY_SET ;


signature:
public class ImmutableOrdinalSet { /** * Creates immutable ordinal set from 1 or more elements .
 * All elements expected to have same { @ link OrdinalValue # domain ( ) } as the first element ,
 * otherwise exception will be thrown .
 * @ param < E > element type
 * @ param first first element
 * @ param rest the rest of elements
 * @ return empty set */
@ SafeVarargs public static < E extends OrdinalValue < E > > ImmutableOrdinalSet < E > of ( E first , E ... rest ) { } }

implementation: OrdinalDomain < E > domain = first . domain ( ) ; if ( rest . length == 0 ) { return new SingletonImmutableOrdinalSet < > ( first ) ; } OrdinalValue < ? > [ ] array = new OrdinalValue < ? > [ 1 + rest . length ] ; array [ 0 ] = first ; System . arraycopy ( rest , 0 , array , 1 , rest . length ) ; return new RegularImmutableOrdinalSet < > ( domain , array ) ;


signature:
public class ImmutableOrdinalSet { /** * Creates immutable ordinal set from iterable of elements .
 * All elements expected to have same { @ link OrdinalValue # domain ( ) } as the first element ,
 * otherwise exception will be thrown .
 * @ param < E > the element type
 * @ param elements the elements , no nulls allowed
 * @ return the immutable ordinal set */
@ SuppressWarnings ( "unchecked" ) // Safe unchecked , elements are defined to be of E or subtypes of E
// which is allowed for immutable collection
public static < E extends OrdinalValue < E > > ImmutableOrdinalSet < E > copyOf ( Iterable < ? extends E > elements ) { } }

implementation: if ( elements instanceof ImmutableOrdinalSet ) { return ( ImmutableOrdinalSet < E > ) elements ; } return constructFromArray ( Iterables . toArray ( elements , OrdinalValue . class ) ) ;


signature:
public class ImmutableOrdinalSet { /** * Creates immutable ordinal set from array of elements .
 * All elements expected to have same { @ link OrdinalValue # domain ( ) } as the first element ,
 * otherwise exception will be thrown .
 * @ param < E > the element type
 * @ param elements the elements , no nulls allowed
 * @ return the immutable ordinal set */
public static < E extends OrdinalValue < E > > ImmutableOrdinalSet < E > copyOf ( E [ ] elements ) { } }

implementation: return constructFromArray ( elements ) ;


signature:
public class Support { /** * Given a query / ordering clause will convert it to Bson representation . */
public static Bson convertToBson ( final Constraints . ConstraintHost fields ) { } }

implementation: if ( fields instanceof JsonQuery ) { return ( Bson ) fields ; } return fields . accept ( new ConstraintBuilder ( "" ) ) . asDocument ( ) ;


signature:
public class Support { /** * Builds bson with index definition . The difference with
 * { @ link # convertToBson ( Constraints . ConstraintHost ) } is that this method fails on duplicate
 * fields . Currently only one index is allowed per field .
 * @ see < a href = " https : / / docs . mongodb . com / manual / indexes / " > Mongo Indexes < / a > */
public static Bson convertToIndex ( final Constraints . ConstraintHost fields ) { } }

implementation: final Document document = new Document ( ) ; fields . accept ( new ConvertToIndex ( document ) ) ; return document ;


signature:
public class BsonReader { /** * Gson library reads numbers lazily when using generic
 * { @ link com . google . gson . internal . bind . TypeAdapters # JSON _ ELEMENT } type adapter .
 * Number is read as string and then wrapped inside { @ link LazilyParsedNumber } . This inefficiency
 * should only occur if reading numbers with generic JSON element API
 * and not using generated type adapters .
 * @ see LazilyParsedNumber
 * @ see com . google . gson . internal . bind . TypeAdapters # JSON _ ELEMENT */
private String scalarToString ( ) { } }

implementation: switch ( delegate . getCurrentBsonType ( ) ) { case STRING : return delegate . readString ( ) ; case SYMBOL : return delegate . readSymbol ( ) ; case INT32 : return Integer . toString ( delegate . readInt32 ( ) ) ; case INT64 : return Long . toString ( delegate . readInt64 ( ) ) ; case DOUBLE : return Double . toString ( delegate . readDouble ( ) ) ; case DECIMAL128 : return delegate . readDecimal128 ( ) . toString ( ) ; default : throw new IllegalStateException ( "Unknown scalar type to be converted to string: " + delegate . getCurrentBsonType ( ) ) ; }


signature:
public class Expressions { /** * Combines expressions < a href = " https : / / en . wikipedia . org / wiki / Disjunctive _ normal _ form " > Disjunctive normal form < / a > */
public static < T > Expression < T > dnf ( Operator operator , Expression < T > existing , Expression < T > newExpression ) { } }

implementation: if ( ! ( operator == Operators . AND || operator == Operators . OR ) ) { throw new IllegalArgumentException ( String . format ( "Expected %s for operator but got %s" , Arrays . asList ( Operators . AND , Operators . OR ) , operator ) ) ; } if ( isNil ( existing ) ) { return DnfExpression . < T > create ( ) . and ( newExpression ) ; } if ( ! ( existing instanceof DnfExpression ) ) { throw new IllegalStateException ( String . format ( "Expected existing expression to be %s but was %s" , DnfExpression . class . getName ( ) , existing . getClass ( ) . getName ( ) ) ) ; } @ SuppressWarnings ( "unchecked" ) final DnfExpression < T > conjunction = ( DnfExpression < T > ) existing ; return operator == Operators . AND ? conjunction . and ( newExpression ) : conjunction . or ( newExpression ) ;


signature:
public class GsonCodecs { /** * Build a TypeAdapter from { @ link Codec } opposite of { @ link # codecFromTypeAdapter ( Class , TypeAdapter ) } .
 * @ param codec existing codec
 * @ return type adapter which delegates calls to a codec . */
public static < T > TypeAdapter < T > typeAdapterFromCodec ( final Codec < T > codec ) { } }

implementation: Preconditions . checkNotNull ( codec , "codec" ) ; return new TypeAdapter < T > ( ) { @ Override public void write ( JsonWriter out , T value ) throws IOException { BsonWriter writer = ( BsonWriter ) out ; org . bson . BsonWriter delegate = writer . unwrap ( ) ; codec . encode ( delegate , value , EncoderContext . builder ( ) . build ( ) ) ; } @ Override public T read ( JsonReader in ) throws IOException { BsonReader reader = ( BsonReader ) in ; org . bson . BsonReader delegate = reader . unwrap ( ) ; return codec . decode ( delegate , DecoderContext . builder ( ) . build ( ) ) ; } } ;


signature:
public class GsonCodecs { /** * Gson Factory which gives preference to existing adapters from { @ code gson } instance . However ,
 * if type is not supported it will query { @ link CodecRegistry } to create one ( if possible ) .
 * < p > This allows supporting Bson types by Gson natively ( eg . for { @ link org . bson . types . ObjectId } ) .
 * @ param registry existing registry which will be used if type is unknown to { @ code gson } .
 * @ return factory which delegates to { @ code registry } for unknown types . */
public static TypeAdapterFactory delegatingTypeAdapterFactory ( final CodecRegistry registry ) { } }

implementation: Preconditions . checkNotNull ( registry , "registry" ) ; return new TypeAdapterFactory ( ) { @ Override public < T > TypeAdapter < T > create ( Gson gson , TypeToken < T > type ) { boolean hasAdapter ; try { TypeAdapter < T > adapter = gson . getDelegateAdapter ( this , type ) ; hasAdapter = ! isReflectiveTypeAdapter ( adapter ) ; } catch ( IllegalArgumentException e ) { hasAdapter = false ; } if ( hasAdapter ) { return null ; } try { @ SuppressWarnings ( "unchecked" ) Codec < T > codec = ( Codec < T > ) registry . get ( type . getRawType ( ) ) ; return typeAdapterFromCodec ( codec ) ; } catch ( CodecConfigurationException e1 ) { return null ; } } } ;


signature:
public class GsonCodecs { /** * Build a codec from { @ link TypeAdapter } . Opposite of { @ link # typeAdapterFromCodec ( Codec ) } .
 * @ param type type handled by this adapter
 * @ param adapter existing adapter
 * @ param < T > codec value type
 * @ throws CodecConfigurationException if adapter is not supported
 * @ return new instance of the codec which handles { @ code type } . */
public static < T > Codec < T > codecFromTypeAdapter ( Class < T > type , TypeAdapter < T > adapter ) { } }

implementation: if ( isReflectiveTypeAdapter ( adapter ) ) { throw new CodecConfigurationException ( String . format ( "%s can't be build from %s " + "(for type %s)" , TypeAdapterCodec . class . getSimpleName ( ) , adapter . getClass ( ) . getName ( ) , type . getName ( ) ) ) ; } return new TypeAdapterCodec < > ( type , adapter ) ;


signature:
public class GsonCodecs { /** * Given existing { @ code Gson } instance builds a { @ link CodecRegistry } .
 * @ param gson preconfigured instance
 * @ return wrapper for { @ code gson } . */
public static CodecRegistry codecRegistryFromGson ( final Gson gson ) { } }

implementation: Preconditions . checkNotNull ( gson , "gson" ) ; return new CodecRegistry ( ) { @ Override public < T > Codec < T > get ( Class < T > clazz ) { return codecFromTypeAdapter ( clazz , gson . getAdapter ( clazz ) ) ; } } ;


signature:
public class OrdinalDomain { /** * Iterator over all present inhabitants of ordinal domain .
 * @ return snapshot iterator of elements in ordinal domain . */
@ Override public Iterator < E > iterator ( ) { } }

implementation: return new AbstractIterator < E > ( ) { private final int length = length ( ) ; private int index = 0 ; @ Override protected E computeNext ( ) { int p = index ++ ; if ( p < length ) { return get ( p ) ; } return endOfData ( ) ; } } ;


signature:
public class AttributeBuilderReflection { /** * The same class included in two parents , may or may not be nested builders based on that discovery pattern */
private static String cachingKey ( ValueAttribute valueAttribute ) { } }

implementation: return String . format ( "%s-%s" , valueAttribute . containedTypeElement . getQualifiedName ( ) , Joiner . on ( "." ) . join ( valueAttribute . containingType . constitution . style ( ) . attributeBuilder ( ) ) ) ;


signature:
public class ValueAttribute { /** * Serialized name , actully specified via annotation
 * @ return name for JSON as overriden . */
public String getSerializedName ( ) { } }

implementation: if ( serializedName == null ) { Optional < SerializedNameMirror > serializedNameAnnotation = SerializedNameMirror . find ( element ) ; if ( serializedNameAnnotation . isPresent ( ) ) { SerializedNameMirror m = serializedNameAnnotation . get ( ) ; serializedName = m . value ( ) ; alternateSerializedNames = m . alternate ( ) ; return serializedName ; } Optional < NamedMirror > namedAnnotation = NamedMirror . find ( element ) ; if ( namedAnnotation . isPresent ( ) ) { String value = namedAnnotation . get ( ) . value ( ) ; if ( ! value . isEmpty ( ) ) { serializedName = value ; return serializedName ; } } Optional < OkNamedMirror > okNamedAnnotation = OkNamedMirror . find ( element ) ; if ( okNamedAnnotation . isPresent ( ) ) { String value = okNamedAnnotation . get ( ) . name ( ) ; if ( ! value . isEmpty ( ) ) { serializedName = value ; return serializedName ; } } if ( isMarkedAsMongoId ( ) ) { serializedName = ID_ATTRIBUTE_NAME ; return serializedName ; } serializedName = "" ; return serializedName ; } return serializedName ;


signature:
public class ValueAttribute { /** * Marshaled name for compatibility with repository .
 * @ return get JSON name either specified or default . */
public String getMarshaledName ( ) { } }

implementation: String serializedName = getSerializedName ( ) ; if ( ! serializedName . isEmpty ( ) ) { return serializedName ; } return names . raw ;


signature:
public class ValueAttribute { /** * Initialized Validates things that were not validated otherwise
 * @ param instantiationCreator can instantiate encodings */
void initAndValidate ( @ Nullable InstantiationCreator instantiationCreator ) { } }

implementation: initTypeName ( ) ; if ( instantiationCreator != null && ! isGenerateLazy ) { this . instantiation = instantiationCreator . tryInstantiateFor ( reporter , returnTypeName , names , containingType , isGenerateDefault || isGenerateDerived ) ; } initTypeKind ( ) ; initOrderKind ( ) ; initBuilderParamsIfApplicable ( ) ; initMiscellaneous ( ) ; initSpecialAnnotations ( ) ; validateThrowsClause ( ) ; validateTypeAndAnnotations ( ) ; initAttributeValueType ( ) ; if ( supportBuiltinContainerTypes ( ) ) { initImmutableCopyOf ( ) ; } initAttributeBuilder ( ) ;


signature:
public class CriteriaContext { /** * adds an intermediate step ( list of paths usually ) */
public CriteriaContext < R > add ( Path < ? > path ) { } }

implementation: final Path < ? > newPath = this . path != null ? Expressions . path ( this . path . path ( ) + "." + path . path ( ) ) : path ; return new CriteriaContext < > ( operator , expression , newPath , creator ) ;


signature:
public class InMemoryExpressionEvaluator { /** * Factory method to create evaluator instance */
public static < T > Predicate < T > of ( Expression < T > expression ) { } }

implementation:
if ( Expressions . isNil ( expression ) ) { // always true
return instance -> true ; } return new InMemoryExpressionEvaluator < > ( expression ) ;


signature:
public class FluentFutures { /** * Wraps listenable future with a fluent future .
 * @ param < V > value type
 * @ param future future
 * @ return fluent instance */
public static < V > FluentFuture < V > from ( ListenableFuture < V > future ) { } }

implementation: if ( future instanceof FluentFuture < ? > ) { return ( FluentFuture < V > ) future ; } return new WrapingFluentFuture < > ( future , MoreExecutors . directExecutor ( ) ) ;


signature:
public class AnnotationMirrors { /** * safe unchecked : known return type list or empty immutable list */
@ SuppressWarnings ( "unchecked" ) public static List < ? extends AnnotationMirror > from ( TypeMirror type ) { } }

implementation: return ( List < ? extends AnnotationMirror > ) GetTypeAnnotations . get ( type ) ;


signature:
public class ComparableCriteria { /** * Checks that attribute is less than ( but not equal to ) { @ code upper } .
 * < p > Use { @ link # isAtMost ( Comparable ) } for less < i > or equal < / i > comparison < / p > */
public R isLessThan ( V upper ) { } }

implementation: return create ( e -> Expressions . call ( Operators . LESS_THAN , e , Expressions . literal ( upper ) ) ) ;


signature:
public class ComparableCriteria { /** * Checks that attribute is greater than ( but not equal to ) { @ code lower } .
 * < p > Use { @ link # isAtLeast ( Comparable ) } for greater < i > or equal < / i > comparison < / p > */
public R isGreaterThan ( V lower ) { } }

implementation: return create ( e -> Expressions . call ( Operators . GREATER_THAN , e , Expressions . literal ( lower ) ) ) ;


signature:
public class ComparableCriteria { /** * Checks that attribute is less than or equal to { @ code upperInclusive } . */
public R isAtMost ( V upperInclusive ) { } }

implementation: return create ( e -> Expressions . call ( Operators . LESS_THAN_OR_EQUAL , e , Expressions . literal ( upperInclusive ) ) ) ;


signature:
public class ComparableCriteria { /** * Checks that attribute is greater or equal to { @ code lowerInclusive } . */
public R isAtLeast ( V lowerInclusive ) { } }

implementation: return create ( e -> Expressions . call ( Operators . GREATER_THAN_OR_EQUAL , e , Expressions . literal ( lowerInclusive ) ) ) ;


signature:
public class RepositorySetup { /** * Create setup using MongoDB client uri .
 * < ul >
 * < li > URI should contain database path segment < / li >
 * < li > New internal { @ link MongoClient } will be created < / li >
 * < li > New internal executor will be created ( with shutdown on jvm exit ) < / li >
 * < li > New { @ link Gson } instance will be created configured with type adapter factory
 * providers < / li >
 * < / ul >
 * Setup created by this factory methods should be reused to configure collection repositories for
 * the same MongoDB database .
 * This constructor designed for ease of use in sample scenarious . For more flexibility consider
 * using { @ link # builder ( ) } with custom constructed { @ link ListeningExecutorService
 * executor } and { @ link DB database } handle .
 * @ param uri string that will be parsed as { @ link MongoClientURI } .
 * @ see MongoClientURI
 * @ return repository setup instance . */
public static RepositorySetup forUri ( String uri ) { } }

implementation: MongoClientURI clientUri = new MongoClientURI ( uri ) ; @ Nullable String databaseName = clientUri . getDatabase ( ) ; checkArgument ( databaseName != null , "URI should contain database path segment" ) ; return builder ( ) . database ( newMongoClient ( clientUri ) . getDatabase ( databaseName ) ) . executor ( newExecutor ( ) ) . gson ( createGson ( ) ) . build ( ) ;


signature: public class OptionalList2 { private static < T > List < T > createSafeList ( Iterable < T > iterable ) { } }

implementation: List < T > list = StreamSupport . stream ( iterable . spliterator ( ) , false ) . map ( element -> Objects . requireNonNull ( element , "element" ) ) . collect ( Collectors . toList ( ) ) ; return Collections . unmodifiableList ( list ) ;


signature:
public class OptionalMap { /** * Expose ( and detect ) the field as Optional of Map */
@ Encoding . Expose public Optional < Map < K , V > > get ( ) { } }

implementation: return Optional . < Map < K , V > > ofNullable ( map ) ;


signature:
public class OptionalMap { /** * alternatively it can be exposed as Optional of ImmutableMap */
@ Encoding . Expose public Optional < ImmutableMap < K , V > > getImmutable ( ) { } }

implementation: return Optional . ofNullable ( map ) ;


signature:
public class TypeHierarchyCollector { /** * overridable stringify .
 * @ param input the input
 * @ param context the context
 * @ return the string */
protected String stringify ( DeclaredType input , TypevarContext context ) { } }

implementation: return toTypeElement ( input ) . getQualifiedName ( ) . toString ( ) ;


signature:
public class AttributeBuilderDescriptor { /** * Uses { @ link # getValueToBuilderTarget ( ) } to determine appropriate format for
 * creating a new builder from a value object .
 * The template needs to still query { @ link # isCopyMethodOnValueInstance ( ) } to determine
 * whether to use { @ code [ expression ] . [ n . getQualifiedValueToBuilderMethod ] ( ) } vs
 * { @ code [ n . getQualifiedValueToBuilderMethod ] ( [ expression ] ) }
 * @ return method to use for converting a value to a builder . */
public String getQualifiedValueToBuilderMethod ( ) { } }

implementation: switch ( getValueToBuilderTarget ( ) ) { case VALUE_INSTANCE : return getValueToBuilderMethod ( ) ; case VALUE_TYPE : return String . format ( "%s.%s" , getQualifiedValueTypeName ( ) , getValueToBuilderMethod ( ) ) ; case BUILDER_INSTANCE : return String . format ( "%s().%s" , getQualifiedBuilderConstructorMethod ( ) , getValueToBuilderMethod ( ) ) ; case BUILDER_TYPE : return String . format ( "%s.%s" , getQualifiedBuilderTypeName ( ) , getValueToBuilderMethod ( ) ) ; case BUILDER_CONSTRUCTOR : return getQualifiedBuilderConstructorMethod ( ) ; default : throw new UnsupportedOperationException ( String . format ( "Could not handle %s" , getValueToBuilderTarget ( ) ) ) ; }


signature:
public class JsonParserReader { /** * Reads current value including objects and array as effiecient token buffer .
 * Use of Jackson ' s own mechanisms is important to preserve custom elements
 * such as special embedded objects in BSON or other data formats .
 * @ return { @ link TokenBuffer }
 * @ throws IOException if error occured */
public final TokenBuffer nextTokenBuffer ( ) throws IOException { } }

implementation:
TokenBuffer buffer = new TokenBuffer ( parser ) ; // if token is consumed , but undelying parser is still sitting on this token , we move forward
requirePeek ( ) ; buffer . copyCurrentStructure ( parser ) ; // when we will return to reading from reader , state will be cleared and nextToken after
clearPeek ( ) ; return buffer ;


signature:
public class HtmlUnitAlert { /** * Closes the current window . */
void close ( ) { } }

implementation: lock . lock ( ) ; condition . signal ( ) ; setAutoAccept ( true ) ; lock . unlock ( ) ; holder_ = null ;


signature:
public class AsyncScriptExecutor { /** * Injects an asynchronous script for execution and waits for its result .
 * @ param scriptBody The script body .
 * @ param parameters The script parameters , which can be referenced using the { @ code arguments }
 * JavaScript object .
 * @ return The script result . */
public Object execute ( String scriptBody , Object [ ] parameters ) { } }

implementation: try { asyncResult = new AsyncScriptResult ( ) ; Function function = createInjectedScriptFunction ( scriptBody , asyncResult ) ; try { page . executeJavaScriptFunction ( function , function , parameters , page . getDocumentElement ( ) ) ; } catch ( ScriptException e ) { throw new WebDriverException ( e ) ; } try { return asyncResult . waitForResult ( timeoutMillis ) ; } catch ( InterruptedException e ) { throw new WebDriverException ( e ) ; } } finally { asyncResult = null ; }


signature:
public class HtmlUnitLogs { /** * { @ inheritDoc } */
@ Override public LogEntries get ( String logType ) { } }

implementation: if ( logType == LogType . BROWSER ) { return new LogEntries ( logger . getContentAndFlush ( ) ) ; } return new LogEntries ( Collections . emptyList ( ) ) ;


signature:
public class HtmlUnitKeyboardMapping { /** * Returns the equivalent constant in { @ link KeyboardEvent } . */
static int getKeysMapping ( char ch ) { } }

implementation: Integer i = specialKeysMap . get ( ch ) ; if ( i == null ) { return 0 ; } return i ;


signature:
public class HtmlUnitDriver { /** * Set proxy for WebClient using Proxy .
 * @ param proxy The proxy preferences . */
public void setProxySettings ( Proxy proxy ) { } }

implementation:
if ( proxy == null || proxy . getProxyType ( ) == Proxy . ProxyType . UNSPECIFIED ) { return ; } switch ( proxy . getProxyType ( ) ) { case MANUAL : List < String > noProxyHosts = new ArrayList < > ( ) ; String noProxy = proxy . getNoProxy ( ) ; if ( noProxy != null && ! noProxy . isEmpty ( ) ) { String [ ] hosts = noProxy . split ( "," ) ; for ( String host : hosts ) { if ( host . trim ( ) . length ( ) > 0 ) { noProxyHosts . add ( host . trim ( ) ) ; } } } String httpProxy = proxy . getHttpProxy ( ) ; if ( httpProxy != null && ! httpProxy . isEmpty ( ) ) { String host = httpProxy ; int port = 0 ; int index = httpProxy . indexOf ( ":" ) ; if ( index != - 1 ) { host = httpProxy . substring ( 0 , index ) ; port = Integer . parseInt ( httpProxy . substring ( index + 1 ) ) ; } setHTTPProxy ( host , port , noProxyHosts ) ; } String socksProxy = proxy . getSocksProxy ( ) ; if ( socksProxy != null && ! socksProxy . isEmpty ( ) ) { String host = socksProxy ; int port = 0 ; int index = socksProxy . indexOf ( ":" ) ; if ( index != - 1 ) { host = socksProxy . substring ( 0 , index ) ; port = Integer . parseInt ( socksProxy . substring ( index + 1 ) ) ; } setSocksProxy ( host , port , noProxyHosts ) ; } // sslProxy is not supported / implemented
// ftpProxy is not supported / implemented
break ; case PAC : String pac = proxy . getProxyAutoconfigUrl ( ) ; if ( pac != null && ! pac . isEmpty ( ) ) { setAutoProxy ( pac ) ; } break ; default : break ; }


signature:
public class HtmlUnitDriver { /** * Sets HTTP proxy for WebClient with bypass proxy hosts
 * @ param host The hostname of HTTP proxy
 * @ param port The port of HTTP proxy , 0 means HTTP proxy w / o port
 * @ param noProxyHosts The list of hosts which need to bypass HTTP proxy */
public void setHTTPProxy ( String host , int port , List < String > noProxyHosts ) { } }

implementation: proxyConfig = new ProxyConfig ( ) ; proxyConfig . setProxyHost ( host ) ; proxyConfig . setProxyPort ( port ) ; if ( noProxyHosts != null && noProxyHosts . size ( ) > 0 ) { for ( String noProxyHost : noProxyHosts ) { proxyConfig . addHostsToProxyBypass ( noProxyHost ) ; } } getWebClient ( ) . getOptions ( ) . setProxyConfig ( proxyConfig ) ;


signature:
public class HtmlUnitDriver { /** * Sets Proxy Autoconfiguration URL for WebClient
 * @ param autoProxyUrl The Proxy Autoconfiguration URL */
public void setAutoProxy ( String autoProxyUrl ) { } }

implementation: proxyConfig = new ProxyConfig ( ) ; proxyConfig . setProxyAutoConfigUrl ( autoProxyUrl ) ; getWebClient ( ) . getOptions ( ) . setProxyConfig ( proxyConfig ) ;


signature:
public class HtmlUnitDriver { /** * Allows HtmlUnit ' s about : blank to be loaded in the constructor , and may be useful for other
 * tests ?
 * @ param fullUrl The URL to visit */
protected void get ( URL fullUrl ) { } }

implementation:
alert . close ( ) ; alert . setAutoAccept ( false ) ; try { // we can ' t use webClient . getPage ( url ) here because selenium has a different idea
// of the current window and we like to load into to selenium current one
final WebRequest request = new WebRequest ( fullUrl , getBrowserVersion ( ) . getHtmlAcceptHeader ( ) ) ; request . setCharset ( StandardCharsets . UTF_8 ) ; getWebClient ( ) . getPage ( getCurrentWindow ( ) . getTopWindow ( ) , request ) ; // A " get " works over the entire page
currentWindow = getCurrentWindow ( ) . getTopWindow ( ) ; } catch ( UnknownHostException e ) { getCurrentWindow ( ) . getTopWindow ( ) . setEnclosedPage ( new UnexpectedPage ( new StringWebResponse ( "Unknown host" , fullUrl ) , getCurrentWindow ( ) . getTopWindow ( ) ) ) ; } catch ( ConnectException e ) { // This might be expected
} catch ( SocketTimeoutException e ) { throw new TimeoutException ( e ) ; } catch ( NoSuchSessionException e ) { throw e ; } catch ( SSLHandshakeException e ) { return ; } catch ( Exception e ) { throw new WebDriverException ( e ) ; } gotPage = true ; pickWindow ( ) ; resetKeyboardAndMouseState ( ) ;


signature:
public class CamundaBpmProcessApplication { /** * In a @ PostDeploy Hook you can interact with the process engine and access
 * the processes the application has deployed . */
@ PostDeploy public void onDeploymentFinished ( ProcessEngine processEngine ) { } }

implementation:
long processCount = processEngine . getRuntimeService ( ) . createProcessInstanceQuery ( ) . processDefinitionKey ( PROCESS_DEFINITION_KEY ) . count ( ) ; if ( processCount == 0 ) { // start an initial process instance
Map < String , Object > variables = new HashMap < String , Object > ( ) ; variables . put ( "taskName" , "Camunda BPM evaluieren" ) ; variables . put ( "taskAssignee" , "demo" ) ; ProcessInstance processInstance = processEngine . getRuntimeService ( ) . startProcessInstanceByKey ( PROCESS_DEFINITION_KEY , "vorgang-27" , variables ) ; variables = new HashMap < String , Object > ( ) ; variables . put ( "subtaskName" , "Evaluierungslizenz beantragen" ) ; variables . put ( "subtaskAssignee" , "demo" ) ; processEngine . getRuntimeService ( ) . messageEventReceived ( "SUBTASK_WANTED" , processInstance . getId ( ) , variables ) ; variables = new HashMap < String , Object > ( ) ; variables . put ( "subtaskName" , "Datenbank-Schema anlegen" ) ; variables . put ( "subtaskAssignee" , "demo" ) ; processEngine . getRuntimeService ( ) . messageEventReceived ( "SUBTASK_WANTED" , processInstance . getId ( ) , variables ) ; }


signature:
public class OrderBean { /** * Alternative to do a
 * " businessProcess . startProcessByKey ( ' OrderConfirmation ' ) " in JSF */
@ StartProcess ( "OrderConfirmation" ) public void saveNewOrder ( Order order ) { } }

implementation:
entityManager . persist ( order . getCustomer ( ) ) ; entityManager . persist ( order ) ; // flush to get the id generated
// entityManager . flush ( ) ;
businessProcess . setVariable ( "orderId" , order . getId ( ) ) ;


implementation: Claim claim = new Claim ( ) ; claim . setType ( "Unfall KFZ" ) ; claim . setExpenditure ( 1000 ) ; processEngine . getRuntimeService ( ) . startProcessInstanceByKey ( BpmConstants . DECISION_FLOW_KEY_mitarbeiterBestimmen , Variables . createVariables ( ) . putValue ( "claim" , claim ) ) ;


signature:
public class MyBatisExtendedSessionFactory { /** * initialize the { @ link ProcessEngineConfiguration } from an existing one ,
 * just using the database settings and initialize the database / MyBatis
 * stuff . */
public void initFromProcessEngineConfiguration ( ProcessEngineConfigurationImpl processEngineConfiguration , String resourceName ) { } }

implementation: this . resourceName = resourceName ; setDataSource ( processEngineConfiguration . getDataSource ( ) ) ; initDataSource ( ) ; initCommandContextFactory ( ) ; initTransactionFactory ( ) ; initTransactionContextFactory ( ) ; initCommandExecutors ( ) ; initIdentityProviderSessionFactory ( ) ; initSqlSessionFactory ( ) ; initSessionFactories ( ) ;


signature:
public class FoxService { /** * - - - Convenience methods for showcase */
public void startAccontOpeningProcess ( Map < String , Object > variables ) { } }

implementation: String businessKey = ( String ) variables . get ( "ordernumber" ) ; runtimeService . startProcessInstanceByKey ( PROCESS_KEY , businessKey , variables ) ;


signature:
public class BoxHelper { /** * Get a BoxDeveloperEditionAPIConnection that can be used by an App user to access Box .
 * @ param userId The UserId of a valid Box App User
 * @ return BoxDeveloperEditionAPIConnection new Box Developer Edition connection with App User token */
public static BoxDeveloperEditionAPIConnection userClient ( String userId ) { } }

implementation:
if ( userId == null ) { // session data has expired
return null ; } System . out . format ( "userClient called with userId %s \n\n" , userId ) ; try { BoxDeveloperEditionAPIConnection userClient = BoxDeveloperEditionAPIConnection . getAppUserConnection ( userId , CLIENT_ID , CLIENT_SECRET , jwtEncryptionPreferences , accessTokenCache ) ; return userClient ; } catch ( BoxAPIException apiException ) { apiException . printStackTrace ( ) ; throw apiException ; }


signature:
public class GuardBpmnParseListener { /** * Adds aa { @ link ActivityGuard } on { @ link ExecutionListener # EVENTNAME _ START }
 * and { @ link ExecutionListener # EVENTNAME _ END } if one is configured in the
 * properties file .
 * @ param activity
 * the current Activity in process */
private void addExecutionListener ( final ActivityImpl activity ) { } }

implementation: final String guardClass = guardClass ( activity ) ; if ( isNotBlank ( guardClass ) ) { activity . addExecutionListener ( ExecutionListener . EVENTNAME_START , classDelegateFor ( guardClass ) ) ; activity . addExecutionListener ( ExecutionListener . EVENTNAME_END , classDelegateFor ( guardClass ) ) ; }


signature:
public class ProcessDefinitionEntity { /** * Updates all modifiable fields from another process definition entity .
 * @ param updatingProcessDefinition */
public void updateModifiedFieldsFromEntity ( ProcessDefinitionEntity updatingProcessDefinition ) { } }

implementation:
if ( ! this . key . equals ( updatingProcessDefinition . key ) || ! this . deploymentId . equals ( updatingProcessDefinition . deploymentId ) ) { throw new ProcessEngineException ( "Cannot update entity from an unrelated process definition" ) ; } // TODO : add a guard once the mismatch between revisions in deployment cache and database has been resolved
this . revision = updatingProcessDefinition . revision ; this . suspensionState = updatingProcessDefinition . suspensionState ;


implementation: if ( processEngine . getRuntimeService ( ) . createProcessInstanceQuery ( ) . processDefinitionKey ( PROCESS_DEFINITION_KEY ) . count ( ) == 0 ) { Order order = new Order ( ) . addItem ( new Item ( ) . setId ( "01" ) . setText ( "First Item" ) ) . addItem ( new Item ( ) . setId ( "02" ) . setText ( "Second Item" ) ) . addItem ( new Item ( ) . setId ( "03" ) . setText ( "Third Item" ) ) ; processEngine . getRuntimeService ( ) . startProcessInstanceByKey ( PROCESS_DEFINITION_KEY , Variables . createVariables ( ) . putValueTyped ( ProcessVariables . VAR_NAME_ORDER , Variables . objectValue ( order ) . serializationDataFormat ( SerializationDataFormats . JSON ) . create ( ) ) ) ; }


signature:
public class FourEyesExtensionsParseListener { /** * Add TaskListener on " complete " event generically every time , so we don ' t
 * have to add it in the XML . */
private void addFourEyesTaskListener ( ActivityImpl activity ) { } }

implementation:
UserTaskActivityBehavior userTaskActivityBehavior = ( UserTaskActivityBehavior ) activity . getActivityBehavior ( ) ; boolean listenerAlreadyExists = false ; // check that the listener wasn ' t added in the XML explicitly
List < TaskListener > existingListeners = userTaskActivityBehavior . getTaskDefinition ( ) . getTaskListeners ( ) . get ( "complete" ) ; for ( TaskListener taskListener : existingListeners ) { if ( taskListener instanceof ClassDelegate && ( ( ClassDelegate ) taskListener ) . getClassName ( ) . equals ( TaskCompletionListener . class . getName ( ) ) ) { listenerAlreadyExists = true ; logger . info ( TaskCompletionListener . class . getSimpleName ( ) + " was already explicitly added to usertask in the bpmn xml." ) ; break ; } } if ( ! listenerAlreadyExists ) { logger . info ( "Adding " + TaskCompletionListener . class . getSimpleName ( ) + " implicitly to usertask." ) ; ClassDelegate taskListener = new ClassDelegate ( TaskCompletionListener . class , null ) ; userTaskActivityBehavior . getTaskDefinition ( ) . addTaskListener ( "complete" , taskListener ) ; }


signature:
public class ExampleTenantAwareProcessApplication { /** * private static final String PROCESS _ DEFINITION _ KEY = " tenantdemo - process - application " ; */
@ PostDeploy public void deployProcessesToTenantEngines ( ) { } }

implementation:
// copy the process definitions deployed to the default engine to all tenants
for ( ProcessEngine processEngine : BpmPlatform . getProcessEngineService ( ) . getProcessEngines ( ) ) { if ( processEngine != BpmPlatform . getDefaultProcessEngine ( ) ) { TenantManager . deployDefaultProcessesToEngine ( processEngine ) ; } }


signature:
public class TasklistBean { /** * Do this as a workaround till IPC works correctly see
 * http : / / www . liferay . com /
 * de / community / forums / - / message _ boards / message / 27295776 */
private void setSharedAttribute ( Task task ) { } }

implementation: setSharedAttribute ( BRIDGE_TASK_ID , task . getId ( ) ) ; setSharedAttribute ( BRIDGE_PROCESS_DEFINITION_ID , null ) ;


signature:
public class TasklistBean { /** * copied from
 * https : / / github . com / liferay / liferay - portal / blob / master / portal - impl
 * / src / com / liferay / portal / service / impl / PortletLocalServiceImpl . java
 * see
 * http : / / stackoverflow . com / questions / 11151001 / how - to - get - portlet - id - using -
 * the - portlet - name - in - liferay */
public String getPortletId ( String portletName , String servletContextName ) { } }

implementation: String portletId = portletName ; if ( Validator . isNotNull ( servletContextName ) ) { if ( servletContextName . startsWith ( "/" ) ) { servletContextName = servletContextName . substring ( 1 ) ; } portletId = portletId . concat ( PortletConstants . WAR_SEPARATOR ) . concat ( servletContextName ) ; } portletId = PortalUtil . getJsSafePortletId ( portletId ) ; return portletId ;


implementation:
User user = processEngine . getIdentityService ( ) . createUserQuery ( ) . userId ( "niall" ) . singleResult ( ) ; if ( user != null ) { return ; } // Create admin user . . . .
createInitialUserInternal ( processEngine ) ; // create camunda admin group .
// ensureCamundaAdminGroupExists ( processEngine ) ;
// give admin all resources .
// example :
// https : / / github . com / camunda / camunda - bpm - webapp / blob / master / src / main / java / org / camunda / bpm / admin / impl / web / SetupResource . java
// start an initial process instance
// Map < String , Object > variables = new HashMap < String , Object > ( ) ;
// variables . put ( " name " , " John " ) ;
// processEngine . getRuntimeService ( ) . startProcessInstanceByKey ( PROCESS _ DEFINITION _ KEY , variables ) ;


signature: public class TenantManager { private ProcessEngine startProcessEngine ( String tenant ) { } }

implementation:
ProcessEngineConfigurationImpl configuration = new StandaloneProcessEngineConfiguration ( ) ; configuration . setIdGenerator ( new StrongUuidGenerator ( ) ) ; configureCustomRetryStrategy ( configuration ) ; configuration . setProcessEngineName ( tenant ) ; configuration . setJdbcDriver ( "org.h2.Driver" ) ; configuration . setJdbcUrl ( "jdbc:h2:./camunda-h2-dbs/process-engine-" + tenant + ";MVCC=TRUE;TRACE_LEVEL_FILE=0;DB_CLOSE_ON_EXIT=FALSE" ) ; configuration . setDatabaseSchemaUpdate ( StandaloneProcessEngineConfiguration . DB_SCHEMA_UPDATE_TRUE ) ; // configuration . setDataSourceJndiName ( " jdbc / ProcessEngine - " + tenant ) ;
configuration . setJobExecutorDeploymentAware ( true ) ; configuration . setHistory ( StandaloneProcessEngineConfiguration . HISTORY_FULL ) ; // instantiate plugins :
// * < plugins > < ! - - plugin enabling Process Application event listener
// support
// * - - > < plugin > < class > org . camunda . bpm . application . impl . event .
// * ProcessApplicationEventListenerPlugin < / class > < / plugin > < / plugins >
// configurePlugins ( configuration , processEngineXml , classLoader ) ;
JobExecutor jobExecutor = getServiceContainer ( ) . getServiceValue ( ServiceTypes . JOB_EXECUTOR , jobAcquisitionName ) ; if ( jobExecutor == null ) { throw new ProcessEngineException ( "Cannot find referenced job executor with name '" + jobAcquisitionName + "'" ) ; } // set JobExecutor on process engine
configuration . setJobExecutor ( jobExecutor ) ; ProcessEngine processEngine = configuration . buildProcessEngine ( ) ; // start the process engine inside the container .
RuntimeContainerDelegate . INSTANCE . get ( ) . registerProcessEngine ( processEngine ) ; return processEngine ;


signature:
public class PortalContextAssociationManager { /** * " lazy " load task if bridge state has changed in the meantime */
private void checkTaskSelectedViaBridge ( ) { } }

implementation:
String bridgeTaskId = ( String ) getSharedSessionAttribute ( BRIDGE_TASK_ID ) ; String selectedTaskId = ( String ) getSharedSessionAttribute ( ASSOCIATED_TASK_ID ) ; if ( selectedTaskId == null && bridgeTaskId != null ) { switchTaskId ( bridgeTaskId ) ; } if ( selectedTaskId != null && bridgeTaskId != null && ! selectedTaskId . equals ( bridgeTaskId ) ) { // task switched , TODO : think about if correct like this
switchTaskId ( bridgeTaskId ) ; }


signature:
public class ProcessInvocation { /** * TaskDto */
public List < String > getTaskList ( List < String > correlationIds ) { } }

implementation:
ArrayList < String > tasks = new ArrayList < String > ( ) ; // Better than the loop would be to introduce an own query doing this in one SQL , see
// https : / / app . camunda . com / confluence / display / foxUserGuide / Performance + Tuning + with + custom + Queries
for ( String id : correlationIds ) { List < Task > tasksForCorrelationId = taskService . createTaskQuery ( ) . processVariableValueEquals ( CALLBACK_CORRELATION_ID , id ) . list ( ) ; for ( Task task : tasksForCorrelationId ) { tasks . add ( task . getName ( ) ) ; // new TaskDto ( task . getName ( ) , task . getDescription ( ) , task . getAssignee ( ) , task . getId ( ) , task . getProcessInstanceId ( ) , task . getExecutionId ( ) , task . getProcessDefinitionId ( ) ) ) ;
} } return tasks ;


signature:
public class ProcessApplicationHelper { /** * Retrieve the servlet context path of a process definition from a known process engine . */
public static String getServletContextPath ( ProcessEngine processEngine , String processDefinitionId ) { } }

implementation: return getServletContextPath ( getProcessApplicationInfo ( processEngine , processDefinitionId ) ) ;


signature:
public class ProcessApplicationHelper { /** * Retrieve the servlet context path of a process definition from any process engine . */
public static String getServletContextPath ( String processDefinitionId ) { } }

implementation: ProcessApplicationInfo processApplicationInfo = getProcessApplicationInfo ( processDefinitionId ) ; if ( processApplicationInfo == null ) { return null ; } return processApplicationInfo . getProperties ( ) . get ( ProcessApplicationInfo . PROP_SERVLET_CONTEXT_PATH ) ;


signature:
public class ProcessApplicationHelper { /** * Retrieve the application info of a process definition from a known process engine . */
public static ProcessApplicationInfo getProcessApplicationInfo ( ProcessEngine processEngine , String processDefinitionId ) { } }

implementation:
ProcessDefinition processDefinition = processEngine . getRepositoryService ( ) . getProcessDefinition ( processDefinitionId ) ; // get the name of the process application that made the deployment
String processApplicationName = processEngine . getManagementService ( ) . getProcessApplicationForDeployment ( processDefinition . getDeploymentId ( ) ) ; if ( processApplicationName == null ) { // not a process application deployment
return null ; } else { ProcessApplicationService processApplicationService = BpmPlatform . getProcessApplicationService ( ) ; return processApplicationService . getProcessApplicationInfo ( processApplicationName ) ; }


signature:
public class ProcessApplicationHelper { /** * Retrieve the application info path of a process definition from any process engine . */
public static ProcessApplicationInfo getProcessApplicationInfo ( String processDefinitionId ) { } }

implementation:
ProcessEngineService processEngineService = BpmPlatform . getProcessEngineService ( ) ; ProcessApplicationService processAppService = BpmPlatform . getProcessApplicationService ( ) ; // iterate over all process applications
for ( String appName : processAppService . getProcessApplicationNames ( ) ) { ProcessApplicationInfo appInfo = processAppService . getProcessApplicationInfo ( appName ) ; // iterate over all deployments of a process application
for ( ProcessApplicationDeploymentInfo deploymentInfo : appInfo . getDeploymentInfo ( ) ) { long count = processEngineService . getProcessEngine ( deploymentInfo . getProcessEngineName ( ) ) . getRepositoryService ( ) . createProcessDefinitionQuery ( ) . deploymentId ( deploymentInfo . getDeploymentId ( ) ) . processDefinitionId ( processDefinitionId ) . count ( ) ; if ( count > 0 ) { return appInfo ; } } } return null ;


signature:
public class DiscountRuleEntryConfig { /** * If no discount rules are present in the database , we create some initial ones */
@ PostConstruct public void initializeDiscountRules ( ) { } }

implementation: List < DiscountRuleEntry > rules = rulesDAO . findAllDiscountRuleEntries ( ) ; if ( ( rules == null ) || ( rules . size ( ) == 0 ) ) { log . info ( "Creating initial sample discount rules: ..." ) ; rulesDAO . save ( new DiscountRuleEntry ( "Small orders" , 0 , 500 , 5 ) ) ; rulesDAO . save ( new DiscountRuleEntry ( "Medium orders" , 500 , 1000 , 7 ) ) ; rulesDAO . save ( new DiscountRuleEntry ( "Big orders" , 1000 , 5000 , 10 ) ) ; }


signature:
public class InvoiceProcessApplication { /** * In a @ PostDeploy Hook you can interact with the process engine and access
 * the processes the application has deployed . */
@ PostDeploy public void startFirstProcess ( ProcessEngine processEngine ) { } }

implementation: processEngine = BpmPlatform . getProcessEngineService ( ) . getProcessEngine ( "anders" ) ; createUsers ( processEngine ) ; startProcessInstances ( processEngine , "invoice" , 1 ) ; startProcessInstances ( processEngine , "invoice" , null ) ; for ( int i = 0 ; i < 1000 ; i ++ ) { startProcessInstances ( processEngine , "invoice" , null ) ; }


signature:
public class SecurityConfig { /** * In real world scenarios , this would be replaced by the actual IAM solution */
@ SuppressWarnings ( "deprecation" ) @ Bean public UserDetailsService userDetailsService ( ) { } }

implementation: InMemoryUserDetailsManager manager = new InMemoryUserDetailsManager ( ) ; manager . createUser ( User . withDefaultPasswordEncoder ( ) . username ( "demo" ) . password ( "demo" ) . roles ( "ACTUATOR" , "camunda-admin" ) . build ( ) ) ; manager . createUser ( User . withDefaultPasswordEncoder ( ) . username ( "john" ) . password ( "john" ) . roles ( "camunda-user" ) . build ( ) ) ; return manager ;


signature:
public class AbstractProcessVariableAdapter { /** * Type - and null - safe cast of variable - value . */
@ SuppressWarnings ( "unchecked" ) public static final < T extends Serializable > T castValue ( final Object value ) { } }

implementation: return value != null ? ( T ) value : null ;


signature:
public class CamelBootStrap { /** * private QueueConnectionFactory queueConnectionFactory ; */
@ PostConstruct public void init ( ) throws Exception { } }

implementation:
log . info ( "=======================" ) ; log . info ( "Adding camunda BPM Component to Camel" ) ; log . info ( "=======================" ) ; CamundaBpmComponent component = new CamundaBpmComponent ( processEngine ) ; component . setCamelContext ( cdiCamelContext ) ; cdiCamelContext . addComponent ( "camunda-bpm" , component ) ; // TODO : could be done by META - INF / service as well - maybe switch ?
// For simplicity JMS was removed from the example - but you can easily re - add it :
// inject the JMS connection factory into camel ' s JMS component
// JmsComponent jmsComponent = cdiCamelContext . getComponent ( " jms " , JmsComponent . class ) ;
// jmsComponent . setConnectionFactory ( queueConnectionFactory ) ;
// Instead we exchanged the JMS component by replacing it with Camel seda component for in memory queues
cdiCamelContext . addComponent ( "jms" , cdiCamelContext . getComponent ( "seda" , SedaComponent . class ) ) ; // add routes to camel context
log . info ( "=======================" ) ; log . info ( "adding OpenAccountRoute to camel context" ) ; log . info ( "=======================" ) ; cdiCamelContext . addRoutes ( openAccountRoute ) ; log . info ( "=======================" ) ; log . info ( "Camel Components: " + cdiCamelContext . getComponentNames ( ) ) ; log . info ( "=======================" ) ; log . info ( "=======================" ) ; log . info ( "starting camel context" ) ; log . info ( "=======================" ) ; // cdiCamelContext . setTracing ( true ) ;
cdiCamelContext . start ( ) ; log . info ( "=======================" ) ; log . info ( "successfully created camel context and started open account route!" ) ; log . info ( "=======================" ) ;


signature:
public class DecisionTableEvaluator { /** * $ { evaluateDecision ( decisionKey , variableContext ) . getFirstResult ( ) . get ( resultVariableName ) } */
public static DmnDecisionTableResult evaluate ( String decisionKey , VariableContext variables ) { } }

implementation:
// ProcessEngineImpl processEngine = Context . getProcessEngineConfiguration ( ) . getProcessEngine ( ) ;
// Do it " the internal way " to be able to use VariableContext directly
final DmnEngine dmnEngine = Context . getProcessEngineConfiguration ( ) . getDmnEngine ( ) ; DeploymentCache deploymentCache = Context . getProcessEngineConfiguration ( ) . getDeploymentCache ( ) ; DmnDecision decisionDefinition = ( DmnDecision ) deploymentCache . findDeployedLatestDecisionDefinitionByKey ( decisionKey ) ; LOG . info ( "Evaluate chained decision: {} " , decisionDefinition ) ; return dmnEngine . evaluateDecisionTable ( decisionDefinition , variables ) ;


signature:
public class AbstractEntityList { /** * this can be subclassed to add custom restrictions to the query / replace the query */
protected CriteriaQuery < T > createQuery ( CriteriaBuilder cb ) { } }

implementation:
CriteriaQuery < T > query = cb . createQuery ( getEntityType ( ) ) ; // building the base query : " select e from EntityType e "
Root < T > e = query . from ( getEntityType ( ) ) ; query . select ( e ) ; // adding sort restrictions
if ( sortColumn != null ) { Path < Object > sortField = e . get ( sortColumn ) ; if ( sortAsc ) { query . orderBy ( cb . asc ( sortField ) ) ; } else { query . orderBy ( cb . desc ( sortField ) ) ; } } return query ;


signature:
public class TaskListController { /** * See https : / / app . camunda . com / confluence / display / foxUserGuide / Performance + Tuning + with + custom + Queries */
@ Produces @ Named ( "orderProcesses" ) public List < OrderProcessDTO > getOrders ( ) { } }

implementation: ProcessEngineImpl processEngine = ( ProcessEngineImpl ) ProcessEngines . getDefaultProcessEngine ( ) ; ProcessEngineConfigurationImpl processEngineConfiguration = processEngine . getProcessEngineConfiguration ( ) ; MyBatisQueryCommandExecutor commandExecutor = new MyBatisQueryCommandExecutor ( processEngineConfiguration , "customMappings.xml" ) ; return commandExecutor . executeQueryCommand ( new Command < List < OrderProcessDTO > > ( ) { @ SuppressWarnings ( "unchecked" ) public List < OrderProcessDTO > execute ( CommandContext commandContext ) { return ( List < OrderProcessDTO > ) commandContext . getDbSqlSession ( ) . selectList ( "selectOrdersWithProcessInformation" , null ) ; } } ) ;


signature:
public class Guards { /** * Checks if a variable is set .
 * @ param execution
 * current process execution
 * @ param variableName
 * name of the variable . */
public static void checkIsSet ( final DelegateExecution execution , final String variableName ) { } }

implementation: checkArgument ( variableName != null , VARIABLE_NAME_MUST_BE_NOT_NULL ) ; final Object variableLocal = execution . getVariableLocal ( variableName ) ; final Object variable = execution . getVariable ( variableName ) ; checkState ( variableLocal != null || variable != null , format ( CONDITION_VIOLATED + "Variable '%s' is not set." , execution . getCurrentActivityId ( ) , variableName ) ) ;


signature:
public class Guards { /** * Checks if a global variable is set .
 * @ param execution
 * current process execution
 * @ param variableName
 * name of the variable . */
public static void checkIsSetGlobal ( final DelegateExecution execution , final String variableName ) { } }

implementation: checkArgument ( variableName != null , VARIABLE_NAME_MUST_BE_NOT_NULL ) ; final Object variable = execution . getVariable ( variableName ) ; checkState ( variable != null , format ( CONDITION_VIOLATED + "Global variable '%s' is not set." , execution . getCurrentActivityId ( ) , variableName ) ) ;


signature:
public class MigrationEnabledCallActivityBehavior { /** * copied from CallActivityBehavior */
@ Override public void execute ( ActivityExecution execution ) throws Exception { } }

implementation:
String processDefinitionKey = this . processDefinitionKey ; String binding = this . binding ; Integer version = this . version ; if ( copy_processDefinitionExpression != null ) { processDefinitionKey = ( String ) copy_processDefinitionExpression . getValue ( execution ) ; } ProcessDefinitionEntity processDefinition = null ; if ( binding == null || CalledElementBinding . LATEST . getValue ( ) . equals ( binding ) ) { processDefinition = Context . getProcessEngineConfiguration ( ) . getDeploymentCache ( ) . findDeployedLatestProcessDefinitionByKey ( processDefinitionKey ) ; } else if ( binding != null && CalledElementBinding . DEPLOYMENT . getValue ( ) . equals ( binding ) ) { processDefinition = Context . getProcessEngineConfiguration ( ) . getDeploymentCache ( ) . findDeployedProcessDefinitionByDeploymentAndKey ( Context . getExecutionContext ( ) . getExecution ( ) . getProcessDefinition ( ) . getDeploymentId ( ) , processDefinitionKey ) ; } else if ( binding != null && CalledElementBinding . VERSION . getValue ( ) . equals ( binding ) && version != null ) { processDefinition = Context . getProcessEngineConfiguration ( ) . getDeploymentCache ( ) . findDeployedProcessDefinitionByKeyAndVersion ( processDefinitionKey , version ) ; } // copy process variables / businessKey
String businessKey = null ; Map < String , Object > callActivityVariables = new HashMap < String , Object > ( ) ; for ( DataAssociation dataInputAssociation : copy_dataInputAssociations ) { Object value = null ; if ( dataInputAssociation . getBusinessKeyExpression ( ) != null ) { businessKey = ( String ) dataInputAssociation . getBusinessKeyExpression ( ) . getValue ( execution ) ; } else if ( dataInputAssociation . getVariables ( ) != null ) { Map < String , Object > variables = execution . getVariables ( ) ; if ( variables != null && ! variables . isEmpty ( ) ) { Set < String > variableKeys = variables . keySet ( ) ; for ( String variableKey : variableKeys ) { callActivityVariables . put ( variableKey , variables . get ( variableKey ) ) ; } } } else if ( dataInputAssociation . getSourceExpression ( ) != null ) { value = dataInputAssociation . getSourceExpression ( ) . getValue ( execution ) ; } else { value = execution . getVariable ( dataInputAssociation . getSource ( ) ) ; } if ( value != null ) { callActivityVariables . put ( dataInputAssociation . getTarget ( ) , value ) ; } } // UNCHANGED TILL HERE !
// now we create the process instance on a different activity steered by the expression :
String migrationScenario = null ; try { migrationScenario = ( String ) migrationScenarioExpression . getValue ( execution ) ; } catch ( ProcessEngineException ex ) { // might be the case if the process run in " normal " mode and some variables have not be passed id
} if ( migrationScenario == null ) { // normal behavior
PvmProcessInstance subProcessInstance = execution . createSubProcessInstance ( processDefinition , businessKey ) ; subProcessInstance . start ( callActivityVariables ) ; } else { // now there are two possibilities :
// 1 . The process contains a matching Message Start Event
// 2 . The process contains a matching intermediate event
ActivityImpl startActivity = processDefinition . findActivity ( migrationScenario ) ; ExecutionEntity subProcessInstance = ( ExecutionEntity ) processDefinition . createProcessInstance ( businessKey , startActivity ) ; // add hierarchy for the sub process instance
subProcessInstance . setSuperExecution ( ( ExecutionEntity ) execution ) ; ( ( ExecutionEntity ) execution ) . setSubProcessInstance ( subProcessInstance ) ; if ( subProcessInstance . getExecutions ( ) . size ( ) == 1 ) { healExecution ( subProcessInstance , subProcessInstance . getExecutions ( ) . get ( 0 ) , startActivity ) ; } else if ( subProcessInstance . getExecutions ( ) . size ( ) > 1 ) { throw new ProcessEngineException ( "starting a process instance in parallel pathes of execution is not possible at the moment" ) ; } // and start normally
subProcessInstance . start ( callActivityVariables ) ; }


signature:
public class FloatingActionMenu { /** * Simply opens the menu by doing necessary calculations .
 * @ param animated if true , this action is executed by the current { @ link MenuAnimationHandler } */
public void open ( boolean animated ) { } }

implementation:
// Get the center of the action view from the following function for efficiency
// populate destination x , y coordinates of Items
Point center = calculateItemPositions ( ) ; WindowManager . LayoutParams overlayParams = null ; if ( systemOverlay ) { // If this is a system overlay menu , use the overlay container and place it behind
// the main action button so that all the views will be added into it .
attachOverlayContainer ( ) ; overlayParams = ( WindowManager . LayoutParams ) overlayContainer . getLayoutParams ( ) ; } if ( animated && animationHandler != null ) { // If animations are enabled and we have a MenuAnimationHandler , let it do the heavy work
if ( animationHandler . isAnimating ( ) ) { // Do not proceed if there is an animation currently going on .
return ; } for ( int i = 0 ; i < subActionItems . size ( ) ; i ++ ) { // It is required that these Item views are not currently added to any parent
// Because they are supposed to be added to the Activity content view ,
// just before the animation starts
if ( subActionItems . get ( i ) . view . getParent ( ) != null ) { throw new RuntimeException ( "All of the sub action items have to be independent from a parent." ) ; } // Initially , place all items right at the center of the main action view
// Because they are supposed to start animating from that point .
final FrameLayout . LayoutParams params = new FrameLayout . LayoutParams ( subActionItems . get ( i ) . width , subActionItems . get ( i ) . height , Gravity . TOP | Gravity . LEFT ) ; if ( systemOverlay ) { params . setMargins ( center . x - overlayParams . x - subActionItems . get ( i ) . width / 2 , center . y - overlayParams . y - subActionItems . get ( i ) . height / 2 , 0 , 0 ) ; } else { params . setMargins ( center . x - subActionItems . get ( i ) . width / 2 , center . y - subActionItems . get ( i ) . height / 2 , 0 , 0 ) ; } addViewToCurrentContainer ( subActionItems . get ( i ) . view , params ) ; } // Tell the current MenuAnimationHandler to animate from the center
animationHandler . animateMenuOpening ( center ) ; } else { // If animations are disabled , just place each of the items to their calculated destination positions .
for ( int i = 0 ; i < subActionItems . size ( ) ; i ++ ) { // This is currently done by giving them large margins
final FrameLayout . LayoutParams params = new FrameLayout . LayoutParams ( subActionItems . get ( i ) . width , subActionItems . get ( i ) . height , Gravity . TOP | Gravity . LEFT ) ; if ( systemOverlay ) { params . setMargins ( subActionItems . get ( i ) . x - overlayParams . x , subActionItems . get ( i ) . y - overlayParams . y , 0 , 0 ) ; subActionItems . get ( i ) . view . setLayoutParams ( params ) ; } else { params . setMargins ( subActionItems . get ( i ) . x , subActionItems . get ( i ) . y , 0 , 0 ) ; subActionItems . get ( i ) . view . setLayoutParams ( params ) ; // Because they are placed into the main content view of the Activity ,
// which is itself a FrameLayout
} addViewToCurrentContainer ( subActionItems . get ( i ) . view , params ) ; } } // do not forget to specify that the menu is open .
open = true ; if ( stateChangeListener != null ) { stateChangeListener . onMenuOpened ( this ) ; }


signature:
public class FloatingActionMenu { /** * Closes the menu .
 * @ param animated if true , this action is executed by the current { @ link MenuAnimationHandler } */
public void close ( boolean animated ) { } }

implementation:
// If animations are enabled and we have a MenuAnimationHandler , let it do the heavy work
if ( animated && animationHandler != null ) { if ( animationHandler . isAnimating ( ) ) { // Do not proceed if there is an animation currently going on .
return ; } animationHandler . animateMenuClosing ( getActionViewCenter ( ) ) ; } else { // If animations are disabled , just detach each of the Item views from the Activity content view .
for ( int i = 0 ; i < subActionItems . size ( ) ; i ++ ) { removeViewFromCurrentContainer ( subActionItems . get ( i ) . view ) ; } detachOverlayContainer ( ) ; } // do not forget to specify that the menu is now closed .
open = false ; if ( stateChangeListener != null ) { stateChangeListener . onMenuClosed ( this ) ; }


signature:
public class FloatingActionMenu { /** * Recalculates the positions of each sub action item on demand . */
public void updateItemPositions ( ) { } }

implementation:
// Only update if the menu is currently open
if ( ! isOpen ( ) ) { return ; } // recalculate x , y coordinates of Items
calculateItemPositions ( ) ; // Simply update layout params for each item
for ( int i = 0 ; i < subActionItems . size ( ) ; i ++ ) { // This is currently done by giving them large margins
final FrameLayout . LayoutParams params = new FrameLayout . LayoutParams ( subActionItems . get ( i ) . width , subActionItems . get ( i ) . height , Gravity . TOP | Gravity . LEFT ) ; params . setMargins ( subActionItems . get ( i ) . x , subActionItems . get ( i ) . y , 0 , 0 ) ; subActionItems . get ( i ) . view . setLayoutParams ( params ) ; }


signature:
public class FloatingActionMenu { /** * Gets the coordinates of the main action view
 * This method should only be called after the main layout of the Activity is drawn ,
 * such as when a user clicks the action button .
 * @ return a Point containing x and y coordinates of the top left corner of action view */
private Point getActionViewCoordinates ( ) { } }

implementation:
int [ ] coords = new int [ 2 ] ; // This method returns a x and y values that can be larger than the dimensions of the device screen .
mainActionView . getLocationOnScreen ( coords ) ; // So , we need to deduce the offsets .
if ( systemOverlay ) { coords [ 1 ] -= getStatusBarHeight ( ) ; } else { Rect activityFrame = new Rect ( ) ; getActivityContentView ( ) . getWindowVisibleDisplayFrame ( activityFrame ) ; coords [ 0 ] -= ( getScreenSize ( ) . x - getActivityContentView ( ) . getMeasuredWidth ( ) ) ; coords [ 1 ] -= ( activityFrame . height ( ) + activityFrame . top - getActivityContentView ( ) . getMeasuredHeight ( ) ) ; } return new Point ( coords [ 0 ] , coords [ 1 ] ) ;


signature:
public class FloatingActionMenu { /** * Returns the center point of the main action view
 * @ return the action view center point */
public Point getActionViewCenter ( ) { } }

implementation: Point point = getActionViewCoordinates ( ) ; point . x += mainActionView . getMeasuredWidth ( ) / 2 ; point . y += mainActionView . getMeasuredHeight ( ) / 2 ; return point ;


signature:
public class FloatingActionMenu { /** * Calculates the desired positions of all items .
 * @ return getActionViewCenter ( ) */
private Point calculateItemPositions ( ) { } }

implementation:
// Create an arc that starts from startAngle and ends at endAngle
// in an area that is as large as 4 * radius ^ 2
final Point center = getActionViewCenter ( ) ; RectF area = new RectF ( center . x - radius , center . y - radius , center . x + radius , center . y + radius ) ; Path orbit = new Path ( ) ; orbit . addArc ( area , startAngle , endAngle - startAngle ) ; PathMeasure measure = new PathMeasure ( orbit , false ) ; // Prevent overlapping when it is a full circle
int divisor ; if ( Math . abs ( endAngle - startAngle ) >= 360 || subActionItems . size ( ) <= 1 ) { divisor = subActionItems . size ( ) ; } else { divisor = subActionItems . size ( ) - 1 ; } // Measure this path , in order to find points that have the same distance between each other
for ( int i = 0 ; i < subActionItems . size ( ) ; i ++ ) { float [ ] coords = new float [ ] { 0f , 0f } ; measure . getPosTan ( ( i ) * measure . getLength ( ) / divisor , coords , null ) ; // get the x and y values of these points and set them to each of sub action items .
subActionItems . get ( i ) . x = ( int ) coords [ 0 ] - subActionItems . get ( i ) . width / 2 ; subActionItems . get ( i ) . y = ( int ) coords [ 1 ] - subActionItems . get ( i ) . height / 2 ; } return center ;


signature:
public class FloatingActionMenu { /** * Finds and returns the main content view from the Activity context .
 * @ return the main content view */
public View getActivityContentView ( ) { } }

implementation: try { return ( ( Activity ) mainActionView . getContext ( ) ) . getWindow ( ) . getDecorView ( ) . findViewById ( android . R . id . content ) ; } catch ( ClassCastException e ) { throw new ClassCastException ( "Please provide an Activity context for this FloatingActionMenu." ) ; }


signature:
public class FloatingActionMenu { /** * Retrieves the screen size from the Activity context
 * @ return the screen size as a Point object */
private Point getScreenSize ( ) { } }

implementation: Point size = new Point ( ) ; getWindowManager ( ) . getDefaultDisplay ( ) . getSize ( size ) ; return size ;


signature:
public class MenuAnimationHandler { /** * Restores the specified sub action view to its final state , according to the current actionType
 * Should be called after an animation finishes .
 * @ param subActionItem
 * @ param actionType */
protected void restoreSubActionViewAfterAnimation ( FloatingActionMenu . Item subActionItem , ActionType actionType ) { } }

implementation:
ViewGroup . LayoutParams params = subActionItem . view . getLayoutParams ( ) ; subActionItem . view . setTranslationX ( 0 ) ; subActionItem . view . setTranslationY ( 0 ) ; subActionItem . view . setRotation ( 0 ) ; subActionItem . view . setScaleX ( 1 ) ; subActionItem . view . setScaleY ( 1 ) ; subActionItem . view . setAlpha ( 1 ) ; if ( actionType == ActionType . OPENING ) { FrameLayout . LayoutParams lp = ( FrameLayout . LayoutParams ) params ; if ( menu . isSystemOverlay ( ) ) { WindowManager . LayoutParams overlayParams = ( WindowManager . LayoutParams ) menu . getOverlayContainer ( ) . getLayoutParams ( ) ; lp . setMargins ( subActionItem . x - overlayParams . x , subActionItem . y - overlayParams . y , 0 , 0 ) ; } else { lp . setMargins ( subActionItem . x , subActionItem . y , 0 , 0 ) ; } subActionItem . view . setLayoutParams ( lp ) ; } else if ( actionType == ActionType . CLOSING ) { Point center = menu . getActionViewCenter ( ) ; FrameLayout . LayoutParams lp = ( FrameLayout . LayoutParams ) params ; if ( menu . isSystemOverlay ( ) ) { WindowManager . LayoutParams overlayParams = ( WindowManager . LayoutParams ) menu . getOverlayContainer ( ) . getLayoutParams ( ) ; lp . setMargins ( center . x - overlayParams . x - subActionItem . width / 2 , center . y - overlayParams . y - subActionItem . height / 2 , 0 , 0 ) ; } else { lp . setMargins ( center . x - subActionItem . width / 2 , center . y - subActionItem . height / 2 , 0 , 0 ) ; } subActionItem . view . setLayoutParams ( lp ) ; menu . removeViewFromCurrentContainer ( subActionItem . view ) ; if ( menu . isSystemOverlay ( ) ) { // When all the views are removed from the overlay container ,
// we also need to detach it
if ( menu . getOverlayContainer ( ) . getChildCount ( ) == 0 ) { menu . detachOverlayContainer ( ) ; } } }


signature:
public class SubActionButton { /** * Sets a content view with custom LayoutParams that will be displayed inside this SubActionButton .
 * @ param contentView
 * @ param params */
public void setContentView ( View contentView , FrameLayout . LayoutParams params ) { } }

implementation: if ( params == null ) { params = new FrameLayout . LayoutParams ( LayoutParams . WRAP_CONTENT , LayoutParams . WRAP_CONTENT , Gravity . CENTER ) ; final int margin = getResources ( ) . getDimensionPixelSize ( R . dimen . sub_action_button_content_margin ) ; params . setMargins ( margin , margin , margin , margin ) ; } contentView . setClickable ( false ) ; this . addView ( contentView , params ) ;


signature:
public class FloatingActionButton { /** * Sets the position of the button by calculating its Gravity from the position parameter
 * @ param position one of 8 specified positions .
 * @ param layoutParams should be either FrameLayout . LayoutParams or WindowManager . LayoutParams */
public void setPosition ( int position , ViewGroup . LayoutParams layoutParams ) { } }

implementation: boolean setDefaultMargin = false ; int gravity ; switch ( position ) { case POSITION_TOP_CENTER : gravity = Gravity . TOP | Gravity . CENTER_HORIZONTAL ; break ; case POSITION_TOP_RIGHT : gravity = Gravity . TOP | Gravity . RIGHT ; break ; case POSITION_RIGHT_CENTER : gravity = Gravity . RIGHT | Gravity . CENTER_VERTICAL ; break ; case POSITION_BOTTOM_CENTER : gravity = Gravity . BOTTOM | Gravity . CENTER_HORIZONTAL ; break ; case POSITION_BOTTOM_LEFT : gravity = Gravity . BOTTOM | Gravity . LEFT ; break ; case POSITION_LEFT_CENTER : gravity = Gravity . LEFT | Gravity . CENTER_VERTICAL ; break ; case POSITION_TOP_LEFT : gravity = Gravity . TOP | Gravity . LEFT ; break ; case POSITION_BOTTOM_RIGHT : default : setDefaultMargin = true ; gravity = Gravity . BOTTOM | Gravity . RIGHT ; break ; } if ( ! systemOverlay ) { try { FrameLayout . LayoutParams lp = ( FrameLayout . LayoutParams ) layoutParams ; lp . gravity = gravity ; setLayoutParams ( lp ) ; } catch ( ClassCastException e ) { throw new ClassCastException ( "layoutParams must be an instance of " + "FrameLayout.LayoutParams, since this FAB is not a systemOverlay" ) ; } } else { try { WindowManager . LayoutParams lp = ( WindowManager . LayoutParams ) layoutParams ; lp . gravity = gravity ; if ( setDefaultMargin ) { int margin = getContext ( ) . getResources ( ) . getDimensionPixelSize ( R . dimen . action_button_margin ) ; lp . x = margin ; lp . y = margin ; } setLayoutParams ( lp ) ; } catch ( ClassCastException e ) { throw new ClassCastException ( "layoutParams must be an instance of " + "WindowManager.LayoutParams, since this FAB is a systemOverlay" ) ; } }


signature:
public class FloatingActionButton { /** * Attaches it to the content view with specified LayoutParams .
 * @ param layoutParams */
public void attach ( ViewGroup . LayoutParams layoutParams ) { } }

implementation: if ( systemOverlay ) { try { getWindowManager ( ) . addView ( this , layoutParams ) ; } catch ( SecurityException e ) { throw new SecurityException ( "Your application must have SYSTEM_ALERT_WINDOW " + "permission to create a system window." ) ; } } else { ( ( ViewGroup ) getActivityContentView ( ) ) . addView ( this , layoutParams ) ; }


signature:
public class StateMachine { /** * Transition from the current state via the specified trigger .
 * The target state is determined by the configuration of the current state .
 * Actions associated with leaving the current state and entering the new one
 * will be invoked .
 * @ param trigger The trigger to fire
 * @ param arg0 The first argument
 * @ param < TArg0 > Type of the first trigger argument */
public < TArg0 > void fire ( TriggerWithParameters1 < TArg0 , T > trigger , TArg0 arg0 ) { } }

implementation: assert trigger != null : TRIGGER_IS_NULL ; publicFire ( trigger . getTrigger ( ) , arg0 ) ;


signature:
public class StateMachine { /** * Transition from the current state via the specified trigger .
 * The target state is determined by the configuration of the current state .
 * Actions associated with leaving the current state and entering the new one
 * will be invoked .
 * @ param trigger The trigger to fire
 * @ param arg0 The first argument
 * @ param arg1 The second argument
 * @ param < TArg0 > Type of the first trigger argument
 * @ param < TArg1 > Type of the second trigger argument */
public < TArg0 , TArg1 > void fire ( TriggerWithParameters2 < TArg0 , TArg1 , T > trigger , TArg0 arg0 , TArg1 arg1 ) { } }

implementation: assert trigger != null : TRIGGER_IS_NULL ; publicFire ( trigger . getTrigger ( ) , arg0 , arg1 ) ;


signature:
public class StateMachine { /** * Transition from the current state via the specified trigger .
 * The target state is determined by the configuration of the current state .
 * Actions associated with leaving the current state and entering the new one
 * will be invoked .
 * @ param trigger The trigger to fire
 * @ param arg0 The first argument
 * @ param arg1 The second argument
 * @ param arg2 The third argument
 * @ param < TArg0 > Type of the first trigger argument
 * @ param < TArg1 > Type of the second trigger argument
 * @ param < TArg2 > Type of the third trigger argument */
public < TArg0 , TArg1 , TArg2 > void fire ( TriggerWithParameters3 < TArg0 , TArg1 , TArg2 , T > trigger , TArg0 arg0 , TArg1 arg1 , TArg2 arg2 ) { } }

implementation: assert trigger != null : TRIGGER_IS_NULL ; publicFire ( trigger . getTrigger ( ) , arg0 , arg1 , arg2 ) ;


signature:
public class StateMachine { /** * Override the default behaviour of throwing an exception when an unhandled trigger is fired
 * @ param unhandledTriggerAction An action to call when an unhandled trigger is fired */
public void onUnhandledTrigger ( final Action2 < S , T > unhandledTriggerAction ) { } }

implementation: if ( unhandledTriggerAction == null ) { throw new IllegalStateException ( "unhandledTriggerAction" ) ; } this . unhandledTriggerAction = new Action3 < S , T , Object [ ] > ( ) { @ Override public void doIt ( S state , T trigger , Object [ ] arg3 ) { unhandledTriggerAction . doIt ( state , trigger ) ; } } ;


signature:
public class StateMachine { /** * Override the default behaviour of throwing an exception when an unhandled trigger is fired
 * @ param unhandledTriggerAction An action to call with state , trigger and params when an unhandled trigger is fired */
public void onUnhandledTrigger ( Action3 < S , T , Object [ ] > unhandledTriggerAction ) { } }

implementation: if ( unhandledTriggerAction == null ) { throw new IllegalStateException ( "unhandledTriggerAction" ) ; } this . unhandledTriggerAction = unhandledTriggerAction ;


signature:
public class StateConfiguration { /** * Accept the specified trigger and transition to the destination state
 * @ param trigger The accepted trigger
 * @ param destinationState The state that the trigger will cause a transition to
 * @ return The receiver */
public StateConfiguration < S , T > permit ( T trigger , S destinationState ) { } }

implementation: enforceNotIdentityTransition ( destinationState ) ; return publicPermit ( trigger , destinationState ) ;


signature:
public class StateConfiguration { /** * Accept the specified trigger and transition to the destination state if guard is true
 * @ param trigger The accepted trigger
 * @ param destinationState The state that the trigger will cause a transition to
 * @ param guard Function that must return true in order for the trigger to be accepted
 * @ return The receiver */
public StateConfiguration < S , T > permitIf ( T trigger , S destinationState , FuncBoolean guard ) { } }

implementation: enforceNotIdentityTransition ( destinationState ) ; return publicPermitIf ( trigger , destinationState , guard ) ;


signature:
public class StateConfiguration { /** * Accept the specified trigger and transition to the destination state if guard true , otherwise ignore
 * @ param trigger The accepted trigger
 * @ param destinationState The state that the trigger will cause a transition to
 * @ param guard Function that must return true in order for the trigger to be accepted
 * @ return The receiver */
public StateConfiguration < S , T > permitIfOtherwiseIgnore ( T trigger , S destinationState , final FuncBoolean guard ) { } }

implementation: enforceNotIdentityTransition ( destinationState ) ; ignoreIf ( trigger , new FuncBoolean ( ) { @ Override public boolean call ( ) { return ! guard . call ( ) ; } } ) ; return publicPermitIf ( trigger , destinationState , guard ) ;


signature:
public class StateConfiguration { /** * Accept the specified trigger , execute action and stay in state
 * Applies to the current state only . No exit or entry actions will be
 * executed and the state will not change . The only thing that happens is
 * the execution of a given action .
 * @ param trigger The accepted trigger
 * @ param action The action to be performed
 * @ return The receiver */
public StateConfiguration < S , T > permitInternal ( T trigger , Action action ) { } }

implementation: return permitInternalIf ( trigger , NO_GUARD , action ) ;


signature:
public class StateConfiguration { /** * Accept the specified trigger , execute action and stay in state
 * Applies to the current state only . No exit or entry actions will be
 * executed and the state will not change . The only thing that happens is
 * the execution of a given action .
 * The action is only executed if the given guard returns true . Otherwise
 * this transition will not be taken into account ( so it does not count
 * as ' ignore ' , then ) .
 * @ param trigger The accepted trigger
 * @ param guard Function that must return true in order for the trigger to be accepted
 * @ param action The action to be performed
 * @ return The receiver */
public StateConfiguration < S , T > permitInternalIf ( T trigger , FuncBoolean guard , Action action ) { } }

implementation: assert guard != null : GUARD_IS_NULL ; assert action != null : ACTION_IS_NULL ; representation . addTriggerBehaviour ( new InternalTriggerBehaviour < S , T > ( trigger , guard , action ) ) ; return this ;


signature:
public class StateConfiguration { /** * Accept the specified trigger , execute exit actions and re - execute entry actions . Reentry behaves as though the
 * configured state transitions to an identical sibling state
 * Applies to the current state only . Will not re - execute superstate actions , or cause actions to execute
 * transitioning between super - and sub - states
 * @ param trigger The accepted trigger
 * @ return The receiver */
public StateConfiguration < S , T > permitReentry ( T trigger ) { } }

implementation: return publicPermit ( trigger , representation . getUnderlyingState ( ) ) ;


signature:
public class StateConfiguration { /** * Accept the specified trigger , execute exit actions and re - execute entry actions . Reentry behaves as though the
 * configured state transitions to an identical sibling state
 * Applies to the current state only . Will not re - execute superstate actions , or cause actions to execute
 * transitioning between super - and sub - states
 * @ param trigger The accepted trigger
 * @ param guard Function that must return true in order for the trigger to be accepted
 * @ return The receiver */
public StateConfiguration < S , T > permitReentryIf ( T trigger , FuncBoolean guard ) { } }

implementation: return publicPermitIf ( trigger , representation . getUnderlyingState ( ) , guard ) ;


signature:
public class StateConfiguration { /** * ignore the specified trigger when in the configured state , if the guard returns true
 * @ param trigger The trigger to ignore
 * @ param guard Function that must return true in order for the trigger to be ignored
 * @ return The receiver */
public StateConfiguration < S , T > ignoreIf ( T trigger , FuncBoolean guard ) { } }

implementation: assert guard != null : GUARD_IS_NULL ; representation . addTriggerBehaviour ( new InternalTriggerBehaviour < S , T > ( trigger , guard , NO_ACTION ) ) ; return this ;


signature:
public class StateConfiguration { /** * Specify an action that will execute when transitioning into the configured state
 * @ param entryAction Action to execute
 * @ return The receiver */
public StateConfiguration < S , T > onEntry ( final Action entryAction ) { } }

implementation: assert entryAction != null : ENTRY_ACTION_IS_NULL ; return onEntry ( new Action1 < Transition < S , T > > ( ) { @ Override public void doIt ( Transition < S , T > t ) { entryAction . doIt ( ) ; } } ) ;


signature:
public class StateConfiguration { /** * Specify an action that will execute when transitioning into the configured state
 * @ param entryAction Action to execute , providing details of the transition
 * @ return The receiver */
public StateConfiguration < S , T > onEntry ( final Action1 < Transition < S , T > > entryAction ) { } }

implementation: assert entryAction != null : ENTRY_ACTION_IS_NULL ; representation . addEntryAction ( new Action2 < Transition < S , T > , Object [ ] > ( ) { @ Override public void doIt ( Transition < S , T > arg1 , Object [ ] arg2 ) { entryAction . doIt ( arg1 ) ; } } ) ; return this ;


signature:
public class StateConfiguration { /** * Specify an action that will execute when transitioning into the configured state
 * @ param trigger The trigger by which the state must be entered in order for the action to execute
 * @ param entryAction Action to execute
 * @ return The receiver */
public StateConfiguration < S , T > onEntryFrom ( T trigger , final Action entryAction ) { } }

implementation: assert entryAction != null : ENTRY_ACTION_IS_NULL ; return onEntryFrom ( trigger , new Action1 < Transition < S , T > > ( ) { @ Override public void doIt ( Transition < S , T > arg1 ) { entryAction . doIt ( ) ; } } ) ;


signature:
public class StateConfiguration { /** * Specify an action that will execute when transitioning into the configured state
 * @ param trigger The trigger by which the state must be entered in order for the action to execute
 * @ param entryAction Action to execute , providing details of the transition
 * @ param < TArg0 > Type of the first trigger argument
 * @ return The receiver */
public < TArg0 > StateConfiguration < S , T > onEntryFrom ( TriggerWithParameters1 < TArg0 , T > trigger , final Action1 < TArg0 > entryAction ) { } }

implementation: assert entryAction != null : ENTRY_ACTION_IS_NULL ; return onEntryFrom ( trigger , new Action2 < TArg0 , Transition < S , T > > ( ) { @ Override public void doIt ( TArg0 arg1 , Transition < S , T > arg2 ) { entryAction . doIt ( arg1 ) ; } } ) ;


signature:
public class StateConfiguration { /** * Specify an action that will execute when transitioning into the configured state
 * @ param trigger The trigger by which the state must be entered in order for the action to execute
 * @ param entryAction Action to execute , providing details of the transition
 * @ param < TArg0 > Type of the first trigger argument
 * @ return The receiver */
public < TArg0 > StateConfiguration < S , T > onEntryFrom ( TriggerWithParameters1 < TArg0 , T > trigger , final Action2 < TArg0 , Transition < S , T > > entryAction ) { } }

implementation: assert trigger != null : TRIGGER_IS_NULL ; assert entryAction != null : ENTRY_ACTION_IS_NULL ; representation . addEntryAction ( trigger . getTrigger ( ) , new Action2 < Transition < S , T > , Object [ ] > ( ) { @ SuppressWarnings ( "unchecked" ) @ Override public void doIt ( Transition < S , T > t , Object [ ] arg2 ) { entryAction . doIt ( ( TArg0 ) arg2 [ 0 ] , t ) ; } } ) ; return this ;


signature:
public class StateConfiguration { /** * Specify an action that will execute when transitioning into the configured state
 * @ param trigger The trigger by which the state must be entered in order for the action to execute
 * @ param entryAction Action to execute , providing details of the transition
 * @ param < TArg0 > Type of the first trigger argument
 * @ param < TArg1 > Type of the second trigger argument
 * @ return The receiver */
public < TArg0 , TArg1 > StateConfiguration < S , T > onEntryFrom ( TriggerWithParameters2 < TArg0 , TArg1 , T > trigger , final Action2 < TArg0 , TArg1 > entryAction ) { } }

implementation: assert entryAction != null : ENTRY_ACTION_IS_NULL ; return onEntryFrom ( trigger , new Action3 < TArg0 , TArg1 , Transition < S , T > > ( ) { @ Override public void doIt ( TArg0 a0 , TArg1 a1 , Transition < S , T > t ) { entryAction . doIt ( a0 , a1 ) ; } } ) ;


signature:
public class StateConfiguration { /** * Specify an action that will execute when transitioning into the configured state
 * @ param trigger The trigger by which the state must be entered in order for the action to execute
 * @ param entryAction Action to execute , providing details of the transition
 * @ param < TArg0 > Type of the first trigger argument
 * @ param < TArg1 > Type of the second trigger argument
 * @ return The receiver */
public < TArg0 , TArg1 > StateConfiguration < S , T > onEntryFrom ( TriggerWithParameters2 < TArg0 , TArg1 , T > trigger , final Action3 < TArg0 , TArg1 , Transition < S , T > > entryAction ) { } }

implementation: assert trigger != null : TRIGGER_IS_NULL ; assert entryAction != null : ENTRY_ACTION_IS_NULL ; representation . addEntryAction ( trigger . getTrigger ( ) , new Action2 < Transition < S , T > , Object [ ] > ( ) { @ SuppressWarnings ( "unchecked" ) @ Override public void doIt ( Transition < S , T > t , Object [ ] args ) { entryAction . doIt ( ( TArg0 ) args [ 0 ] , ( TArg1 ) args [ 1 ] , t ) ; } } ) ; return this ;


signature:
public class StateConfiguration { /** * Specify an action that will execute when transitioning into the configured state
 * @ param trigger The trigger by which the state must be entered in order for the action to execute
 * @ param entryAction Action to execute , providing details of the transition
 * @ param < TArg0 > Type of the first trigger argument
 * @ param < TArg1 > Type of the second trigger argument
 * @ param < TArg2 > Type of the third trigger argument
 * @ return The receiver */
public < TArg0 , TArg1 , TArg2 > StateConfiguration < S , T > onEntryFrom ( TriggerWithParameters3 < TArg0 , TArg1 , TArg2 , T > trigger , final Action3 < TArg0 , TArg1 , TArg2 > entryAction ) { } }

implementation: assert entryAction != null : ENTRY_ACTION_IS_NULL ; return onEntryFrom ( trigger , new Action4 < TArg0 , TArg1 , TArg2 , Transition < S , T > > ( ) { @ Override public void doIt ( TArg0 a0 , TArg1 a1 , TArg2 a2 , Transition < S , T > t ) { entryAction . doIt ( a0 , a1 , a2 ) ; } } ) ;


signature:
public class StateConfiguration { /** * Specify an action that will execute when transitioning from the configured state
 * @ param exitAction Action to execute
 * @ return The receiver */
public StateConfiguration < S , T > onExit ( final Action exitAction ) { } }

implementation: assert exitAction != null : EXIT_ACTION_IS_NULL ; return onExit ( new Action1 < Transition < S , T > > ( ) { @ Override public void doIt ( Transition < S , T > arg1 ) { exitAction . doIt ( ) ; } } ) ;


signature:
public class StateConfiguration { /** * Specify an action that will execute when transitioning from the configured state
 * @ param exitAction Action to execute
 * @ return The receiver */
public StateConfiguration < S , T > onExit ( Action1 < Transition < S , T > > exitAction ) { } }

implementation: assert exitAction != null : EXIT_ACTION_IS_NULL ; representation . addExitAction ( exitAction ) ; return this ;


signature:
public class StateConfiguration { /** * Sets the superstate that the configured state is a substate of
 * Substates inherit the allowed transitions of their superstate .
 * When entering directly into a substate from outside of the superstate ,
 * entry actions for the superstate are executed .
 * Likewise when leaving from the substate to outside the supserstate ,
 * exit actions for the superstate will execute .
 * @ param superstate The superstate
 * @ return The receiver */
public StateConfiguration < S , T > substateOf ( S superstate ) { } }

implementation: StateRepresentation < S , T > superRepresentation = lookup . call ( superstate ) ; representation . setSuperstate ( superRepresentation ) ; superRepresentation . addSubstate ( representation ) ; return this ;


signature:
public class StateConfiguration { /** * Accept the specified trigger and transition to the destination state , calculated dynamically by the supplied
 * function
 * @ param trigger The accepted trigger
 * @ param destinationStateSelector Function to calculate the state that the trigger will cause a transition to
 * @ return The receiver */
public StateConfiguration < S , T > permitDynamic ( T trigger , final Func < S > destinationStateSelector ) { } }

implementation: return permitDynamicIf ( trigger , destinationStateSelector , NO_GUARD ) ;


signature:
public class StateConfiguration { /** * Accept the specified trigger and transition to the destination state , calculated dynamically by the supplied
 * function
 * @ param trigger The accepted trigger
 * @ param destinationStateSelector Function to calculate the state that the trigger will cause a transition to
 * @ param < TArg0 > Type of the first trigger argument
 * @ return The receiver */
public < TArg0 > StateConfiguration < S , T > permitDynamic ( TriggerWithParameters1 < TArg0 , T > trigger , Func2 < TArg0 , S > destinationStateSelector ) { } }


signature:
public class StateConfiguration { /** * Accept the specified trigger and transition to the destination state , calculated dynamically by the supplied
 * function
 * Additionally a given action is performed when transitioning . This action will be called after
 * the onExit action and before the onEntry action ( of the re - entered state ) . The parameters of the
 * trigger will be given to this action .
 * @ param trigger The accepted trigger
 * @ param destinationStateSelector Function to calculate the state that the trigger will cause a transition to
 * @ param action The action to be performed " during " transition
 * @ param < TArg0 > Type of the first trigger argument
 * @ param < TArg1 > Type of the second trigger argument
 * @ return The receiver */
public < TArg0 , TArg1 > StateConfiguration < S , T > permitDynamic ( TriggerWithParameters2 < TArg0 , TArg1 , T > trigger , Func3 < TArg0 , TArg1 , S > destinationStateSelector , Action2 < TArg0 , TArg1 > action ) { } }

implementation: return permitDynamicIf ( trigger , destinationStateSelector , NO_GUARD , action ) ;


signature:
public class StateConfiguration { /** * Accept the specified trigger and transition to the destination state , calculated dynamically by the supplied
 * function
 * @ param trigger The accepted trigger
 * @ param destinationStateSelector Function to calculate the state that the trigger will cause a transition to
 * @ param < TArg0 > Type of the first trigger argument
 * @ param < TArg1 > Type of the second trigger argument
 * @ param < TArg2 > Type of the third trigger argument
 * @ return The receiver */
public < TArg0 , TArg1 , TArg2 > StateConfiguration < S , T > permitDynamic ( TriggerWithParameters3 < TArg0 , TArg1 , TArg2 , T > trigger , final Func4 < TArg0 , TArg1 , TArg2 , S > destinationStateSelector ) { } }


signature:
public class StateConfiguration { /** * Accept the specified trigger and transition to the destination state , calculated dynamically by the supplied
 * function
 * @ param trigger The accepted trigger
 * @ param destinationStateSelector Function to calculate the state that the trigger will cause a transition to
 * @ param guard Function that must return true in order for the trigger to be accepted
 * @ return The receiver */
public StateConfiguration < S , T > permitDynamicIf ( T trigger , final Func < S > destinationStateSelector , FuncBoolean guard ) { } }

implementation: assert destinationStateSelector != null : DESTINATION_STATE_SELECTOR_IS_NULL ; return publicPermitDynamicIf ( trigger , new Func2 < Object [ ] , S > ( ) { @ Override public S call ( Object [ ] arg0 ) { return destinationStateSelector . call ( ) ; } } , guard , NO_ACTION_N ) ;


signature:
public class StateConfiguration { /** * Accept the specified trigger and transition to the destination state , calculated dynamically by the supplied
 * function
 * Additionally a given action is performed when transitioning . This action will be called after
 * the onExit action of the current state and before the onEntry action of the destination state .
 * @ param trigger The accepted trigger
 * @ param destinationStateSelector Function to calculate the state that the trigger will cause a transition to
 * @ param guard Function that must return true in order for the trigger to be accepted
 * @ param action The action to be performed " during " transition
 * @ return The receiver */
public StateConfiguration < S , T > permitDynamicIf ( T trigger , final Func < S > destinationStateSelector , FuncBoolean guard , final Action action ) { } }

implementation: assert destinationStateSelector != null : DESTINATION_STATE_SELECTOR_IS_NULL ; return publicPermitDynamicIf ( trigger , new Func2 < Object [ ] , S > ( ) { @ Override public S call ( Object [ ] arg0 ) { return destinationStateSelector . call ( ) ; } } , guard , new Action1 < Object [ ] > ( ) { @ SuppressWarnings ( "unchecked" ) @ Override public void doIt ( Object [ ] args ) { action . doIt ( ) ; } } ) ;


signature:
public class StateConfiguration { /** * Accept the specified trigger and transition to the destination state , calculated dynamically by the supplied
 * function
 * @ param trigger The accepted trigger
 * @ param destinationStateSelector Function to calculate the state that the trigger will cause a transition to
 * @ param guard Function that must return true in order for the trigger to be accepted
 * @ param < TArg0 > Type of the first trigger argument
 * @ return The receiver */
public < TArg0 > StateConfiguration < S , T > permitDynamicIf ( TriggerWithParameters1 < TArg0 , T > trigger , final Func2 < TArg0 , S > destinationStateSelector , FuncBoolean guard ) { } }

implementation: assert trigger != null : TRIGGER_IS_NULL ; assert destinationStateSelector != null : DESTINATION_STATE_SELECTOR_IS_NULL ; return publicPermitDynamicIf ( trigger . getTrigger ( ) , new Func2 < Object [ ] , S > ( ) { @ SuppressWarnings ( "unchecked" ) @ Override public S call ( Object [ ] args ) { return destinationStateSelector . call ( ( TArg0 ) args [ 0 ] ) ; } } , guard , NO_ACTION_N ) ;


signature:
public class StateConfiguration { /** * Accept the specified trigger and transition to the destination state , calculated dynamically by the supplied
 * function .
 * Additionally a given action is performed when transitioning . This action will be called after
 * the onExit action of the current state and before the onEntry action of the destination state .
 * The parameters of the trigger will be given to this action .
 * @ param trigger The accepted trigger
 * @ param destinationStateSelector Function to calculate the state that the trigger will cause a transition to
 * @ param guard Function that must return true in order for the trigger to be accepted
 * @ param action The action to be performed " during " transition
 * @ param < TArg0 > Type of the first trigger argument
 * @ param < TArg1 > Type of the second trigger argument
 * @ param < TArg2 > Type of the third trigger argument
 * @ return The receiver */
public < TArg0 , TArg1 , TArg2 > StateConfiguration < S , T > permitDynamicIf ( TriggerWithParameters3 < TArg0 , TArg1 , TArg2 , T > trigger , final Func4 < TArg0 , TArg1 , TArg2 , S > destinationStateSelector , FuncBoolean guard , final Action3 < TArg0 , TArg1 , TArg2 > action ) { } }

implementation: assert trigger != null : TRIGGER_IS_NULL ; assert destinationStateSelector != null : DESTINATION_STATE_SELECTOR_IS_NULL ; return publicPermitDynamicIf ( trigger . getTrigger ( ) , new Func2 < Object [ ] , S > ( ) { @ SuppressWarnings ( "unchecked" ) @ Override public S call ( Object [ ] args ) { return destinationStateSelector . call ( ( TArg0 ) args [ 0 ] , ( TArg1 ) args [ 1 ] , ( TArg2 ) args [ 2 ] ) ; } } , guard , new Action1 < Object [ ] > ( ) { @ SuppressWarnings ( "unchecked" ) @ Override public void doIt ( Object [ ] args ) { action . doIt ( ( TArg0 ) args [ 0 ] , ( TArg1 ) args [ 1 ] , ( TArg2 ) args [ 2 ] ) ; } } ) ;


signature:
public class StateMachineConfig { /** * Return StateRepresentation for the specified state . Creates representation if it does not exist .
 * @ param state The state
 * @ return StateRepresentation for the specified state . */
private StateRepresentation < TState , TTrigger > getOrCreateRepresentation ( TState state ) { } }

implementation: StateRepresentation < TState , TTrigger > result = stateConfiguration . get ( state ) ; if ( result == null ) { result = new StateRepresentation < > ( state ) ; stateConfiguration . put ( state , result ) ; } return result ;


signature:
public class StateMachineConfig { /** * Begin configuration of the entry / exit actions and allowed transitions
 * when the state machine is in a particular state
 * @ param state The state to configure
 * @ return A configuration object through which the state can be configured */
public StateConfiguration < TState , TTrigger > configure ( TState state ) { } }

implementation: return new StateConfiguration < > ( getOrCreateRepresentation ( state ) , new Func2 < TState , StateRepresentation < TState , TTrigger > > ( ) { public StateRepresentation < TState , TTrigger > call ( TState arg0 ) { return getOrCreateRepresentation ( arg0 ) ; } } ) ;


signature:
public class StateMachineConfig { /** * Specify the arguments that must be supplied when a specific trigger is fired
 * @ param trigger The underlying trigger value
 * @ param classe0 Class argument
 * @ param < TArg0 > Type of the first trigger argument
 * @ return An object that can be passed to the fire ( ) method in order to fire the parameterised trigger */
public < TArg0 > TriggerWithParameters1 < TArg0 , TTrigger > setTriggerParameters ( TTrigger trigger , Class < TArg0 > classe0 ) { } }

implementation: TriggerWithParameters1 < TArg0 , TTrigger > configuration = new TriggerWithParameters1 < > ( trigger , classe0 ) ; saveTriggerConfiguration ( configuration ) ; return configuration ;


signature:
public class StateMachineConfig { /** * Specify the arguments that must be supplied when a specific trigger is fired
 * @ param trigger The underlying trigger value
 * @ param classe0 Class argument
 * @ param classe1 Class argument
 * @ param < TArg0 > Type of the first trigger argument
 * @ param < TArg1 > Type of the second trigger argument
 * @ return An object that can be passed to the fire ( ) method in order to fire the parameterised trigger */
public < TArg0 , TArg1 > TriggerWithParameters2 < TArg0 , TArg1 , TTrigger > setTriggerParameters ( TTrigger trigger , Class < TArg0 > classe0 , Class < TArg1 > classe1 ) { } }

implementation: TriggerWithParameters2 < TArg0 , TArg1 , TTrigger > configuration = new TriggerWithParameters2 < > ( trigger , classe0 , classe1 ) ; saveTriggerConfiguration ( configuration ) ; return configuration ;