Class PersistenceSchema
java.lang.Object
io.superdurable.dex.PersistenceSchema
Declares the Attributes, Channels, and Streams that belong to a Flow.
Return one schema from Flow.getPersistenceSchema(). Definitions are immutable after the
schema is created. The varargs and single-list factories classify definitions automatically;
the two-list factory additionally validates that its first list contains only Attributes and its
second list contains only Channels.
public PersistenceSchema getPersistenceSchema() {
return PersistenceSchema.of(counter, orderStatus, commands);
}
-
Method Summary
Modifier and TypeMethodDescriptionstatic PersistenceSchemaof(PersistenceDefinition... definitions) Creates a schema by classifying mixed definitions.static PersistenceSchemaof(List<? extends PersistenceDefinition> definitions) Creates a schema by classifying a mixed list of definitions.static PersistenceSchemaof(List<? extends PersistenceDefinition> attributes, List<? extends PersistenceDefinition> channels) Creates a schema from separate Attribute and Channel lists.static PersistenceSchemaof(List<? extends PersistenceDefinition> attributes, List<? extends PersistenceDefinition> channels, List<? extends PersistenceDefinition> streams) Creates a schema from separate Attribute, Channel, and Stream lists.
-
Method Details
-
of
public static PersistenceSchema of(List<? extends PersistenceDefinition> attributes, List<? extends PersistenceDefinition> channels) Creates a schema from separate Attribute and Channel lists.- Parameters:
attributes- Attribute and Attribute-map definitionschannels- Channel and Channel-map definitions- Returns:
- an immutable persistence schema
- Throws:
NullPointerException- if either list or any definition isnullIllegalArgumentException- if a definition appears in the wrong list
-
of
public static PersistenceSchema of(List<? extends PersistenceDefinition> attributes, List<? extends PersistenceDefinition> channels, List<? extends PersistenceDefinition> streams) Creates a schema from separate Attribute, Channel, and Stream lists.- Parameters:
attributes- Attribute and Attribute-map definitionschannels- Channel and Channel-map definitionsstreams- Stream definitions- Returns:
- an immutable persistence schema
- Throws:
NullPointerException- if a list or definition isnullIllegalArgumentException- if a definition appears in the wrong list
-
of
Creates a schema by classifying a mixed list of definitions.- Parameters:
definitions- Attribute and Channel definitions in any order- Returns:
- an immutable persistence schema
- Throws:
NullPointerException- if the list or any definition isnullIllegalArgumentException- if a definition is unsupported
-
of
Creates a schema by classifying mixed definitions.- Parameters:
definitions- Attribute and Channel definitions in any order- Returns:
- an immutable persistence schema
- Throws:
NullPointerException- if the array or any definition isnullIllegalArgumentException- if a definition is unsupported
-