本文整理汇总了Scala中com.fasterxml.jackson.annotation.JsonIgnore类的典型用法代码示例。如果您正苦于以下问题:Scala JsonIgnore类的具体用法?Scala JsonIgnore怎么用?Scala JsonIgnore使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了JsonIgnore类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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)
}
示例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)
}
示例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
}
示例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))
}
示例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)
}
示例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()
}
示例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 = _
}
示例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
}
}
}
示例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 = _
}
示例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 = _
}
示例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)
}
}
示例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
)
}
}
}
示例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)
}
示例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)
}
示例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
}