mirror of
https://github.com/sbt/sbt.git
synced 2026-09-07 02:55:23 +02:00
Use Exec in State
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
/**
|
||||
* This code is generated using sbt-datatype.
|
||||
*/
|
||||
|
||||
// DO NOT EDIT MANUALLY
|
||||
package sbt.protocol
|
||||
final class ChannelAcceptedEvent private (
|
||||
val channelName: String) extends sbt.protocol.EventMessage() with Serializable {
|
||||
|
||||
|
||||
|
||||
override def equals(o: Any): Boolean = o match {
|
||||
case x: ChannelAcceptedEvent => (this.channelName == x.channelName)
|
||||
case _ => false
|
||||
}
|
||||
override def hashCode: Int = {
|
||||
37 * (17 + channelName.##)
|
||||
}
|
||||
override def toString: String = {
|
||||
"ChannelAcceptedEvent(" + channelName + ")"
|
||||
}
|
||||
protected[this] def copy(channelName: String = channelName): ChannelAcceptedEvent = {
|
||||
new ChannelAcceptedEvent(channelName)
|
||||
}
|
||||
def withChannelName(channelName: String): ChannelAcceptedEvent = {
|
||||
copy(channelName = channelName)
|
||||
}
|
||||
}
|
||||
object ChannelAcceptedEvent {
|
||||
|
||||
def apply(channelName: String): ChannelAcceptedEvent = new ChannelAcceptedEvent(channelName)
|
||||
}
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
/**
|
||||
* This code is generated using sbt-datatype.
|
||||
*/
|
||||
|
||||
// DO NOT EDIT MANUALLY
|
||||
package sbt.protocol.codec
|
||||
import _root_.sjsonnew.{ deserializationError, serializationError, Builder, JsonFormat, Unbuilder }
|
||||
trait ChannelAcceptedEventFormats { self: sjsonnew.BasicJsonProtocol =>
|
||||
implicit lazy val ChannelAcceptedEventFormat: JsonFormat[sbt.protocol.ChannelAcceptedEvent] = new JsonFormat[sbt.protocol.ChannelAcceptedEvent] {
|
||||
override def read[J](jsOpt: Option[J], unbuilder: Unbuilder[J]): sbt.protocol.ChannelAcceptedEvent = {
|
||||
jsOpt match {
|
||||
case Some(js) =>
|
||||
unbuilder.beginObject(js)
|
||||
val channelName = unbuilder.readField[String]("channelName")
|
||||
unbuilder.endObject()
|
||||
sbt.protocol.ChannelAcceptedEvent(channelName)
|
||||
case None =>
|
||||
deserializationError("Expected JsObject but found None")
|
||||
}
|
||||
}
|
||||
override def write[J](obj: sbt.protocol.ChannelAcceptedEvent, builder: Builder[J]): Unit = {
|
||||
builder.beginObject()
|
||||
builder.addField("channelName", obj.channelName)
|
||||
builder.endObject()
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5,6 +5,6 @@
|
||||
// DO NOT EDIT MANUALLY
|
||||
package sbt.protocol.codec
|
||||
import _root_.sjsonnew.{ deserializationError, serializationError, Builder, JsonFormat, Unbuilder }
|
||||
trait EventMessageFormats { self: sjsonnew.BasicJsonProtocol with sbt.protocol.codec.LogEventFormats with sbt.protocol.codec.ExecStatusEventFormats =>
|
||||
implicit lazy val EventMessageFormat: JsonFormat[sbt.protocol.EventMessage] = flatUnionFormat2[sbt.protocol.EventMessage, sbt.protocol.LogEvent, sbt.protocol.ExecStatusEvent]("type")
|
||||
trait EventMessageFormats { self: sjsonnew.BasicJsonProtocol with sbt.protocol.codec.ChannelAcceptedEventFormats with sbt.protocol.codec.LogEventFormats with sbt.protocol.codec.ExecStatusEventFormats =>
|
||||
implicit lazy val EventMessageFormat: JsonFormat[sbt.protocol.EventMessage] = flatUnionFormat3[sbt.protocol.EventMessage, sbt.protocol.ChannelAcceptedEvent, sbt.protocol.LogEvent, sbt.protocol.ExecStatusEvent]("type")
|
||||
}
|
||||
|
||||
@@ -4,5 +4,5 @@
|
||||
|
||||
// DO NOT EDIT MANUALLY
|
||||
package sbt.protocol.codec
|
||||
trait JsonProtocol extends sjsonnew.BasicJsonProtocol with sbt.protocol.codec.ExecCommandFormats with sbt.protocol.codec.CommandMessageFormats with sbt.protocol.codec.LogEventFormats with sbt.protocol.codec.ExecStatusEventFormats with sbt.protocol.codec.EventMessageFormats
|
||||
trait JsonProtocol extends sjsonnew.BasicJsonProtocol with sbt.protocol.codec.ExecCommandFormats with sbt.protocol.codec.CommandMessageFormats with sbt.protocol.codec.ChannelAcceptedEventFormats with sbt.protocol.codec.LogEventFormats with sbt.protocol.codec.ExecStatusEventFormats with sbt.protocol.codec.EventMessageFormats
|
||||
object JsonProtocol extends JsonProtocol
|
||||
@@ -17,6 +17,10 @@ type ExecCommand implements CommandMessage {
|
||||
interface EventMessage {
|
||||
}
|
||||
|
||||
type ChannelAcceptedEvent implements EventMessage {
|
||||
channelName: String!
|
||||
}
|
||||
|
||||
## Log event.
|
||||
type LogEvent implements EventMessage {
|
||||
level: String!
|
||||
|
||||
Reference in New Issue
Block a user