com.fasterxml.jackson.databind.annotation.JsonDeserialize#com.fasterxml.jackson.annotation.JsonCreator源码实例Demo

下面列出了com.fasterxml.jackson.databind.annotation.JsonDeserialize#com.fasterxml.jackson.annotation.JsonCreator 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: data-transfer-project   文件: PhotoModel.java
@JsonCreator
public PhotoModel(
    @JsonProperty("title") String title,
    @JsonProperty("fetchableUrl") String fetchableUrl,
    @JsonProperty("description") String description,
    @JsonProperty("mediaType") String mediaType,
    @JsonProperty("dataId") String dataId,
    @JsonProperty("albumId") String albumId,
    @JsonProperty("inTempStore") boolean inTempStore) {
  this.title = title;
  this.fetchableUrl = fetchableUrl;
  this.description = description;
  this.mediaType = mediaType;
  if (dataId == null || dataId.isEmpty()) {
    throw new IllegalArgumentException("dataID must be set");
  }
  this.dataId = dataId;
  this.albumId = albumId;
  this.inTempStore = inTempStore;
}
 
@Builder
@JsonCreator
private JSONNotificationTarget(
		@JsonProperty("targetType") @NonNull final UserNotificationTargetType targetType,
		@JsonProperty("windowId") final String windowId,
		@JsonProperty("documentId") final String documentId,
		@JsonProperty("viewId") final String viewId)
{
	this.targetType = targetType;

	this.windowId = windowId;
	this.documentType = windowId;
	this.documentId = documentId;

	this.viewId = viewId;
}
 
源代码3 项目: tasmo   文件: ModelPath.java
@JsonCreator
public ModelPath(
        @JsonProperty("id") String id,
        @JsonProperty("pathMembers") List<ModelPathStep> pathMembers) {
    this.id = id;
    this.pathMembers = pathMembers;

    boolean assignedRootId = false;
    for (int i = 0; i < this.pathMembers.size(); i++) {
        ModelPathStep member = pathMembers.get(i);
        if (member.getIsRootId()) {
            if (assignedRootId) {
                throw new RuntimeException("should only have one root id declared, check " + member.toString());
            } else {
                this.rootIdIndex = i;
                assignedRootId = true;
            }
        }
    }
    if (!assignedRootId) {
        throw new IllegalStateException("ModelPath must have a root id.");
    }
}
 
源代码4 项目: batfish   文件: AutocompleteSuggestion.java
@JsonCreator
private static @Nonnull AutocompleteSuggestion create(
    @Nullable @JsonProperty(PROP_TEXT) String text,
    @Nullable @JsonProperty(PROP_SUGGESTION_TYPE) SuggestionType suggestionType,
    @JsonProperty(PROP_IS_PARTIAL) boolean isPartial,
    @Nullable @JsonProperty(PROP_DESCRIPTION) String description,
    @JsonProperty(PROP_RANK) int rank,
    @JsonProperty(PROP_INSERTION_INDEX) int insertionIndex,
    @Nullable @JsonProperty(PROP_HINT) String hint) {
  return new AutocompleteSuggestion(
      firstNonNull(text, ""),
      firstNonNull(suggestionType, SuggestionType.UNKNOWN),
      isPartial,
      description,
      rank,
      insertionIndex,
      hint);
}
 
源代码5 项目: docker-client   文件: RegistryConfigs.java
@JsonCreator
public static RegistryConfigs create(final Map<String, RegistryAuth> configs) {
  if (configs == null) {
    return empty();
  }

  // need to add serverAddress to each RegistryAuth instance; it is not available when
  // Jackson is deserializing the RegistryAuth field
  final Map<String, RegistryAuth> transformedMap = Maps.transformEntries(configs,
      new Maps.EntryTransformer<String, RegistryAuth, RegistryAuth>() {
        @Override
        public RegistryAuth transformEntry(final String key, final RegistryAuth value) {
          if (value == null) {
            return null;
          }
          if (value.serverAddress() == null) {
            return value.toBuilder()
                .serverAddress(key)
                .build();
          }
          return value;
        }
      });

  return builder().configs(transformedMap).build();
}
 
源代码6 项目: besu   文件: BlockData.java
@JsonCreator
public BlockData(
    @JsonProperty("number") final Optional<String> number,
    @JsonProperty("parentHash") final Optional<String> parentHash,
    @JsonProperty("coinbase") final Optional<String> coinbase,
    @JsonProperty("extraData") final Optional<String> extraData,
    @JsonProperty("transactions") final List<TransactionData> transactions) {
  this.number = number.map(UInt256::fromHexString).map(UInt256::toLong);
  this.parentHash = parentHash.map(Bytes32::fromHexString).map(Hash::wrap);
  this.coinbase = coinbase.map(Address::fromHexString);
  this.extraData = extraData.map(Bytes::fromHexStringLenient);
  this.transactionData = transactions;
}
 
源代码7 项目: docker-client   文件: Container.java
@JsonCreator
static Container create(
    @JsonProperty("Id") final String id,
    @JsonProperty("Names") final List<String> names,
    @JsonProperty("Image") final String image,
    @JsonProperty("ImageID") final String imageId,
    @JsonProperty("Command") final String command,
    @JsonProperty("Created") final Long created,
    @JsonProperty("State") final String state,
    @JsonProperty("Status") final String status,
    @JsonProperty("Ports") final List<PortMapping> ports,
    @JsonProperty("Labels") final Map<String, String> labels,
    @JsonProperty("SizeRw") final Long sizeRw,
    @JsonProperty("SizeRootFs") final Long sizeRootFs,
    @JsonProperty("NetworkSettings") final NetworkSettings networkSettings,
    @JsonProperty("Mounts") final List<ContainerMount> mounts) {
  final ImmutableMap<String, String> labelsT = labels == null
                                               ? null : ImmutableMap.copyOf(labels);
  final ImmutableList<ContainerMount> mountsT = mounts == null
                                                ? null : ImmutableList.copyOf(mounts);
  final ImmutableList<String> namesT = names == null
          ? null : ImmutableList.copyOf(names);
  final ImmutableList<PortMapping> portsT = ports == null
          ? null : ImmutableList.copyOf(ports);

  return new AutoValue_Container(id, namesT, image, imageId, command,
      created, state, status, portsT, labelsT, sizeRw,
      sizeRootFs, networkSettings, mountsT);
}
 
源代码8 项目: Bats   文件: MergeJoinPOP.java
@JsonCreator
public MergeJoinPOP(
    @JsonProperty("left") PhysicalOperator left,
    @JsonProperty("right") PhysicalOperator right,
    @JsonProperty("conditions") List<JoinCondition> conditions,
    @JsonProperty("joinType") JoinRelType joinType
) {
  super(left, right, joinType, false, null, conditions);
  Preconditions.checkArgument(joinType != null, "Join type is missing!");
  Preconditions.checkArgument(joinType != JoinRelType.FULL,
    "Full outer join not currently supported with Merge Join");
}
 
源代码9 项目: restdocs-wiremock   文件: NotePatchInput.java
@JsonCreator
public NotePatchInput(@JsonProperty("title") String title,
		@JsonProperty("body") String body, @JsonProperty("tags") List<URI> tagUris) {
	this.title = title;
	this.body = body;
	this.tagUris = tagUris == null ? Collections.<URI>emptyList() : tagUris;
}
 
源代码10 项目: openapi-generator   文件: Order.java
@JsonCreator
public static StatusEnum fromValue(String value) {
  for (StatusEnum b : StatusEnum.values()) {
    if (b.value.equals(value)) {
      return b;
    }
  }
  throw new IllegalArgumentException("Unexpected value '" + value + "'");
}
 
源代码11 项目: docker-client   文件: Driver.java
@JsonCreator
static Driver create(
    @JsonProperty("Name") final String name,
    @JsonProperty("Options") final Map<String, String> options) {
  final Builder builder = builder()
      .name(name);

  if (options != null) {
    builder.options(options);
  }

  return builder.build();
}
 
源代码12 项目: dcos-commons   文件: DefaultResourceSpec.java
@JsonCreator
protected DefaultResourceSpec(
    @JsonProperty("name") String name,
    @JsonProperty("value") Protos.Value value,
    @JsonProperty("role") String role,
    @JsonProperty("pre-reserved-role") String preReservedRole,
    @JsonProperty("principal") String principal)
{
  this.name = name;
  this.value = value;
  this.role = role;
  this.preReservedRole = preReservedRole == null ? Constants.ANY_ROLE : preReservedRole;
  this.principal = principal;
}
 
源代码13 项目: batfish   文件: If.java
@JsonCreator
@Nonnull
private static If jsonCreator(
    @Nullable @JsonProperty(PROP_ACTIONS) List<Statement> actions,
    @Nullable @JsonProperty(PROP_TRUE_STATEMENTS) BoolExpr matchCondition) {
  checkArgument(matchCondition != null, "Missing %s", PROP_TRUE_STATEMENTS);
  return new If(matchCondition, firstNonNull(actions, ImmutableList.of()));
}
 
源代码14 项目: eventeum   文件: ParameterType.java
@JsonCreator
public static ParameterType build(String type) {
    final ParameterType paramType = new ParameterType();
    paramType.setType(type);

    return paramType;
}
 
源代码15 项目: openapi-generator   文件: EnumTest.java
@JsonCreator
public static EnumNumberEnum fromValue(Double value) {
  for (EnumNumberEnum b : EnumNumberEnum.values()) {
    if (b.value.equals(value)) {
      return b;
    }
  }
  throw new IllegalArgumentException("Unexpected value '" + value + "'");
}
 
源代码16 项目: Singularity   文件: SingularityPortMapping.java
@JsonCreator
public SingularityPortMapping(
  @JsonProperty("hostPort") int hostPort,
  @JsonProperty("containerPort") int containerPort,
  @JsonProperty("protocol") Optional<String> protocol
) {
  this.hostPort = hostPort;
  this.containerPort = containerPort;
  this.protocol = protocol;
}
 
源代码17 项目: alfresco-data-model   文件: IntervalParameters.java
@JsonCreator
public IntervalParameters(
            @JsonProperty("sets") Set<IntervalSet> sets,
            @JsonProperty("intervals") List<Interval> intervals)
{
    this.sets = sets;
    this.intervals = intervals;
}
 
源代码18 项目: dremio-oss   文件: IcebergTableProps.java
@JsonCreator
public IcebergTableProps(
  @JsonProperty("tableLocation") String tableLocation,
  @JsonProperty("uuid") String uuid,
  @JsonProperty("fullSchema") BatchSchema fullSchema,
  @JsonProperty("partitionColumnNames") List<String> partitionColumnNames,
  @JsonProperty("icebergOpType") IcebergOperation.Type icebergOpType
  ) {
    this.tableLocation = tableLocation;
    this.uuid = uuid;
    this.fullSchema = fullSchema;
    this.partitionColumnNames = partitionColumnNames;
    this.icebergOpType = icebergOpType;
}
 
源代码19 项目: NLIWOD   文件: EJAnswers.java
@JsonCreator
public static EJAnswers factory(final String json) {
	try {
		return new ObjectMapper().readValue(json, EJAnswers.class);
	} catch (IOException e) {
		// TODO Auto-generated catch block
		e.printStackTrace();
		return null;
	}
}
 
源代码20 项目: ffwd   文件: ProtocolFactory.java
@JsonCreator
public ProtocolFactory(
    @JsonProperty("type") String type, @JsonProperty("host") String host,
    @JsonProperty("port") Integer port,
    @JsonProperty("receiveBufferSize") Integer receiveBufferSize
) {
    this.type = type;
    this.host = host;
    this.port = port;
    this.receiveBufferSize = receiveBufferSize;
}
 
源代码21 项目: blynk-server   文件: DailyReport.java
@JsonCreator
public DailyReport(@JsonProperty("atTime") long atTime,
                   @JsonProperty("durationType") ReportDurationType durationType,
                   @JsonProperty("startTs") long startTs,
                   @JsonProperty("endTs")long endTs) {
    this.atTime = atTime;
    this.durationType = durationType;
    this.startTs = startTs;
    this.endTs = endTs;
}
 
源代码22 项目: onos   文件: Bmv2PreJsonGroups.java
@JsonCreator
public L1Handle(@JsonProperty("handle") int handle,
                @JsonProperty("l2_handle") int l2handle,
                @JsonProperty("rid") int rid) {
    this.handle = handle;
    this.l2handle = l2handle;
    this.rid = rid;
}
 
源代码23 项目: openapi-generator   文件: EnumTest.java
@JsonCreator
public static EnumNumberEnum fromValue(Double value) {
  for (EnumNumberEnum b : EnumNumberEnum.values()) {
    if (b.value.equals(value)) {
      return b;
    }
  }
  throw new IllegalArgumentException("Unexpected value '" + value + "'");
}
 
源代码24 项目: openapi-generator   文件: MapTest.java
@JsonCreator
public static InnerEnum fromValue(String value) {
  for (InnerEnum b : InnerEnum.values()) {
    if (b.value.equals(value)) {
      return b;
    }
  }
  throw new IllegalArgumentException("Unexpected value '" + value + "'");
}
 
源代码25 项目: vespa   文件: InstanceInformation.java
@JsonCreator
public Endpoint(@JsonProperty("cluster") String cluster ,
                @JsonProperty("tls") boolean tls,
                @JsonProperty("url") URI url,
                @JsonProperty("scope") String scope,
                @JsonProperty("routingMethod") RoutingMethod routingMethod) {
    this.cluster = cluster;
    this.tls = tls;
    this.url = url;
    this.scope = scope;
    this.routingMethod = routingMethod;
}
 
源代码26 项目: dhis2-android-sdk   文件: ImportCount.java
@JsonCreator
public static ImportCount create(
        @JsonProperty(IMPORTED) Integer imported,
        @JsonProperty(UPDATED) Integer updated,
        @JsonProperty(DELETED) Integer deleted,
        @JsonProperty(IGNORED) Integer ignored) {
    return new AutoValue_ImportCount(imported, updated, deleted, ignored);
}
 
源代码27 项目: openapi-generator   文件: InlineObject2.java
@JsonCreator
public static EnumFormStringEnum fromValue(String value) {
  for (EnumFormStringEnum b : EnumFormStringEnum.values()) {
    if (b.value.equals(value)) {
      return b;
    }
  }
  throw new IllegalArgumentException("Unexpected value '" + value + "'");
}
 
源代码28 项目: druid-api   文件: TimestampSpec.java
@JsonCreator
public TimestampSpec(
    @JsonProperty("column") String timestampColumn,
    @JsonProperty("format") String format,
    // this value should never be set for production data
    @JsonProperty("missingValue") DateTime missingValue
)
{
  this.timestampColumn = (timestampColumn == null) ? DEFAULT_COLUMN : timestampColumn;
  this.timestampFormat = format == null ? DEFAULT_FORMAT : format;
  this.timestampConverter = TimestampParser.createObjectTimestampParser(timestampFormat);
  this.missingValue = missingValue == null
                                     ? DEFAULT_MISSING_VALUE
                                     : missingValue;
}
 
源代码29 项目: Singularity   文件: SingularityRequestWithState.java
@JsonCreator
public SingularityRequestWithState(
  @JsonProperty("request") SingularityRequest request,
  @JsonProperty("state") RequestState state,
  @JsonProperty("timestamp") long timestamp
) {
  this.request = request;
  this.state = state;
  this.timestamp = timestamp;
}
 
源代码30 项目: batfish   文件: MinorIssueConfig.java
@JsonCreator
private static @Nonnull MinorIssueConfig create(
    @JsonProperty(PROP_MINOR_ISSUE) @Nullable String minorIssue,
    @JsonProperty(PROP_SEVERITY) @Nullable Integer severity,
    @JsonProperty(PROP_URL) @Nullable String url) {
  return new MinorIssueConfig(
      requireNonNull(minorIssue, "'minorIssue' cannot be null"), severity, url);
}