本文整理汇总了Java中com.fasterxml.jackson.annotation.JsonCreator类的典型用法代码示例。如果您正苦于以下问题:Java JsonCreator类的具体用法?Java JsonCreator怎么用?Java JsonCreator使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
JsonCreator类属于com.fasterxml.jackson.annotation包,在下文中一共展示了JsonCreator类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: JdbcStorageConfig
import com.fasterxml.jackson.annotation.JsonCreator; //导入依赖的package包/类
@JsonCreator
public JdbcStorageConfig(
@JsonProperty("driver") String driver,
@JsonProperty("url") String url,
@JsonProperty("username") String username,
@JsonProperty("password") String password,
@JsonProperty(value = "fetchSize", defaultValue = "0") int fetchSize,
@JsonProperty("database") String database,
@JsonProperty(value = "showOnlyConnDatabase", defaultValue = "false") boolean showOnlyConnDatabase) {
super();
this.driver = driver;
this.url = url;
this.username = username;
this.password = password;
this.fetchSize = fetchSize;
this.database = database;
this.showOnlyConnDatabase = showOnlyConnDatabase;
}
示例2: OrderedPartitionSender
import com.fasterxml.jackson.annotation.JsonCreator; //导入依赖的package包/类
@JsonCreator
public OrderedPartitionSender(@JsonProperty("orderings") List<Ordering> orderings,
@JsonProperty("ref") FieldReference ref,
@JsonProperty("child") PhysicalOperator child,
@JsonProperty("destinations") List<MinorFragmentEndpoint> endpoints,
@JsonProperty("receiver-major-fragment") int oppositeMajorFragmentId,
@JsonProperty("sending-fragment-width") int sendingWidth,
@JsonProperty("recordsToSample") int recordsToSample,
@JsonProperty("samplingFactor") int samplingFactor,
@JsonProperty("completionFactor") float completionFactor) {
super(oppositeMajorFragmentId, child, endpoints);
if (orderings == null) {
this.orderings = Lists.newArrayList();
} else {
this.orderings = orderings;
}
this.ref = ref;
this.sendingWidth = sendingWidth;
this.recordsToSample = recordsToSample;
this.samplingFactor = samplingFactor;
this.completionFactor = completionFactor;
}
示例3: Event
import com.fasterxml.jackson.annotation.JsonCreator; //导入依赖的package包/类
@JsonCreator
public Event(@JsonProperty("eventName") String eventName,
@JsonProperty("eventSource") String eventSource,
@JsonProperty("eventTime") String eventTime,
@JsonProperty("eventVersion") String eventVersion,
@JsonProperty("oss") Oss oss,
@JsonProperty("region") String region,
@JsonProperty("requestParameters") RequestParameters requestParameters,
@JsonProperty("responseElements") ResponseElements responseElements,
@JsonProperty("userIdentity") UserIdentity userIdentity) {
this.eventName = eventName;
this.eventSource = eventSource;
this.eventTime = eventTime;
this.eventVersion = eventVersion;
this.oss = oss;
this.region = region;
this.requestParameters = requestParameters;
this.responseElements = responseElements;
this.userIdentity = userIdentity;
}
示例4: GoogleAccountsServiceResponseBuilder
import com.fasterxml.jackson.annotation.JsonCreator; //导入依赖的package包/类
/**
* Instantiates a new Google accounts service response builder.
*
* @param privateKeyLocation the private key
* @param publicKeyLocation the public key
* @param keyAlgorithm the key algorithm
* @param skewAllowance the skew allowance
*/
@JsonCreator
public GoogleAccountsServiceResponseBuilder(@JsonProperty("privateKeyLocation") final String privateKeyLocation,
@JsonProperty("publicKeyLocation") final String publicKeyLocation,
@JsonProperty("keyAlgorithm") final String keyAlgorithm,
@JsonProperty("skewAllowance") final int skewAllowance) {
Assert.notNull(privateKeyLocation);
Assert.notNull(publicKeyLocation);
try {
this.privateKeyLocation = privateKeyLocation;
this.publicKeyLocation = publicKeyLocation;
this.keyAlgorithm = keyAlgorithm;
this.skewAllowance = skewAllowance;
createGoogleAppsPrivateKey();
createGoogleAppsPublicKey();
} catch (final Exception e) {
throw Throwables.propagate(e);
}
}
示例5: User
import com.fasterxml.jackson.annotation.JsonCreator; //导入依赖的package包/类
/**
* @param id
* Unique identifier for this user or bot.
* @param id
* True, if this user is a bot.
* @param firstName
* User's or bot's first name.
* @param lastName
* Optional. User's or bot's last name.
* @param username
* Optional. User's or bot's username.
* @param languageCode
* Optional. IETF language tag of the user's language.
*/
@JsonCreator
public User(
@JsonProperty("id") Long id,
@JsonProperty("is_bot") boolean isBot,
@JsonProperty("first_name") String firstName,
@JsonProperty("last_name") String lastName,
@JsonProperty("username") String username,
@JsonProperty("language_code") String languageCode) {
Preconditions.notNull(id, "User's or bot's ID should be provided.");
this.id = id;
this.isBot = isBot;
Preconditions.notNull(firstName, "User's or bot's first name should be provided.");
this.firstName = firstName;
this.lastName = lastName;
this.username = username;
this.languageCode = languageCode;
}
示例6: Limits
import com.fasterxml.jackson.annotation.JsonCreator; //导入依赖的package包/类
@JsonCreator
public Limits(@JsonProperty("permissionEvaluationTime") Integer permissionEvaluationTime,
@JsonProperty("permissionEvaluationCount") Integer permissionEvaluationCount)
{
this.permissionEvaluationTime = permissionEvaluationTime;
this.permissionEvaluationCount = permissionEvaluationCount;
}
示例7: fromParts
import com.fasterxml.jackson.annotation.JsonCreator; //导入依赖的package包/类
/**
* Static factory method used by Jackson for deserialization
*/
@SuppressWarnings("unused")
@JsonCreator
public static SecretDetailResponseV2 fromParts(
@JsonProperty("name") String name,
@JsonProperty("description") @Nullable String description,
@JsonProperty("checksum") String checksum,
@JsonProperty("createdAtSeconds") long createdAtSeconds,
@JsonProperty("createdBy") String createdBy,
@JsonProperty("updatedAtSeconds") long updatedAtSeconds,
@JsonProperty("updatedBy") String updatedBy,
@JsonProperty("metadata") @Nullable Map<String, String> metadata,
@JsonProperty("type") @Nullable String type,
@JsonProperty("expiry") long expiry,
@JsonProperty("version") @Nullable Long version) {
return builder()
.name(name)
.description(nullToEmpty(description))
.checksum(checksum)
.createdAtSeconds(createdAtSeconds)
.createdBy(createdBy)
.updatedAtSeconds(updatedAtSeconds)
.updatedBy(updatedBy)
.metadata(metadata == null ? ImmutableMap.of() : ImmutableMap.copyOf(metadata))
.type(type)
.expiry(expiry)
.version(version)
.build();
}
示例8: JacksonRestCompensation
import com.fasterxml.jackson.annotation.JsonCreator; //导入依赖的package包/类
@JsonCreator
public JacksonRestCompensation(
@JsonProperty("retries") int retries,
@JsonProperty("path") String path,
@JsonProperty("method") String method,
@JsonProperty("params") Map<String, Map<String, String>> params) {
super(path, method, params);
this.retries = retries <= 0? DEFAULT_RETRIES : retries;
}
示例9: DatasetSplitId
import com.fasterxml.jackson.annotation.JsonCreator; //导入依赖的package包/类
@JsonCreator
public DatasetSplitId(String datasetSplitId) throws IllegalArgumentException {
final String[] ids = datasetSplitId.split(DELIMITER, 3);
if (ids.length != 3 || ids[0].isEmpty() || ids[1].isEmpty() || ids[2].isEmpty()) {
throw new IllegalArgumentException("Invalid dataset split id " + datasetSplitId);
}
this.datasetId = ids[0];
this.splitKey = ids[2];
this.compoundSplitId = datasetSplitId;
}
示例10: LastTrade
import com.fasterxml.jackson.annotation.JsonCreator; //导入依赖的package包/类
@JsonCreator
public LastTrade(@JsonProperty("symbol") final String symbol,
@JsonProperty("price") final BigDecimal price,
@JsonProperty("size") final BigDecimal size,
@JsonProperty("time") final Long time) {
this.symbol = symbol;
this.price = price;
this.size = size;
this.time = time;
}
示例11: Channel
import com.fasterxml.jackson.annotation.JsonCreator; //导入依赖的package包/类
@JsonCreator
public Channel(
@JsonProperty("id") String id,
@JsonProperty("name") String name,
@JsonProperty("is_member") boolean isMember,
@JsonProperty("is_archived") boolean isArchived)
{
this.id = id;
this.name = name;
this.isMember = isMember;
this.isArchived = isArchived;
}
示例12: ServerErrorResult
import com.fasterxml.jackson.annotation.JsonCreator; //导入依赖的package包/类
@JsonCreator
public ServerErrorResult(
@JsonProperty(value = "message", required = true) String errorMessage,
@JsonProperty("delay_in_ms") long delayInMs,
@JsonProperty("ignore_on_prepare") Boolean ignoreOnPrepare) {
super(SERVER_ERROR, errorMessage, delayInMs, ignoreOnPrepare);
}
示例13: fromValue
import com.fasterxml.jackson.annotation.JsonCreator; //导入依赖的package包/类
@JsonCreator
public static TypeEnum fromValue(String text) {
for (TypeEnum b : TypeEnum.values()) {
if (String.valueOf(b.value).equals(text)) {
return b;
}
}
return null;
}
示例14: fromParts
import com.fasterxml.jackson.annotation.JsonCreator; //导入依赖的package包/类
/**
* Static factory method used by Jackson for deserialization
*/
@SuppressWarnings("unused")
@JsonCreator
public static CreateGroupRequestV2 fromParts(
@JsonProperty("name") String name,
@JsonProperty("description") @Nullable String description,
@JsonProperty("metadata") @Nullable ImmutableMap<String, String> metadata) {
return builder()
.name(name)
.description(nullToEmpty(description))
.metadata(ImmutableMap.copyOf(metadata == null ? ImmutableMap.of() : metadata))
.build();
}
示例15: GenericErrorMessage
import com.fasterxml.jackson.annotation.JsonCreator; //导入依赖的package包/类
@JsonCreator
public GenericErrorMessage(
@JsonProperty("errorMessage") String errorMessage,
@JsonProperty("moreInfo") String moreInfo,
@JsonProperty("stackTrace") String[] stackTrace) {
this.errorMessage = errorMessage;
this.moreInfo = moreInfo;
this.stackTrace = stackTrace;
}