public final class CommandClass
extends io.spine.type.MessageClass<io.spine.base.CommandMessage>
Modifier and Type | Method and Description |
---|---|
static CommandClass |
from(java.lang.Class<? extends io.spine.base.CommandMessage> value)
Creates a new instance for the passed class value.
|
static CommandClass |
of(com.google.protobuf.Message commandOrMessage)
Creates a new instance for the class of the passed command.
|
static com.google.common.collect.ImmutableSet<CommandClass> |
setOf(java.lang.Class<? extends io.spine.base.CommandMessage>... classes)
Creates a set of
CommandClass from the passed classes. |
static com.google.common.collect.ImmutableSet<CommandClass> |
setOf(java.lang.Iterable<java.lang.Class<? extends io.spine.base.CommandMessage>> classes)
Creates a set of
CommandClass from the passed set. |
public static CommandClass from(java.lang.Class<? extends io.spine.base.CommandMessage> value)
value
- class referencepublic static CommandClass of(com.google.protobuf.Message commandOrMessage)
If an instance of Command
is passed to this method, enclosing command message will
be un-wrapped to determine the class of the command.
If an instance of Any
is passed, it will be unpacked, and the class of the wrapped
message will be used.
commandOrMessage
- a command for which to get the classpublic static com.google.common.collect.ImmutableSet<CommandClass> setOf(java.lang.Iterable<java.lang.Class<? extends io.spine.base.CommandMessage>> classes)
CommandClass
from the passed set.@SafeVarargs public static com.google.common.collect.ImmutableSet<CommandClass> setOf(java.lang.Class<? extends io.spine.base.CommandMessage>... classes)
CommandClass
from the passed classes.