@Target(value={METHOD,ANNOTATION_TYPE})
@Retention(value=RUNTIME)
@Documented
public static @interface MatsClassMapping.Stage
@Stage
annotation. An ordinal
must be assigned to each stage, so that Mats knows
which order the stages are in - read more about the ordinal number at ordinal()
. The initial stage must
have the ordinal zero, which also shall be the first stage in the resulting sorted list of Stages (i.e. negative
values are not allowed) - this is the Stage which gets incoming messages targeted at the
endpointId
of this endpoint.Modifier and Type | Fields and Description |
---|---|
static int |
INITIAL
Constant for 0 (zero), the initial Stage's ordinal.
|
Modifier and Type | Optional Element and Description |
---|---|
int |
ordinal
The ordinal of this Stage in the sequence of stages of this endpoint - that is, an integer that expresses the
relative position of this Stage wrt.
|
int |
value
Alias for "ordinal", so that if you only need to set the ordinal (which relative position in the sequence of
stages this Stage is), you can do so directly:
@Stage(15) . |
public static final int INITIAL
@AliasFor(value="value") public abstract int ordinal
INITIAL
. The magnitude of the number does not matter, only the "sort order", so
0, 1, 2 is just as good as 0, 3, 5, which is just as good as 0, 4527890, 4527990 - although one can
definitely discuss the relative merits between each approach. An idea is the cool'n'retro Commodore
BASIC-style of line numbers, which commonly was to use values in multiple of 10, i.e. 0 (for the Initial),
then 10, 20, 30. The rationale is that you then quickly can add a line between 10 and 20 by sticking in a 15
there.@AliasFor(value="ordinal") public abstract int value
@Stage(15)
.ordinal()