Java 类com.fasterxml.jackson.annotation.JsonCreator 实例源码
项目:dremio-oss
文件:JdbcStorageConfig.java
@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;
}
项目:QDrill
文件:OrderedPartitionSender.java
@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;
}
项目:fc-java-libs
文件:OSSEvent.java
@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;
}
项目:cas-5.1.0
文件:GoogleAccountsServiceResponseBuilder.java
/**
* 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);
}
}
项目:telegram-bot-api
文件:User.java
/**
* @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;
}
项目:alfresco-remote-api
文件:Limits.java
@JsonCreator
public Limits(@JsonProperty("permissionEvaluationTime") Integer permissionEvaluationTime,
@JsonProperty("permissionEvaluationCount") Integer permissionEvaluationCount)
{
this.permissionEvaluationTime = permissionEvaluationTime;
this.permissionEvaluationCount = permissionEvaluationCount;
}
项目:secrets-proxy
文件:SecretDetailResponseV2.java
/**
* 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();
}
项目:incubator-servicecomb-saga
文件:JacksonRestCompensation.java
@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;
}
项目:dremio-oss
文件:DatasetSplitId.java
@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;
}
项目:iextrading4j
文件:LastTrade.java
@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;
}
项目:presto-rest
文件:Channel.java
@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;
}
项目:simulacron
文件:ServerErrorResult.java
@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);
}
项目:connect-java-sdk
文件:CatalogObject.java
@JsonCreator
public static TypeEnum fromValue(String text) {
for (TypeEnum b : TypeEnum.values()) {
if (String.valueOf(b.value).equals(text)) {
return b;
}
}
return null;
}
项目:secrets-proxy
文件:CreateGroupRequestV2.java
/**
* 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();
}
项目:dremio-oss
文件:GenericErrorMessage.java
@JsonCreator
public GenericErrorMessage(
@JsonProperty("errorMessage") String errorMessage,
@JsonProperty("moreInfo") String moreInfo,
@JsonProperty("stackTrace") String[] stackTrace) {
this.errorMessage = errorMessage;
this.moreInfo = moreInfo;
this.stackTrace = stackTrace;
}
项目:simulacron
文件:WriteTimeoutResult.java
@JsonCreator
public WriteTimeoutResult(
@JsonProperty(value = "consistency_level", required = true) ConsistencyLevel cl,
@JsonProperty(value = "received", required = true) int received,
@JsonProperty(value = "block_for", required = true) int blockFor,
@JsonProperty(value = "write_type", required = true) WriteType writeType,
@JsonProperty("delay_in_ms") long delayInMs,
@JsonProperty("ignore_on_prepare") Boolean ignoreOnPrepare) {
super(WRITE_TIMEOUT, cl, received, blockFor, delayInMs, ignoreOnPrepare);
this.writeType = writeType;
}
项目:aws-sdk-java-v2
文件:ServiceExamples.java
@JsonCreator
private ServiceExamples(
@JsonProperty(value = "examples") Map<String, List<Example>> examples,
@JsonProperty(value = "version") String version) {
this.operationExamples = examples == null
? Collections.emptyMap() : examples;
this.version = version;
}
项目:connect-java-sdk
文件:CatalogQuerySortedAttribute.java
@JsonCreator
public static SortOrderEnum fromValue(String text) {
for (SortOrderEnum b : SortOrderEnum.values()) {
if (String.valueOf(b.value).equals(text)) {
return b;
}
}
return null;
}
项目:dremio-oss
文件:ResourcePath.java
@JsonCreator
public static ResourcePath defaultImpl(final String pathString) {
return new ResourcePath() {
@Override
public List<?> asPath() {
return toPath(pathString);
}
};
}
项目:open-kilda
文件:FlowEndpointPayload.java
/**
* Instance constructor.
*
* @param switchId switch id
* @param portId port id
* @param vlanId vlan id
*/
@JsonCreator
public FlowEndpointPayload(@JsonProperty("switch-id") String switchId,
@JsonProperty("port-id") Integer portId,
@JsonProperty("vlan-id") Integer vlanId) {
setSwitchId(switchId);
setPortId(portId);
setVlanId(vlanId);
}
项目:simulacron
文件:WriteFailureResult.java
@JsonCreator
public WriteFailureResult(
@JsonProperty(value = "consistency_level", required = true) ConsistencyLevel cl,
@JsonProperty(value = "received", required = true) int received,
@JsonProperty(value = "block_for", required = true) int blockFor,
@JsonProperty(value = "failure_reasons", required = true)
Map<InetAddress, RequestFailureReason> failureReasonByEndpoint,
@JsonProperty(value = "write_type", required = true) WriteType writeType,
@JsonProperty("delay_in_ms") long delayInMs,
@JsonProperty("ignore_on_prepare") Boolean ignoreOnPrepare) {
super(
WRITE_FAILURE, cl, received, blockFor, failureReasonByEndpoint, delayInMs, ignoreOnPrepare);
this.writeType = writeType;
}
项目:bean-grid
文件:Customer.java
@JsonCreator
public Customer(@JsonProperty("id") int id, @JsonProperty("firstName") String firstName,
@JsonProperty("lastName") String lastName) {
this.id = id;
this.firstName = firstName;
this.lastName = lastName;
}
项目:telegram-bot-api
文件:Chat.java
/**
* @param id
* Unique identifier for this chat should not exceeding 1e13 by absolute value.
* @param type
* Type of chat.
* @param title
* Optional. Title, for channels and group chats.
* @param username
* Optional. Username, for private chats and channels if available.
* @param firstName
* Optional. First name of the other party in a private chat.
* @param lastName
* Optional. Last name of the other party in a private chat.
* @param allMembersAreAdmins
* Optional. True if a group has ‘All Members Are Admins’ enabled.
* @param photo
* Optional. Chat photo. Returned only in getChat.
* @param description
* Optional. Description, for supergroups and channel chats. Returned only in getChat.
* @param inviteLink
* Optional. Chat invite link, for supergroups and channel chats. Returned only in getChat.
* @param pinnedMessage
* Optional. Pinned message, for supergroups. Returned only in getChat.
* @param stickerSetName
* Optional. For supergroups, name of group sticker set. Returned only in getChat.
* @param canSetStickerSet
* Optional. True, if the bot can change the group sticker set. Returned only in getChat.
*/
@JsonCreator
public Chat(
@JsonProperty("id") Long id,
@JsonProperty("type") ChatType type,
@JsonProperty("title") String title,
@JsonProperty("username") String username,
@JsonProperty("first_name") String firstName,
@JsonProperty("last_name") String lastName,
@JsonProperty("all_members_are_administrators") Boolean allMembersAreAdmins,
@JsonProperty("photo") ChatPhoto photo,
@JsonProperty("description") String description,
@JsonProperty("invite_link") String inviteLink,
@JsonProperty("pinned_message") Message pinnedMessage,
@JsonProperty("sticker_set_name") String stickerSetName,
@JsonProperty("can_set_sticker_set") Boolean canSetStickerSet) {
Preconditions.notNull(id, "Chat ID should be provided.");
if (Math.abs(id) > 1e13) {
throw new IllegalArgumentException(String.format("Unique identifier for this chat should not exceeding 1e13 by absolute value, but got %d", id));
}
this.id = id;
Preconditions.notNull(type, "ChatType should be provided.");
this.type = type;
this.title = title;
this.username = username;
this.firstName = firstName;
this.lastName = lastName;
this.allMembersAreAdmins = allMembersAreAdmins;
this.photo = photo;
this.description = description;
this.inviteLink = inviteLink;
this.pinnedMessage = pinnedMessage;
this.stickerSetName = stickerSetName;
this.canSetStickerSet = canSetStickerSet;
}
项目:dremio-oss
文件:View.java
@JsonCreator
public View(@JsonProperty("name") String name,
@JsonProperty("sql") String sql,
@JsonProperty("fields") List<FieldType> fields,
@JsonProperty("workspaceSchemaPath") List<String> workspaceSchemaPath){
this.name = name;
this.sql = sql;
this.fields = fields;
this.workspaceSchemaPath =
workspaceSchemaPath == null ? ImmutableList.<String>of() : ImmutableList.copyOf(workspaceSchemaPath);
}
项目:presto-rest
文件:RestTransactionHandle.java
@JsonCreator
public RestTransactionHandle(
@JsonProperty("id") int id
)
{
this.id = id;
}
项目:iextrading4j
文件:ExchangeSymbol.java
@JsonCreator
public ExchangeSymbol(@JsonProperty("symbol") final String symbol,
@JsonProperty("name") final String name,
@JsonProperty("date") final LocalDate date,
@JsonProperty("isEnabled") final Boolean isEnabled,
@JsonProperty("type") final String type,
@JsonProperty("iexId") final Long iexId) {
this.symbol = symbol;
this.name = name;
this.date = date;
this.isEnabled = isEnabled;
this.type = type;
this.iexId = iexId;
}
项目:dremio-oss
文件:ResourceTreeEntity.java
@JsonCreator
public ResourceTreeEntity(
@JsonProperty("type") ResourceType type,
@JsonProperty("name") String name,
@JsonProperty("fullPath") List<String> fullPath,
@JsonProperty("url") String url,
@JsonProperty("resources") List<ResourceTreeEntity> resources) {
this.type = type;
this.name = name;
this.fullPath = fullPath;
this.url = url;
this.resources = resources;
}
项目:cyberduck
文件:MoveNodesRequest.java
@JsonCreator
public static ResolutionStrategyEnum fromValue(String text) {
for(ResolutionStrategyEnum b : ResolutionStrategyEnum.values()) {
if(String.valueOf(b.value).equals(text)) {
return b;
}
}
return null;
}
项目:projectindoorweb
文件:GetFloor.java
@JsonCreator
public GetFloor(@JsonProperty("floorId") long floorId,
@JsonProperty("floorLevel") int floorLevel,
@JsonProperty("floorName") String floorName,
@JsonProperty("floorMapUrl") String floorMapUrl) {
this.floorId = floorId;
this.floorLevel = floorLevel;
this.floorName = floorName;
this.floorMapUrl = floorMapUrl;
}
项目:connect-java-sdk
文件:Location.java
@JsonCreator
public static TypeEnum fromValue(String text) {
for (TypeEnum b : TypeEnum.values()) {
if (String.valueOf(b.value).equals(text)) {
return b;
}
}
return null;
}
项目:QDrill
文件:JoinCondition.java
@JsonCreator
public JoinCondition(@JsonProperty("relationship") String relationship,
@JsonProperty("left") LogicalExpression left, @JsonProperty("right") LogicalExpression right) {
super();
this.relationship = relationship;
this.left = left;
this.right = right;
}
项目:dremio-oss
文件:PhysicalDataset.java
@JsonCreator
public PhysicalDataset(
@JsonProperty("resourcePath") PhysicalDatasetResourcePath resourcePath,
@JsonProperty("datasetName") PhysicalDatasetName datasetName,
@JsonProperty("datasetConfig") PhysicalDatasetConfig datasetConfig,
@JsonProperty("jobCount") Integer jobCount,
@JsonProperty("descendants") Integer descendants) {
this.resourcePath = resourcePath;
this.datasetName = datasetName;
this.datasetConfig = datasetConfig;
this.jobCount = jobCount;
this.descendants = descendants;
}
项目:hub-cf
文件:BindingProvisionRequest.java
@JsonCreator
public BindingProvisionRequest(@JsonProperty(value = "service_id", required = true) String serviceId,
@JsonProperty(value = "plan_id", required = true) String planId,
@JsonProperty(value = "bind_resource", required = false) @Nullable BindResource bindResource,
@JsonProperty(value = "parameters", required = false) @Nullable HubProjectParameters hubProjectParams) {
this.serviceId = serviceId;
this.planId = planId;
this.bindResource = Optional.ofNullable(bindResource);
this.hubProjectParams = Optional.ofNullable(hubProjectParams);
}
项目:mongo-trek
文件:MigrationCommand.java
@JsonCreator
public MigrationCommand(@JsonProperty("version") String version,
@JsonProperty("description") String description,
@JsonProperty("author") String author,
@JsonProperty("command") Map<String, Object> command) {
if (StringUtils.trimToNull(version) == null || StringUtils.trimToNull(description) == null || command == null)
throw new IllegalStateException("A migration command requires at least a version, description and a command!");
this.version = version;
this.description = description;
this.author = Optional.ofNullable(author).orElse(Migration.DEFAULT_AUTHOR);
this.command = new BasicDBObject(command);
}
项目:dremio-oss
文件:StoragePluginId.java
@JsonCreator
public StoragePluginId(
@JsonProperty("name") String name,
@JsonProperty("config") StoragePluginConfig config,
@JsonProperty("capabilities") SourceCapabilities capabilities,
@JsonProperty("type") StoragePluginType type) {
super();
this.name = Preconditions.checkNotNull(name);
this.config = Preconditions.checkNotNull(config);
this.type = Preconditions.checkNotNull(type);
this.capabilities = capabilities;
this.hashCode = Objects.hashCode(name, config, type, capabilities);
}
项目:stitch-android-sdk
文件:UserProfile.java
@JsonCreator
private UserProfile(
@JsonProperty(Fields.ID)
final String userId,
@JsonProperty(Fields.IDENTITIES)
final List<Identity> identities,
@JsonProperty(Fields.DATA)
final Map<String, Object> data
) {
_userId = userId;
_identities = identities;
_data = data;
}
项目:QDrill
文件:View.java
@JsonCreator
public View(@JsonProperty("name") String name,
@JsonProperty("sql") String sql,
@JsonProperty("fields") List<FieldType> fields,
@JsonProperty("workspaceSchemaPath") List<String> workspaceSchemaPath){
this.name = name;
this.sql = sql;
this.fields = fields;
this.workspaceSchemaPath =
workspaceSchemaPath == null ? ImmutableList.<String>of() : ImmutableList.copyOf(workspaceSchemaPath);
}
项目:dremio-oss
文件:InitialDataPreviewResponse.java
@JsonCreator
public InitialDataPreviewResponse(
@JsonProperty("data") JobDataFragment data,
@JsonProperty("paginationUrl") String paginationUrl) {
this.data = data;
this.paginationUrl = paginationUrl;
}
项目:conf4j
文件:ConfigurationViewProviderTest.java
@JsonCreator
TestConfiguration(@JsonProperty("port") int port, @JsonProperty("serviceName") String serviceName,
@JsonProperty("database") DatabaseConfiguration database) {
this.port = port;
this.serviceName = serviceName;
this.database = database;
}
项目:joal
文件:AlwaysRefreshKeyGenerator.java
@JsonCreator
AlwaysRefreshKeyGenerator(
@JsonProperty(value = "algorithm", required = true) final KeyAlgorithm algorithm,
@JsonProperty(value = "keyCase", required = true) final Casing keyCase
) {
super(algorithm, keyCase);
}