本文整理匯總了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;
}