• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Scala JsonTypeInfo类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Scala中com.fasterxml.jackson.annotation.JsonTypeInfo的典型用法代码示例。如果您正苦于以下问题:Scala JsonTypeInfo类的具体用法?Scala JsonTypeInfo怎么用?Scala JsonTypeInfo使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了JsonTypeInfo类的19个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Scala代码示例。

示例1: Of

//设置package包名称以及导入依赖的类
package com.flipkart.connekt.commons.entities

import com.fasterxml.jackson.annotation.JsonSubTypes.Type
import com.fasterxml.jackson.annotation.{JsonSubTypes, JsonTypeInfo}
import com.flipkart.connekt.commons.dao.JSONField

@JsonTypeInfo(
  use = JsonTypeInfo.Id.NAME,
  include = JsonTypeInfo.As.PROPERTY,
  property = "type"
)
@JsonSubTypes(Array(
  new Type(value = classOf[HTTPEventSink], name = "HTTP"),
  new Type(value = classOf[KafkaEventSink], name = "KAFKA"),
  new Type(value = classOf[SpecterEventSink], name = "SPECTER"),
  new Type(value = classOf[RMQEventSink], name = "RMQ")
))
abstract class EventSink extends JSONField
case class HTTPEventSink(method:String, url: String) extends EventSink
case class KafkaEventSink(topic: String, broker: String) extends EventSink
case class SpecterEventSink() extends EventSink
case class RMQEventSink(queue: String, host: String, username: String, password: String) extends EventSink 
开发者ID:ayush03agarwal,项目名称:connekt,代码行数:23,代码来源:EventSink.scala


示例2: Of

//设置package包名称以及导入依赖的类
package com.flipkart.connekt.commons.iomodels

import com.fasterxml.jackson.annotation.JsonSubTypes.Type
import com.fasterxml.jackson.annotation.{JsonSubTypes, JsonTypeInfo}

@JsonTypeInfo(
  use = JsonTypeInfo.Id.NAME,
  include = JsonTypeInfo.As.PROPERTY,
  property = "message_type"
)
@JsonSubTypes(Array(
  new Type(value = classOf[XmppAck], name = "ack"),
  new Type(value = classOf[XmppNack], name = "nack"),
  new Type(value = classOf[XmppReceipt], name = "receipt"),
  new Type(value = classOf[XmppControl], name = "control")
))
abstract class XmppResponse {
  def responseType(): String
} 
开发者ID:ayush03agarwal,项目名称:connekt,代码行数:20,代码来源:XmppResponse.scala


示例3: Of

//设置package包名称以及导入依赖的类
package com.flipkart.connekt.commons.iomodels

import com.fasterxml.jackson.annotation.JsonSubTypes.Type
import com.fasterxml.jackson.annotation.{JsonSubTypes, JsonTypeInfo}

@JsonTypeInfo(
use = JsonTypeInfo.Id.NAME,
include = JsonTypeInfo.As.PROPERTY,
property = "type"
)
@JsonSubTypes(Array(
new Type(value = classOf[PNRequestData], name = "PN"),
new Type(value = classOf[GCardRequestData], name = "GCard"),
new Type(value = classOf[EmailRequestData], name="EMAIL"),
new Type(value = classOf[SmsRequestData], name="SMS")
))
abstract class ChannelRequestData 
开发者ID:ayush03agarwal,项目名称:connekt,代码行数:18,代码来源:ChannelRequestData.scala


示例4: GenericResponse

//设置package包名称以及导入依赖的类
package com.flipkart.connekt.commons.iomodels

import com.fasterxml.jackson.annotation.JsonInclude.Include
import com.fasterxml.jackson.annotation.JsonSubTypes.Type
import com.fasterxml.jackson.annotation.{JsonInclude, JsonSubTypes, JsonTypeInfo}

case class GenericResponse(status: Int, request: AnyRef, response: ResponseBody)

@JsonTypeInfo(
  use = JsonTypeInfo.Id.NAME,
  include = JsonTypeInfo.As.PROPERTY,
  property = "type"
)
@JsonSubTypes(Array(
  new Type(value = classOf[Response], name = "RESPONSE"),
  new Type(value = classOf[SendResponse], name = "SEND_RESPONSE")
))
abstract class ResponseBody

case class Response(@JsonInclude(Include.NON_NULL) message: String, data: Any) extends ResponseBody

case class SendResponse(@JsonInclude(Include.NON_NULL) message: String, success: Map[String, Set[String]], failure: List[String]) extends ResponseBody 
开发者ID:ayush03agarwal,项目名称:connekt,代码行数:23,代码来源:GenericResponse.scala


示例5: Of

//设置package包名称以及导入依赖的类
package com.flipkart.connekt.commons.iomodels

import com.fasterxml.jackson.annotation.JsonSubTypes.Type
import com.fasterxml.jackson.annotation.{JsonSubTypes, JsonTypeInfo}
import com.flipkart.connekt.commons.entities.DeviceCallbackEvent
import com.flipkart.connekt.commons.entities.bigfoot.PublishSupport

@JsonTypeInfo(
  use = JsonTypeInfo.Id.NAME,
  include = JsonTypeInfo.As.PROPERTY,
  property = "type"
)
@JsonSubTypes(Array(
  new Type(value = classOf[PNCallbackEvent], name = "PN"),
  new Type(value = classOf[EmailCallbackEvent], name = "EMAIL"),
  new Type(value = classOf[DeviceCallbackEvent], name = "DEVICE"),
  new Type(value = classOf[SmsCallbackEvent], name = "SMS")
))
abstract class CallbackEvent extends PublishSupport {
  def contactId: String

  def messageId: String

  def eventId: String

  def eventType:String

  def contextId : String

  def appName : String

  def clientId : String
} 
开发者ID:ayush03agarwal,项目名称:connekt,代码行数:34,代码来源:CallbackEvent.scala


示例6: Of

//设置package包名称以及导入依赖的类
package com.flipkart.connekt.commons.iomodels

import com.fasterxml.jackson.annotation.JsonSubTypes.Type
import com.fasterxml.jackson.annotation.{JsonSubTypes, JsonTypeInfo}

@JsonTypeInfo(
  use = JsonTypeInfo.Id.NAME,
  include = JsonTypeInfo.As.PROPERTY,
  property = "type"
)
@JsonSubTypes(Array(
  new Type(value = classOf[PNRequestInfo], name = "PN"),
  new Type(value = classOf[EmailRequestInfo], name = "EMAIL"),
  new Type(value = classOf[SmsRequestInfo], name = "SMS"),
  new Type(value = classOf[CardsRequestInfo], name = "CARD")
))
abstract class ChannelRequestInfo 
开发者ID:ayush03agarwal,项目名称:connekt,代码行数:18,代码来源:ChannelRequestInfo.scala


示例7: Of

//设置package包名称以及导入依赖的类
package com.bwsw.sj.engine.core.entities

import com.fasterxml.jackson.annotation.JsonSubTypes.Type
import com.fasterxml.jackson.annotation.{JsonSubTypes, JsonTypeInfo}



@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "streamType")
@JsonSubTypes(Array(
  new Type(value = classOf[TStreamEnvelope], name = "stream.t-stream"),
  new Type(value = classOf[KafkaEnvelope], name = "stream.kafka"),
  new Type(value = classOf[EsEnvelope], name = "elasticsearch-output"),
  new Type(value = classOf[JdbcEnvelope], name = "jdbc-output")
))
class Envelope() {
  protected var streamType: String = null
  var stream: String = null
  var partition: Int = 0
  var tags: Array[String] = Array()
} 
开发者ID:bwsw,项目名称:sj-platform,代码行数:21,代码来源:Envelope.scala


示例8: Of

//设置package包名称以及导入依赖的类
package com.bwsw.sj.crud.rest

import com.fasterxml.jackson.annotation.JsonSubTypes.Type
import com.fasterxml.jackson.annotation.{JsonSubTypes, JsonTypeInfo, JsonProperty}


@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "stream-type")
@JsonSubTypes(Array(new Type(value = classOf[CassStream], name = "cassandra"),
  new Type(value = classOf[TestStream], name = "test")
))
class SjStreamTest {
  var name: String = null
  var description: String = "No description"
  @JsonProperty("stream-type") var streamType: String = null
}

class CassStream extends  SjStreamTest {
  var keyspace: String = null
}

class TestStream extends SjStreamTest {
  var ttt: Int = 0
} 
开发者ID:bwsw,项目名称:sj-platform,代码行数:24,代码来源:SjStreamData.scala


示例9: Of

//设置package包名称以及导入依赖的类
package model

import java.util.Date

import com.fasterxml.jackson.annotation.JsonSubTypes.Type
import com.fasterxml.jackson.annotation.{JsonSubTypes, JsonTypeInfo}


@JsonTypeInfo(
  use = JsonTypeInfo.Id.NAME,
  include = JsonTypeInfo.As.PROPERTY,
  property = Constants.Type,
  visible = true
)
@JsonSubTypes(Array(
  new Type(value = classOf[EmailNotification], name = Constants.Email),
  new Type(value = classOf[PagerdutyNotification], name = Constants.Pagerduty)
))
sealed trait Notification {
  def `type`: String
}

case class EmailNotification(name: String, email: String, notifyAction: String) extends Notification {
  override val `type` = Constants.Email
}

case class PagerdutyNotification(serviceKey: String, apiUrl: String, numConsecutiveFailures: Int) extends Notification {
  override val `type` = Constants.Pagerduty
}

case class Team(name: String, email: String, notifyAction: String)

case class ProcessDefinition(name: String,
                             description: Option[String],
                             schedule: Option[ProcessSchedule],
                             overlapAction: ProcessOverlapAction,
                             notifications: Seq[Notification],
                             createdAt: Date,
                             isPaused: Boolean)

object Constants {

  private[model] final val Type = "type"

  private[model] final val Email = "email"

  private[model] final val Pagerduty = "pagerduty"

} 
开发者ID:gilt,项目名称:sundial,代码行数:50,代码来源:ProcessDefinition.scala


示例10: Of

//设置package包名称以及导入依赖的类
package io.buoyant.namerd.storage.kubernetes

import com.fasterxml.jackson.annotation.{JsonProperty, JsonSubTypes, JsonTypeInfo}
import io.buoyant.k8s.{Status, Watch}

@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type")
@JsonSubTypes(Array(
  new JsonSubTypes.Type(value = classOf[DtabAdded], name = "ADDED"),
  new JsonSubTypes.Type(value = classOf[DtabModified], name = "MODIFIED"),
  new JsonSubTypes.Type(value = classOf[DtabDeleted], name = "DELETED"),
  new JsonSubTypes.Type(value = classOf[DtabError], name = "ERROR")
))
sealed trait DtabWatch extends Watch[Dtab]

// NOTE: These are not (as would be usual practice) inside a DtabWatch companion object,
// because doing so leads to intermittent compilation failures from
// https://issues.scala-lang.org/browse/SI-7551.
case class DtabAdded(`object`: Dtab) extends DtabWatch with Watch.Added[Dtab]
case class DtabModified(`object`: Dtab) extends DtabWatch with Watch.Modified[Dtab]
case class DtabDeleted(`object`: Dtab) extends DtabWatch with Watch.Deleted[Dtab]
case class DtabError(
  @JsonProperty(value = "object") status: Status
) extends DtabWatch with Watch.Error[Dtab] 
开发者ID:linkerd,项目名称:linkerd,代码行数:24,代码来源:DtabWatch.scala


示例11: Of

//设置package包名称以及导入依赖的类
package io.buoyant.linkerd.protocol.http

import com.fasterxml.jackson.annotation.{JsonIgnore, JsonSubTypes, JsonTypeInfo}
import com.twitter.finagle.http.{Request, Response}
import com.twitter.finagle.{ServiceFactory, Stack, Stackable}
import io.buoyant.router.RouterLabel
import io.buoyant.router.http.AddForwardedHeader

@JsonTypeInfo(
  use = JsonTypeInfo.Id.NAME,
  include = JsonTypeInfo.As.PROPERTY,
  property = "kind"
)
@JsonSubTypes(Array(
  new JsonSubTypes.Type(value = classOf[IpLabelerConfig], name = "ip"),
  new JsonSubTypes.Type(value = classOf[IpPortLabelerConfig], name = "ip:port"),
  new JsonSubTypes.Type(value = classOf[ConnectionRandomLabelerConfig], name = "connectionRandom"),
  new JsonSubTypes.Type(value = classOf[RequestRandomLabelerConfig], name = "requestRandom"),
  new JsonSubTypes.Type(value = classOf[RouterLabelerConfig], name = "router"),
  new JsonSubTypes.Type(value = classOf[StaticLabelerConfig], name = "static")
))
trait LabelerConfig {
  @JsonIgnore
  def mk(params: Stack.Params): AddForwardedHeader.Labeler
}


  val module: Stackable[ServiceFactory[Request, Response]] =
    new Stack.Module[ServiceFactory[Request, Response]] {
      val role = Stack.Role("ConfigureAddForwardedHeader")
      val description = AddForwardedHeader.module.description
      val parameters = Seq(implicitly[Stack.Param[Param]])

      private type Stk = Stack[ServiceFactory[Request, Response]]

      def make(params: Stack.Params, stk: Stk) = params[Param] match {
        case Param(None) => stk
        case Param(Some(config)) =>
          // Wrap the underlying stack, applying the ForwardedHeaderConfig
          val mkNext: (Stack.Params, Stk) => Stk =
            (prms, next) => Stack.Leaf(this, next.make(prms ++: config))
          Stack.Node(this, mkNext, stk)
      }
    }

} 
开发者ID:linkerd,项目名称:linkerd,代码行数:47,代码来源:AddForwardedHeaderConfig.scala


示例12: Of

//设置package包名称以及导入依赖的类
import com.fasterxml.jackson.annotation.JsonSubTypes.Type
import com.fasterxml.jackson.annotation.{JsonSubTypes, JsonTypeInfo}
import com.fasterxml.jackson.databind.annotation.{JsonDeserialize, JsonSerialize}



@JsonTypeInfo(
  use = JsonTypeInfo.Id.NAME,
  include = JsonTypeInfo.As.PROPERTY,
  property = "type"
)
@JsonSubTypes(Array(
  new Type(value = classOf[Sigmoid], name = "sigmoid")
))
trait ActivationFunctionTrait{
  def activate(z: Double) : Double
}

class Sigmoid extends ActivationFunctionTrait{
  override def activate(z:Double) : Double = {
    1 / (1 + Math.exp(z * (-1)))
  }
}

class Step extends ActivationFunctionTrait{
  override def activate(z:Double) : Double = {
    if(z<0) 0
    else 1
  }
} 
开发者ID:stevanusandrianta,项目名称:neural-network,代码行数:31,代码来源:ActivationFunction.scala


示例13: Of

//设置package包名称以及导入依赖的类
package com.sk.app.proxmock.application.domain.conditions

import com.fasterxml.jackson.annotation.JsonSubTypes.Type
import com.fasterxml.jackson.annotation.{JsonSubTypes, JsonTypeInfo}
import com.sk.app.proxmock.application.configuration.ConfigurationContext
import org.springframework.messaging.Message


@JsonTypeInfo(use = JsonTypeInfo.Id.NONE, include = JsonTypeInfo.As.WRAPPER_OBJECT)
@JsonSubTypes(Array(
  new Type(value = classOf[HeaderMatches], name="headerMatches"),
  new Type(value = classOf[UriMatches], name="uriMatches"),
  new Type(value = classOf[BodyMatches], name="bodyMatches"),
  new Type(value = classOf[RandomCondition], name="random"),
  new Type(value = classOf[AlwaysTrueCondition], name="alwaysTrue"),
  new Type(value = classOf[AlwaysFalseCondition], name="alwaysFalse"),
  new Type(value = classOf[GroovyExpression], name="groovyExpression"),
  new Type(value = classOf[GroovyExpressionFile], name="groovyExpressionFile")
))
abstract class Condition {
  def test(message: Message[Object], context: ConfigurationContext): Boolean
} 
开发者ID:szymonkudzia,项目名称:proxmock,代码行数:23,代码来源:Condition.scala


示例14: Of

//设置package包名称以及导入依赖的类
package com.sk.app.proxmock.application.domain.providers.url

import com.fasterxml.jackson.annotation.JsonSubTypes.Type
import com.fasterxml.jackson.annotation.{JsonSubTypes, JsonTypeInfo}
import com.sk.app.proxmock.application.configuration.ConfigurationContext
import org.springframework.messaging.Message


@JsonTypeInfo(use = JsonTypeInfo.Id.NONE, include = JsonTypeInfo.As.WRAPPER_OBJECT)
@JsonSubTypes(Array(
  new Type(value = classOf[StaticUrlProvider], name="static"),
  new Type(value = classOf[StaticFromFileUrlProvider], name="staticFromFile"),
  new Type(value = classOf[GroovyExpressionUrlProvider], name="groovyExpression"),
  new Type(value = classOf[GroovyExpressionFromFileUrlProvider], name="groovyExpressionFromFile")
))
abstract class UrlProvider {
  def get(context: ConfigurationContext, message: Message[Object]): String
} 
开发者ID:szymonkudzia,项目名称:proxmock,代码行数:19,代码来源:UrlProvider.scala


示例15: Of

//设置package包名称以及导入依赖的类
package com.sk.app.proxmock.application.domain.providers.statuscode

import com.fasterxml.jackson.annotation.JsonSubTypes.Type
import com.fasterxml.jackson.annotation.{JsonSubTypes, JsonTypeInfo}
import com.sk.app.proxmock.application.configuration.ConfigurationContext
import org.springframework.messaging.Message


@JsonTypeInfo(use = JsonTypeInfo.Id.NONE, include = JsonTypeInfo.As.WRAPPER_OBJECT)
@JsonSubTypes(Array(
  new Type(value = classOf[SuccessStatusCodeProvider], name="success"),
  new Type(value = classOf[StaticStatusCodeProvider], name="static"),
  new Type(value = classOf[StaticFromFileStatusCodeProvider], name="staticFromFile"),
  new Type(value = classOf[GroovyExpressionStatusCodeProvider], name="groovyExpression"),
  new Type(value = classOf[GroovyExpressionFromFileStatusCodeProvider], name="groovyExpressionFromFile"),
  new Type(value = classOf[ConditionalStatusCodeProvider], name="conditional")
))
abstract class StatusCodeProvider {
  def get(context: ConfigurationContext, message: Message[Object]): Int
} 
开发者ID:szymonkudzia,项目名称:proxmock,代码行数:21,代码来源:StatusCodeProvider.scala


示例16: Of

//设置package包名称以及导入依赖的类
package com.sk.app.proxmock.application.domain.providers.headers

import com.fasterxml.jackson.annotation.JsonSubTypes.Type
import com.fasterxml.jackson.annotation.{JsonSubTypes, JsonTypeInfo}
import com.sk.app.proxmock.application.configuration.ConfigurationContext
import org.springframework.messaging.Message


@JsonTypeInfo(use = JsonTypeInfo.Id.NONE, include = JsonTypeInfo.As.WRAPPER_OBJECT)
@JsonSubTypes(Array(
  new Type(value = classOf[EmptyHeadersProvider], name="empty"),
  new Type(value = classOf[StaticHeadersProvider], name="static"),
  new Type(value = classOf[StaticFromFileHeadersProvider], name="staticFromFile"),
  new Type(value = classOf[GroovyExpressionHeadersProvider], name="groovyExpression"),
  new Type(value = classOf[GroovyExpressionFromFileHeadersProvider], name="groovyExpressionFromFile"),
  new Type(value = classOf[ConditionalHeadersProvider], name="conditional")
))
abstract class HeadersProvider {
  def get(context: ConfigurationContext, message: Message[Object]): Map[String, String]
} 
开发者ID:szymonkudzia,项目名称:proxmock,代码行数:21,代码来源:HeadersProvider.scala


示例17: Of

//设置package包名称以及导入依赖的类
package com.sk.app.proxmock.application.domain.providers.body

import com.fasterxml.jackson.annotation.JsonSubTypes.Type
import com.fasterxml.jackson.annotation.{JsonSubTypes, JsonTypeInfo}
import com.sk.app.proxmock.application.configuration.ConfigurationContext
import org.springframework.messaging.Message


@JsonTypeInfo(use = JsonTypeInfo.Id.NONE, include = JsonTypeInfo.As.WRAPPER_OBJECT)
@JsonSubTypes(Array(
  new Type(value = classOf[EmptyBodyProvider], name="empty"),
  new Type(value = classOf[StaticBodyProvider], name="static"),
  new Type(value = classOf[StaticBodyFromFileProvider], name="staticFromFile"),
  new Type(value = classOf[GroovyExpressionBodyProvider], name="groovyExpression"),
  new Type(value = classOf[GroovyExpressionFromFileBodyProvider], name="groovyExpressionFromFile"),
  new Type(value = classOf[ConditionalBodyProvider], name="conditional")
))
abstract class BodyProvider {
  def get(context: ConfigurationContext, message: Message[Object]): String
} 
开发者ID:szymonkudzia,项目名称:proxmock,代码行数:21,代码来源:BodyProvider.scala


示例18: Of

//设置package包名称以及导入依赖的类
package services

import com.fasterxml.jackson.annotation.JsonSubTypes.Type
import com.fasterxml.jackson.annotation.{JsonSubTypes, JsonTypeInfo}



@JsonTypeInfo(
  use = JsonTypeInfo.Id.NAME,
  include = JsonTypeInfo.As.PROPERTY,
  property = "type"
)
@JsonSubTypes(Array(
  new Type(value = classOf[Sigmoid], name = "sigmoid")
))
trait ActivationFunctionTrait{
  def activate(z: Double) : Double
}

class Sigmoid extends ActivationFunctionTrait{
  override def activate(z:Double) : Double = {
    1 / (1 + Math.exp(z * (-1)))
  }
}

class Step extends ActivationFunctionTrait{
  override def activate(z:Double) : Double = {
    if(z<0) 0
    else 1
  }
} 
开发者ID:stevanusandrianta,项目名称:neural-network-application,代码行数:32,代码来源:ActivationFunction.scala


示例19: PolymorphicConfig

//设置package包名称以及导入依赖的类
package io.buoyant.config

import com.fasterxml.jackson.annotation.{JsonProperty, JsonTypeInfo}


@JsonTypeInfo(
  use = JsonTypeInfo.Id.NAME,
  include = JsonTypeInfo.As.EXISTING_PROPERTY,
  property = "kind",
  visible = true
)
abstract class PolymorphicConfig {
  @JsonProperty("kind")
  var kind: String = ""
} 
开发者ID:linkerd,项目名称:linkerd,代码行数:16,代码来源:PolymorphicConfig.scala



注:本文中的com.fasterxml.jackson.annotation.JsonTypeInfo类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Scala BreakIterator类代码示例发布时间:2022-05-23
下一篇:
Scala RecordMetadata类代码示例发布时间:2022-05-23
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap