本文整理汇总了Scala中com.fasterxml.jackson.annotation.JsonIgnore类的典型用法代码示例。如果您正苦于以下问题:Scala JsonIgnore类的具体用法?Scala JsonIgnore怎么用?Scala JsonIgnore使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了JsonIgnore类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Scala代码示例。
示例1: ExclusionEntity
//设置package包名称以及导入依赖的类
package com.flipkart.connekt.commons.entities
import com.fasterxml.jackson.annotation.JsonIgnore
import com.fasterxml.jackson.module.scala.JsonScalaEnumeration
import com.flipkart.connekt.commons.entities.bigfoot.PublishSupport
import com.flipkart.connekt.commons.utils.DateTimeUtils
import org.apache.commons.lang.StringUtils
sealed case class ExclusionEntity(channel: String, appName: String, destination: String, exclusionDetails: ExclusionDetails, active:Boolean = true) extends PublishSupport{
override def namespace: String = "fkint/mp/connekt/Suppressions"
override def toPublishFormat: fkint.mp.connekt.Suppressions = {
fkint.mp.connekt.Suppressions(
destination = destination, appName = appName, channel = channel,
suppressionType = exclusionDetails.exclusionType.toString, ttl = {
if (exclusionDetails.ttl.isFinite()) exclusionDetails.ttl.toSeconds else 0
}, cargo = exclusionDetails.metaInfo,
createdTime = DateTimeUtils.getStandardFormatted(), active = active
)
}
}
case class ExclusionDetails(@JsonScalaEnumeration(classOf[ExclusionTypeSeDeserialize]) exclusionType: ExclusionType.ExclusionType,
metaInfo: String = StringUtils.EMPTY) {
@JsonIgnore
@transient lazy val ttl = ExclusionType.ttl(exclusionType)
}
开发者ID:ayush03agarwal,项目名称:connekt,代码行数:29,代码来源:ExclusionEntity.scala
示例2: ConnektRequest
//设置package包名称以及导入依赖的类
package com.flipkart.connekt.commons.iomodels
import com.fasterxml.jackson.annotation.{JsonIgnore, JsonProperty}
import com.fasterxml.jackson.databind.node.ObjectNode
import com.flipkart.connekt.commons.entities.Channel
import com.flipkart.connekt.commons.services.TStencilService
import com.flipkart.connekt.commons.utils.StringUtils._
case class ConnektRequest(@JsonProperty(required = false) id: String,
@JsonProperty(required = false) clientId: String,
contextId: Option[String],
channel: String,
@JsonProperty(required = true) sla: String,
stencilId: Option[String],
scheduleTs: Option[Long],
expiryTs: Option[Long],
@JsonProperty(required = true) channelInfo: ChannelRequestInfo,
@JsonProperty(required = false) channelData: ChannelRequestData,
@JsonProperty(required = false) channelDataModel: ObjectNode = getObjectNode,
meta: Map[String, String]) {
def this(id: String, clientId: String, contextId: Option[String], channel: String, sla: String, stencilId: Option[String],
scheduleTs: Option[Long], expiryTs: Option[Long], channelInfo: ChannelRequestInfo,
channelData: ChannelRequestData, channelDataModel: ObjectNode) {
this(id, clientId, contextId, channel, sla, stencilId, scheduleTs, expiryTs, channelInfo, channelData, channelDataModel, Map.empty[String, String])
}
def validate(implicit stencilService: TStencilService) = {
require(stencilId.map(stencilService.get(_).nonEmpty).getOrElse(Option(channelData).isDefined), "given stencil Id doesn't exist")
require(contextId.forall(_.hasOnlyAllowedChars), "`contextId` field can only contain [A-Za-z0-9_.-:|] allowed chars.")
require(sla.isDefined, "`sla` field can cannot be null or empty.")
require(meta != null, "`meta` field cannot be null. It is optional but non-null")
require(channelInfo != null, "`channelInfo` field cannot be null.")
require(contextId.forall(_.length <= 20), "`contextId` can be max 20 characters")
}
@JsonIgnore
def isTestRequest : Boolean = meta.get("x-perf-test").exists(v => v.trim.equalsIgnoreCase("true"))
def getComputedChannelData(implicit stencilService: TStencilService): ChannelRequestData =
stencilId.map(stencilService.get(_)).map { stencil =>
Channel.withName(channel) match {
case Channel.PUSH =>
val pushType = if (channelData != null) channelData.asInstanceOf[PNRequestData].pushType else null
PNRequestData(pushType = pushType, data = stencilService.materialize(stencil.head, channelDataModel).asInstanceOf[String].getObj[ObjectNode])
case Channel.SMS =>
SmsRequestData(body = stencilService.materialize(stencil.head, channelDataModel).asInstanceOf[String])
case Channel.EMAIL =>
val subject = stencilService.materialize(stencil.filter(_.component.equalsIgnoreCase("subject")).head, channelDataModel).asInstanceOf[String]
val html = stencilService.materialize(stencil.filter(_.component.equalsIgnoreCase("html")).head, channelDataModel).asInstanceOf[String]
val txt = stencilService.materialize(stencil.filter(_.component.equalsIgnoreCase("text")).head, channelDataModel).asInstanceOf[String]
EmailRequestData(subject = subject, html = html, text = txt, attachments = Option(channelData).map(_.asInstanceOf[EmailRequestData].attachments).orNull)
case unsupportedChannel =>
throw new Exception(s"`channelData` compute undefined for $unsupportedChannel")
}
}.getOrElse(channelData)
}
开发者ID:ayush03agarwal,项目名称:connekt,代码行数:58,代码来源:ConnektRequest.scala
示例3: VisibleCard
//设置package包名称以及导入依赖的类
package com.simplex9.splendor
import com.fasterxml.jackson.annotation.{JsonIgnore, JsonIgnoreProperties}
@JsonIgnoreProperties(Array("pos"))
class VisibleCard (card: Card,
val pos: Int,
val reservedBy: Int) extends Card(card.level, card.color, card.point, card.price) {
@JsonIgnore
def isReserved = reservedBy >= 0
@JsonIgnore
def isInPile = pos < 0
def reserve(playerIndex: Int, pos: Int) = new VisibleCard(card, pos, playerIndex)
@JsonIgnore
def getOffset = VisibleCard.getOffset(level, pos)
}
object VisibleCard {
def newCardInPile(card: Card) :VisibleCard = new VisibleCard(card, -1, -1)
def newCardInPile(group: Int) : VisibleCard= newCardInPile(Card(group, null, -1, null))
def getOffset(group : Int, pos : Int) : Int = group * Param.NUM_CARD_EACH_LEVEL + pos
}
开发者ID:liuhb86,项目名称:splendor-ai,代码行数:24,代码来源:VisibleCard.scala
示例4: Noble
//设置package包名称以及导入依赖的类
package com.simplex9.splendor
import com.fasterxml.jackson.annotation.JsonIgnore
case class Noble(
cards : Array[Short]
)
{
@JsonIgnore
val totalCards = cards.sum
@JsonIgnore
val cardScore = cards.map (c => Param.NOBLE_POINT * Param.POINT_VALUE * c / totalCards )
override def toString: String = {
s"NOBLE: ${Util.colorArrayToString(cards)}"
}
}
object Noble {
def apply(white:Short, byte:Short, green:Short, red:Short, onyx: Short) : Noble =
Noble(Array(white, byte, green, red, onyx))
}
开发者ID:liuhb86,项目名称:splendor-ai,代码行数:24,代码来源:Noble.scala
示例5: TestParams
//设置package包名称以及导入依赖的类
package sample.chirper.load.api
import com.fasterxml.jackson.annotation.JsonIgnore
case class TestParams @JsonIgnore()(
users: Int,
friends: Int,
chirps: Int,
clients: Int,
parallelism: Int,
userIdPrefix: Option[String]
){
def this() = this(1000, 10, 100000, 10, 10, Option.empty)
}
开发者ID:yeongwei,项目名称:activator-lagom-scala-chirper,代码行数:16,代码来源:TestParams.scala
示例6: Chirp
//设置package包名称以及导入依赖的类
package sample.chirper.chirp.api
import java.time.Instant
import java.util.UUID
import com.fasterxml.jackson.annotation.JsonIgnore
case class Chirp @JsonIgnore()(userId: String, message: String, timestamp: Instant, uuid: String) {
def this(userId: String, message: String) =
this(userId, message, Chirp.defaultTimestamp, Chirp.defaultUUID)
}
object Chirp {
implicit object ChirpOrdering extends Ordering[Chirp] {
override def compare(x: Chirp, y: Chirp): Int = x.timestamp.compareTo(y.timestamp)
}
def apply(userId: String, message: String, timestamp: Option[Instant], uuid: Option[String]): Chirp =
new Chirp(userId, message, timestamp.getOrElse(defaultTimestamp), uuid.getOrElse(defaultUUID))
private def defaultTimestamp = Instant.now()
private def defaultUUID = UUID.randomUUID().toString()
}
开发者ID:yeongwei,项目名称:activator-lagom-scala-chirper,代码行数:23,代码来源:Chirp.scala
示例7: ResourceGroup
//设置package包名称以及导入依赖的类
package fr.ramiro.azure.model
import com.fasterxml.jackson.annotation.JsonIgnore
import retrofit2.Retrofit
case class ResourceGroup(
id: String,
name: String,
properties: ResourceGroupProperties,
location: String,
tags: Map[String, String]
) {
@JsonIgnore
var subscriptionId: String = _
@JsonIgnore
var retrofit: Retrofit = _
}
开发者ID:rrramiro,项目名称:azure-sdk-for-scala,代码行数:18,代码来源:ResourceGroup.scala
示例8: Subscription
//设置package包名称以及导入依赖的类
package fr.ramiro.azure.model
import com.fasterxml.jackson.annotation.JsonIgnore
import retrofit2.Retrofit
class Subscription(
val id: String,
val subscriptionId: String,
val displayName: String,
val state: String,
val subscriptionPolicies: SubscriptionPolicies
) {
@JsonIgnore
var retrofit: Retrofit = _
}
object Subscription {
def apply(retrofitParam: Retrofit, subscriptionId: String): Subscription = {
new Subscription(null, subscriptionId, null, null, SubscriptionPolicies(null, null)) {
this.retrofit = retrofitParam
}
}
}
开发者ID:rrramiro,项目名称:azure-sdk-for-scala,代码行数:24,代码来源:Subscription.scala
示例9: CdnEndpoint
//设置package包名称以及导入依赖的类
package fr.ramiro.azure.model
import com.fasterxml.jackson.annotation.JsonIgnore
import retrofit2.Retrofit
class CdnEndpoint {
@JsonIgnore
var profileName: String = _
@JsonIgnore
var subscriptionId: String = _
@JsonIgnore
var resourceGroupName: String = _
@JsonIgnore
var retrofit: Retrofit = _
}
开发者ID:rrramiro,项目名称:azure-sdk-for-scala,代码行数:16,代码来源:CdnEndpoint.scala
示例10: CdnProfile
//设置package包名称以及导入依赖的类
package fr.ramiro.azure.model
import com.fasterxml.jackson.annotation.JsonIgnore
import retrofit2.Retrofit
case class CdnProfile(
id: String,
name: String,
`type`: String,
location: String,
tags: Map[String, String],
properties: ResourceGroupProperties
//sku : Map[String, String]
) {
@JsonIgnore
var subscriptionId: String = _
@JsonIgnore
var resourceGroupName: String = _
@JsonIgnore
var retrofit: Retrofit = _
}
开发者ID:rrramiro,项目名称:azure-sdk-for-scala,代码行数:22,代码来源:CdnProfile.scala
示例11: CuratorInitializer
//设置package包名称以及导入依赖的类
package io.buoyant.namer.curator
import com.fasterxml.jackson.annotation.JsonIgnore
import com.twitter.finagle.{Namer, Path}
import com.twitter.finagle.Stack.Params
import io.buoyant.config.types.{HostAndPort, Port}
import io.buoyant.namer.{NamerConfig, NamerInitializer}
class CuratorInitializer extends NamerInitializer {
override def configId = "io.l5d.curator"
override def configClass = classOf[CuratorConfig]
}
object CuratorInitializer extends CuratorInitializer
case class CuratorConfig(
zkAddrs: Seq[HostAndPort],
basePath: Option[String]
) extends NamerConfig {
override def experimentalRequired = true
@JsonIgnore
override def defaultPrefix: Path = Path.Utf8("io.l5d.curator")
@JsonIgnore
val connectString = zkAddrs.map(_.toString(defaultPort = Port(2181))).mkString(",")
@JsonIgnore
override def newNamer(params: Params): Namer = {
new CuratorNamer(connectString, basePath.getOrElse("/"), prefix)
}
}
开发者ID:linkerd,项目名称:linkerd,代码行数:34,代码来源:CuratorInitializer.scala
示例12: newNamer
//设置package包名称以及导入依赖的类
package io.buoyant.namer.consul
import com.fasterxml.jackson.annotation.JsonIgnore
import com.twitter.finagle._
import com.twitter.finagle.service.Retries
import com.twitter.finagle.tracing.NullTracer
import io.buoyant.config.types.Port
import io.buoyant.consul.utils.RichConsulClient
import io.buoyant.consul.v1
import io.buoyant.consul.v1.ConsistencyMode
import io.buoyant.namer.{NamerConfig, NamerInitializer}
@JsonIgnore
def newNamer(params: Stack.Params): Namer = {
val service = Http.client
// Removes the default client requeues module,
// (retries are handled in BaseApi.infiniteRetryFilter)
.withStack(Http.client.stack.remove(Retries.Role))
.withParams(Http.client.params ++ params)
.withLabel("client")
.interceptInterrupts
.failFast(failFast)
.setAuthToken(token)
.ensureHost(host, port)
.withTracer(NullTracer)
.newService(s"/$$/inet/$getHost/$getPort")
val consul = useHealthCheck match {
case Some(true) => v1.HealthApi(service)
case _ => v1.CatalogApi(service)
}
val agent = v1.AgentApi(service)
val stats = params[param.Stats].statsReceiver.scope(prefix.show.stripPrefix("/"))
includeTag match {
case Some(true) =>
ConsulNamer.tagged(
prefix, consul, agent, setHost.getOrElse(false), consistencyMode, preferServiceAddress, stats
)
case _ =>
ConsulNamer.untagged(
prefix, consul, agent, setHost.getOrElse(false), consistencyMode, preferServiceAddress, stats
)
}
}
}
开发者ID:linkerd,项目名称:linkerd,代码行数:49,代码来源:ConsulInitializer.scala
示例13: ReplaceTransformerInitializer
//设置package包名称以及导入依赖的类
package io.buoyant.namer
import com.fasterxml.jackson.annotation.JsonIgnore
import com.twitter.finagle.{Path, Stack}
class ReplaceTransformerInitializer extends TransformerInitializer {
val configClass = classOf[ReplaceTransformerConfig]
override val configId = "io.l5d.replace"
}
case class ReplaceTransformerConfig(path: Path) extends TransformerConfig {
@JsonIgnore
val defaultPrefix = Path.read("/io.l5d.replace")
@JsonIgnore
override def mk(params: Stack.Params): NameTreeTransformer = new ReplaceTransformer(prefix, path)
}
开发者ID:linkerd,项目名称:linkerd,代码行数:19,代码来源:ReplaceTransformerInitializer.scala
示例14: RewritingNamerInitializer
//设置package包名称以及导入依赖的类
package io.buoyant.namer
import com.fasterxml.jackson.annotation.JsonIgnore
import com.twitter.finagle.{Namer, Path}
import com.twitter.finagle.buoyant.PathMatcher
import com.twitter.finagle.Stack.Params
class RewritingNamerInitializer extends NamerInitializer {
override val configId = "io.l5d.rewrite"
val configClass = classOf[RewritingNamerConfig]
}
case class RewritingNamerConfig(
pattern: String,
name: String
) extends NamerConfig {
assert(pattern != null)
assert(name != null)
@JsonIgnore
override def defaultPrefix: Path =
throw new IllegalArgumentException("The 'prefix' property is required for the io.l5d.rewrite namer.")
@JsonIgnore override protected def newNamer(params: Params): Namer = new RewritingNamer(PathMatcher(pattern), name)
}
开发者ID:linkerd,项目名称:linkerd,代码行数:26,代码来源:RewritingNamerInitializer.scala
示例15: TestTransformer
//设置package包名称以及导入依赖的类
package io.buoyant.namer
import com.fasterxml.jackson.annotation.JsonIgnore
import com.twitter.finagle.Name.Bound
import com.twitter.finagle.{NameTree, Path, Stack}
import com.twitter.util.Activity
class TestTransformer extends NameTreeTransformer {
override protected def transform(tree: NameTree[Bound]): Activity[NameTree[Bound]] =
Activity.value(NameTree.Empty)
}
object TestTransformerInitializer extends TransformerInitializer {
val configClass = classOf[TestTransformerConfig]
override val configId = "io.l5d.empty"
}
class TestTransformerConfig extends TransformerConfig {
@JsonIgnore
val defaultPrefix = Path.read("/io.l5d.empty")
@JsonIgnore
override def mk(params: Stack.Params): NameTreeTransformer = new TestTransformer
}
开发者ID:linkerd,项目名称:linkerd,代码行数:26,代码来源:TestTransformer.scala
示例16: ZkLeaderNamerInitializer
//设置package包名称以及导入依赖的类
package io.buoyant.namer.zk
import com.fasterxml.jackson.annotation.JsonIgnore
import com.twitter.finagle.Stack.Params
import com.twitter.finagle.{Namer, Path}
import io.buoyant.config.types.HostAndPort
import io.buoyant.namer.{NamerConfig, NamerInitializer}
class ZkLeaderNamerInitializer extends NamerInitializer {
override def configClass = classOf[ZkLeaderNamerConfig]
override def configId: String = "io.l5d.zkLeader"
}
case class ZkLeaderNamerConfig(zkAddrs: Seq[HostAndPort]) extends NamerConfig {
@JsonIgnore
override def defaultPrefix: Path = Path.Utf8("io.l5d.zkLeader")
@JsonIgnore
override def newNamer(params: Params): Namer = new ZkLeaderNamer(prefix, zkAddrs)
}
开发者ID:linkerd,项目名称:linkerd,代码行数:21,代码来源:ZkLeaderNamerInitializer.scala
示例17: newNamer
//设置package包名称以及导入依赖的类
package io.buoyant.namer.k8s
import com.fasterxml.jackson.annotation.JsonIgnore
import com.twitter.finagle._
import io.buoyant.config.types.Port
import io.buoyant.k8s.istio.{DiscoveryClient, IstioNamer}
import io.buoyant.namer.{NamerConfig, NamerInitializer}
@JsonIgnore
override def newNamer(params: Stack.Params): Namer = {
val label = param.Label(s"namer${prefix.show}")
val discoveryClient = DiscoveryClient(
host.getOrElse(DefaultDiscoveryHost),
port.map(_.port).getOrElse(DefaultDiscoveryPort)
)
new IstioNamer(discoveryClient, prefix)
}
}
开发者ID:linkerd,项目名称:linkerd,代码行数:20,代码来源:IstioInitializer.scala
示例18: K8sNamespacedInitializer
//设置package包名称以及导入依赖的类
package io.buoyant.namer.k8s
import com.fasterxml.jackson.annotation.JsonIgnore
import com.twitter.finagle.{param, Namer, Stack, Path}
import io.buoyant.config.types.Port
import io.buoyant.k8s.{SingleNsNamer, ClientConfig}
import io.buoyant.k8s.v1.Api
import io.buoyant.namer.{NamerConfig, NamerInitializer}
class K8sNamespacedInitializer extends NamerInitializer {
val configClass = classOf[K8sNamespacedConfig]
override def configId = "io.l5d.k8s.ns"
}
object K8sNamespacedInitializer extends K8sNamespacedInitializer
case class K8sNamespacedConfig(
host: Option[String],
port: Option[Port],
envVar: Option[String],
labelSelector: Option[String]
) extends NamerConfig with ClientConfig {
@JsonIgnore
override def defaultPrefix: Path = Path.read("/io.l5d.k8s.ns")
@JsonIgnore
def portNum = port.map(_.port)
@JsonIgnore
def nsName = sys.env.get(envVar.getOrElse("POD_NAMESPACE"))
@JsonIgnore
override def newNamer(params: Stack.Params): Namer = {
assert(nsName.isDefined, "could not find namespace for envVar")
val client = mkClient(params)
def mkNs(ns: String) = {
val label = param.Label(s"namer${prefix.show}/$ns")
Api(client.configured(label).newService(dst)).withNamespace(ns)
}
new SingleNsNamer(prefix, labelSelector, nsName.get, mkNs)
}
}
开发者ID:linkerd,项目名称:linkerd,代码行数:45,代码来源:K8sNamespacedInitializer.scala
示例19: newNamer
//设置package包名称以及导入依赖的类
package io.buoyant.namer.k8s
import com.fasterxml.jackson.annotation.JsonIgnore
import com.twitter.finagle._
import io.buoyant.config.types.Port
import io.buoyant.k8s.{ClientConfig, ServiceNamer}
import io.buoyant.k8s.v1.Api
import io.buoyant.namer.{NamerConfig, NamerInitializer}
@JsonIgnore
override def newNamer(params: Stack.Params): Namer = {
val client = mkClient(params)
def mkNs(ns: String) = {
val label = param.Label(s"namer${prefix.show}/$ns")
Api(client.configured(label).newService(dst)).withNamespace(ns)
}
new ServiceNamer(prefix, labelSelector, mkNs)
}
}
开发者ID:linkerd,项目名称:linkerd,代码行数:21,代码来源:K8sExternalInitializer.scala
示例20: FsInitializer
//设置package包名称以及导入依赖的类
package io.buoyant.namer.fs
import com.fasterxml.jackson.annotation.JsonIgnore
import com.twitter.finagle.{Path, Stack}
import io.buoyant.config.types.Directory
import io.buoyant.namer.{NamerConfig, NamerInitializer}
class FsInitializer extends NamerInitializer {
val configClass = classOf[FsConfig]
override def configId = "io.l5d.fs"
}
object FsInitializer extends FsInitializer
case class FsConfig(rootDir: Directory) extends NamerConfig {
@JsonIgnore
override def defaultPrefix: Path = Path.read("/io.l5d.fs")
@JsonIgnore
def newNamer(params: Stack.Params) = new WatchingNamer(rootDir.path, prefix)
}
开发者ID:linkerd,项目名称:linkerd,代码行数:23,代码来源:FsInitializer.scala
注:本文中的com.fasterxml.jackson.annotation.JsonIgnore类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论