public final class FieldPrecedenceModel extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
FieldPrecedenceModel.CodecInteraction
Represents an interaction against a codec, e.g.,
encoder.wrap(...) or decoder.myVarData(). |
static class |
FieldPrecedenceModel.State
A state in which a codec may reside.
|
static class |
FieldPrecedenceModel.TransitionGroup
A group of transitions that share the same end state.
|
| Modifier and Type | Method and Description |
|---|---|
void |
forEachStateOrderedByStateNumber(Consumer<FieldPrecedenceModel.State> consumer)
Iterates over the codec states in the order of their state numbers.
|
void |
forEachTerminalEncoderState(Consumer<FieldPrecedenceModel.State> consumer)
Iterates over the states in which a codec is fully encoded.
|
void |
forEachTransition(FieldPrecedenceModel.CodecInteraction interaction,
Consumer<FieldPrecedenceModel.TransitionGroup> consumer)
Iterates over the possible state machine transitions due to the supplied codec interaction.
|
void |
forEachTransitionFrom(FieldPrecedenceModel.State state,
Consumer<FieldPrecedenceModel.TransitionGroup> consumer)
Finds the possible transitions from a given state.
|
void |
forEachWrappedStateByVersionDesc(IntObjConsumer<FieldPrecedenceModel.State> consumer)
Iterates over the states after a codec is wrapped over a particular version of data.
|
String |
generatedRepresentationClassName()
Returns the name of the class that models the state machine in generated code.
|
void |
generateGraph(StringBuilder sb,
String indent)
Encodes the state machine as a graphviz dot diagram.
|
FieldPrecedenceModel.CodecInteraction.CodecInteractionFactory |
interactionFactory()
Returns a hash-consing factory for codec interactions.
|
FieldPrecedenceModel.State |
latestVersionWrappedState()
The state after a codec is wrapped in the latest version.
|
static FieldPrecedenceModel |
newInstance(String stateClassName,
Token msgToken,
List<Token> fields,
List<Token> groups,
List<Token> varData,
Function<IntStream,IntStream> versionsSelector)
Builds a state machine that models whether codec interactions are safe.
|
FieldPrecedenceModel.State |
notWrappedState()
The initial state before a codec is wrapped.
|
int |
stateCount()
Returns the number of states in the state machine.
|
int |
versionCount()
Returns the number of schema versions.
|
public static FieldPrecedenceModel newInstance(String stateClassName, Token msgToken, List<Token> fields, List<Token> groups, List<Token> varData, Function<IntStream,IntStream> versionsSelector)
stateClassName - the qualified name of the class that models the state machine in generated codemsgToken - the message tokenfields - the fields in the messagegroups - the groups in the messagevarData - the varData in the messageversionsSelector - a function that selects the versions to model in the state machinepublic FieldPrecedenceModel.State notWrappedState()
public FieldPrecedenceModel.State latestVersionWrappedState()
public void forEachWrappedStateByVersionDesc(IntObjConsumer<FieldPrecedenceModel.State> consumer)
consumer - the consumer of the states.public int versionCount()
public void forEachTerminalEncoderState(Consumer<FieldPrecedenceModel.State> consumer)
consumer - the consumer of the states.public void forEachStateOrderedByStateNumber(Consumer<FieldPrecedenceModel.State> consumer)
consumer - the consumer of the states.public int stateCount()
public FieldPrecedenceModel.CodecInteraction.CodecInteractionFactory interactionFactory()
FieldPrecedenceModel.CodecInteractionpublic String generatedRepresentationClassName()
public void forEachTransition(FieldPrecedenceModel.CodecInteraction interaction, Consumer<FieldPrecedenceModel.TransitionGroup> consumer)
interaction - a codec interaction.consumer - the consumer of the transitions.public void forEachTransitionFrom(FieldPrecedenceModel.State state, Consumer<FieldPrecedenceModel.TransitionGroup> consumer)
state - the state to find transitions from.consumer - the consumer of the transitions.public void generateGraph(StringBuilder sb, String indent)
sb - the string builder to append to.indent - the indentation to use.Copyright © 2013-2024 Real Logic Limited. All Rights Reserved.