@JsonCreator public ResourceTemplateMetaData(@JsonProperty("templateName") final String templateName, @JsonProperty("contentType") final MediaType contentType, @JsonProperty("deployFileName") final String deployFileName, @JsonProperty("deployPath") final String deployPath, @JsonProperty("entity") final Entity entity, @JsonProperty("unpack") final Boolean unpack, @JsonProperty("overwrite") Boolean overwrite, @JsonProperty("hotDeploy") Boolean hotDeploy) { this.templateName = templateName; this.contentType = contentType; this.deployFileName = deployFileName; this.deployPath = deployPath; this.entity = entity; this.unpack = unpack == null ? false : unpack; this.overwrite = overwrite == null ? true : overwrite; this.hotDeploy = hotDeploy == null ? false : hotDeploy; }
/** * Constructor for deserialisation from JSON (for example in the unit test). * * @param inProgress whether indexing is in progress * @param issueKeyCount the number of issues keys fetched so far * @param totalIssueKeyCount the total number of issues keys to fetch * @param pullRequestCount the number of pull requests fetched so far * @param totalPullRequestCount the total number of pull requests to fetch * @param exception any exception that occurred during reindexing * @param stopped whether the user has stopped the reindexing */ @JsonCreator DevSummaryCachePrimingStatus( @JsonProperty ("inProgress") final boolean inProgress, @JsonProperty ("issueKeyCount") final int issueKeyCount, @JsonProperty ("totalIssueKeyCount") final int totalIssueKeyCount, @JsonProperty ("pullRequestCount") final int pullRequestCount, @JsonProperty ("totalPullRequestCount") final int totalPullRequestCount, @JsonProperty ("error") final Exception exception, @JsonProperty ("stopped") final boolean stopped, @JsonProperty ("timeTaken") final String timeTaken) { this(); this.exception.set(exception); this.inProgress.set(inProgress); this.stopped.set(stopped); this.issueKeyCount.set(issueKeyCount); this.totalIssueKeyCount.set(totalIssueKeyCount); this.pullRequestCount.set(pullRequestCount); this.totalPullRequestCount.set(totalPullRequestCount); this.timeTaken.set(timeTaken); }
@JsonCreator public EnrichedEventBodyExtraData(@JsonProperty("topic") String topic, @JsonProperty("timestamp") String timestamp, @JsonProperty("sha1Hex") String sha1Hex, @JsonProperty("filePath") String filePath, @JsonProperty("fileName") String fileName, @JsonProperty("lineNumber") String lineNumber, @JsonProperty("type") String type) { this.topic = topic; this.timestamp = timestamp; this.sha1Hex = sha1Hex; this.filePath = filePath; this.fileName = fileName; this.lineNumber = lineNumber; this.type = type; }
@JsonCreator public RelationMixin( @JsonProperty("minDistanceBetweenStarts") Integer minDistanceBetweenStarts, @JsonProperty("minDistanceBetweenStartsUnits") Unit minDistanceBetweenStartsUnits, @JsonProperty("maxDistanceBetweenStarts") Integer maxDistanceBetweenStarts, @JsonProperty("maxDistanceBetweenStartsUnits") Unit maxDistanceBetweenStartsUnits, @JsonProperty("minSpan") Integer minSpan, @JsonProperty("minSpanUnits") Unit minSpanUnits, @JsonProperty("maxSpan") Integer maxSpan, @JsonProperty("maxSpanUnits") Unit maxSpanUnits, @JsonProperty("minDistanceBetween") Integer minDistanceBetween, @JsonProperty("minDistanceBetweenUnits") Unit minDistanceBetweenUnits, @JsonProperty("maxDistanceBetween") Integer maxDistanceBetween, @JsonProperty("maxDistanceBetweenUnits") Unit maxDistanceBetweenUnits, @JsonProperty("minDistanceBetweenFinishes") Integer minDistanceBetweenFinishes, @JsonProperty("minDistanceBetweenFinishesUnits") Unit minDistanceBetweenFinishesUnits, @JsonProperty("maxDistanceBetweenFinishes") Integer maxDistanceBetweenFinishes, @JsonProperty("maxDistanceBetweenFinishesUnits") Unit maxDistanceBetweenFinishesUnits) { }
@JsonCreator public QMMetric( @JsonProperty("name") final String name, @JsonProperty("children") final List<QMMetric> children, @JsonProperty("description") final String description, @JsonProperty("lowerLimit") final float lowerLimit, @JsonProperty("scale") final Scale scale, @JsonProperty("source") final MetricSource source, @JsonProperty("targetValue") final float targetValue, @JsonProperty("unit") final Unit unit, @JsonProperty("upperLimit") final float upperLimit, @JsonProperty("weight") final float weight) { this.setName(name); this.setDescription(description); this.setCompleted(true); this.setLowerLimit((double) lowerLimit); this.setScale(scale); this.setSource(source); this.setTargetValue(targetValue); this.setUnit(unit); this.setUpperLimit((double) upperLimit); this.setWeight(weight); }
@JsonCreator public ServiceMetrics(@JsonProperty("name") String name, @JsonProperty("application") String application, @JsonProperty("successCount") int successCount, @JsonProperty("faultCount") int faultCount, @JsonProperty("totalCount") int totalCount, @JsonProperty("averageTime") double averageTime, @JsonProperty("minTime") long minTime, @JsonProperty("maxTime") long maxTime, @JsonProperty("totalTime") long totalTime, @JsonProperty("operations") OperationMetrics[] operations, @JsonProperty("gateways") GatewayMetrics[] gateways) { super(successCount, faultCount, totalCount, averageTime, minTime, maxTime, totalTime); this.name = name; this.application = application; this.operationMetrics = ModelUtil.createNamedMetricMap(operations); this.gatewayMetrics = ModelUtil.createNamedMetricMap(gateways); }
@JsonCreator public ComponentServiceMetrics(@JsonProperty("name") String name, @JsonProperty("application") String application, @JsonProperty("successCount") int successCount, @JsonProperty("faultCount") int faultCount, @JsonProperty("totalCount") int totalCount, @JsonProperty("averageTime") double averageTime, @JsonProperty("minTime") long minTime, @JsonProperty("maxTime") long maxTime, @JsonProperty("totalTime") long totalTime, @JsonProperty("operations") OperationMetrics[] operations, @JsonProperty("references") ComponentReferenceMetrics[] references) { super(successCount, faultCount, totalCount, averageTime, minTime, maxTime, totalTime); this.name = name; this.application = application; this.operationMetrics = ModelUtil.createNamedMetricMap(operations); this.componentReferenceMetrics = ModelUtil.createNamedMetricMap(references); }
@JsonCreator public ReferenceMetrics(@JsonProperty("name") String name, @JsonProperty("application") String application, @JsonProperty("successCount") int successCount, @JsonProperty("faultCount") int faultCount, @JsonProperty("totalCount") int totalCount, @JsonProperty("averageTime") double averageTime, @JsonProperty("minTime") long minTime, @JsonProperty("maxTime") long maxTime, @JsonProperty("totalTime") long totalTime, @JsonProperty("operations") OperationMetrics[] operations, @JsonProperty("gateways") GatewayMetrics[] gateways) { super(successCount, faultCount, totalCount, averageTime, minTime, maxTime, totalTime); this.name = name; this.application = application; this.operationMetrics = ModelUtil.createNamedMetricMap(operations); this.gatewayMetrics = ModelUtil.createNamedMetricMap(gateways); }
@JsonCreator public DependencyGraph(final @JsonProperty(DEPENDENCIES_PROPERTY) Map<String, Collection<ModuleDescriptor>> dependencies ) { final Set<Entry<String, Collection<ModuleDescriptor>>> entrySet = Preconditions.checkNotNull(dependencies).entrySet(); final ImmutableMultimap.Builder<String, ModuleDescriptor> builder = ImmutableMultimap.builder(); for (final Entry<String, Collection<ModuleDescriptor>> entry : entrySet) { final Collection<ModuleDescriptor> values = entry.getValue(); for (final ModuleDescriptor moduleDescriptor : values) { Preconditions.checkState(moduleDescriptor instanceof ModuleDescriptor); builder.put(entry.getKey(), moduleDescriptor); } } this.dependencies = builder.build().asMap();; }
@JsonCreator public TestResult( @JsonProperty("testClass") String testClass, @JsonProperty("testMethod") String testMethod, @JsonProperty("status") Status status, @JsonProperty("startTime") long startTime, @JsonProperty("duration") long duration, @JsonProperty("stackTrace") String stackTrace) { this.testClass = testClass; this.testMethod = testMethod; this.status = status; this.startTime = startTime; this.duration = duration; this.stackTrace = stackTrace; this.screenshots = Lists.newLinkedList(); }
/** * Returns a new {@link FuzzyCondition}. * * @param boost The boost for this query clause. Documents matching this clause will (in addition to the * normal weightings) have their score multiplied by {@code boost}. If {@code null}, then * {@link #DEFAULT_BOOST} is used as default. * @param field The field name. * @param value The field fuzzy value. * @param maxEdits Must be >= 0 and <= {@link LevenshteinAutomata#MAXIMUM_SUPPORTED_DISTANCE}. * @param prefixLength Length of common (non-fuzzy) prefix * @param maxExpansions The maximum number of terms to match. If this number is greater than {@link * BooleanQuery#getMaxClauseCount} when the query is rewritten, then the maxClauseCount will * be used instead. * @param transpositions True if transpositions should be treated as a primitive edit operation. If this is false, * comparisons will implement the classic Levenshtein algorithm. */ @JsonCreator public FuzzyCondition(@JsonProperty("boost") Float boost, @JsonProperty("field") String field, @JsonProperty("value") String value, @JsonProperty("max_edits") Integer maxEdits, @JsonProperty("prefix_length") Integer prefixLength, @JsonProperty("max_expansions") Integer maxExpansions, @JsonProperty("transpositions") Boolean transpositions) { super(boost); this.field = field; this.value = value; this.maxEdits = maxEdits == null ? DEFAULT_MAX_EDITS : maxEdits; this.prefixLength = prefixLength == null ? DEFAULT_PREFIX_LENGTH : prefixLength; this.maxExpansions = maxExpansions == null ? DEFAULT_MAX_EXPANSIONS : maxExpansions; this.transpositions = transpositions == null ? DEFAULT_TRANSPOSITIONS : transpositions; }
/** * Builds a new {@link ColumnMapperBigDecimal} using the specified max number of digits. * * @param digits The max number of digits. If {@code null}, the {@link #DEFAULT_DIGITS} will be used. */ @JsonCreator public ColumnMapperBigInteger(@JsonProperty("digits") Integer digits) { super(new AbstractType<?>[]{AsciiType.instance, UTF8Type.instance, Int32Type.instance, LongType.instance, IntegerType.instance}, new AbstractType[]{}); if (digits != null && digits <= 0) { throw new IllegalArgumentException("Positive digits required"); } this.digits = digits == null ? DEFAULT_DIGITS : digits; complement = BigInteger.valueOf(10).pow(this.digits).subtract(BigInteger.valueOf(1)); BigInteger maxValue = complement.multiply(BigInteger.valueOf(2)); hexDigits = encode(maxValue).length(); }
/** * Builds a new {@link ColumnMapperString}. * * @param caseSensitive If the getAnalyzer must be case sensitive. */ @JsonCreator public ColumnMapperString(@JsonProperty("case_sensitive") Boolean caseSensitive) { super(new AbstractType<?>[]{AsciiType.instance, UTF8Type.instance, Int32Type.instance, LongType.instance, IntegerType.instance, FloatType.instance, DoubleType.instance, BooleanType.instance, UUIDType.instance, TimeUUIDType.instance, TimestampType.instance, BytesType.instance, InetAddressType.instance}, new AbstractType[]{UTF8Type.instance}); this.caseSensitive = caseSensitive == null ? DEFAULT_CASE_SENSITIVE : caseSensitive; }
/** * Builds a new {@link ColumnMapperDate} using the specified pattern. * * @param pattern The {@link SimpleDateFormat} pattern to be used. */ @JsonCreator public ColumnMapperDate(@JsonProperty("pattern") String pattern) { super(new AbstractType<?>[]{AsciiType.instance, UTF8Type.instance, Int32Type.instance, LongType.instance, IntegerType.instance, FloatType.instance, DoubleType.instance, DecimalType.instance, TimestampType.instance}, new AbstractType[]{LongType.instance, TimestampType.instance}); this.pattern = pattern == null ? DEFAULT_PATTERN : pattern; concurrentDateFormat = new ThreadLocal<DateFormat>() { @Override protected DateFormat initialValue() { return new SimpleDateFormat(ColumnMapperDate.this.pattern); } }; }
/** * Builds a new {@link SnowballAnalyzerBuilder} for the specified language and stopwords. * * @param language The language. The supported languages are English, French, Spanish, Portuguese, Italian, * Romanian, German, Dutch, Swedish, Norwegian, Danish, Russian, Finnish, Irish, Hungarian, * Turkish, Armenian, Basque and Catalan. * @param stopwords The comma separated stopwords {@code String}. */ @JsonCreator public SnowballAnalyzerBuilder(@JsonProperty("language") final String language, @JsonProperty("stopwords") String stopwords) { // Check language if (language == null || language.trim().isEmpty()) { throw new IllegalArgumentException("Language must be specified"); } // Setup stopwords CharArraySet stops = stopwords == null ? getDefaultStopwords(language) : getStopwords(stopwords); // Setup analyzer this.analyzer = buildAnalyzer(language, stops); // Force analysis validation AnalysisUtils.analyzeAsText("test", analyzer); }
@JsonCreator public TileRegisterAction(@JsonProperty(PROPERTY_NAME_TEMP_TOKEN) String code, @JsonProperty(PROPERTY_NAME_CONFIG_JSON) Map<String, String> config, @JsonProperty(PROPERTY_NAME_JIVE_PUSH_URL) String jivePushUrl, @JsonProperty(PROPERTY_NAME_JIVE_INSTANCE_URL) String jiveInstanceUrl, @JsonProperty(PROPERTY_NAME_TENANT_ID) String tenantID, @JsonProperty(PROPERTY_NAME_TILE_INSTANCE_ID) String tileInstanceID, @JsonProperty(PROPERTY_NAME_ITEM_TYPE) String itemType, @JsonProperty(PROPERTY_PARENT) String parent, @JsonProperty(PROPERTY_GUID) String guid, @JsonProperty(PROPERTY_PLACE_URI) String placeUri ) { this.code = code; this.config = config; this.tileInstanceID = tileInstanceID; this.jivePushUrl = jivePushUrl; this.jiveUrl = jiveInstanceUrl; this.tenantID = tenantID; this.tileDefName = itemType; this.itemType = itemType; this.parent = parent; this.guid = guid; this.placeUri = placeUri; }
@JsonCreator public InstanceRegisterAction( @JsonProperty(TENANT_ID) String tenantId, @JsonProperty(JIVE_SIGNATURE_URL) String jiveSignatureURL, @JsonProperty(TIMESTAMP) String timestamp, @JsonProperty(JIVE_URL) String jiveUrl, @JsonProperty(JIVE_SIGNATURE) String jiveSignature, @JsonProperty(SCOPE) String scope, @JsonProperty(CODE) String code, @JsonProperty(CLIENT_SECRET) String clientSecret, @JsonProperty(CLIENT_ID) String clientId) { this.tenantId = tenantId; this.jiveSignatureURL = jiveSignatureURL; this.timestamp = timestamp; this.jiveUrl = jiveUrl; this.jiveSignature = jiveSignature; this.scope = scope; this.code = code; this.clientSecret = clientSecret; this.clientId = clientId; }
@JsonCreator public Alert(@JsonProperty("token") String token, @JsonProperty("type") SetAlertPayload.AlertType type, @JsonProperty("scheduledTime") String scheduledTime) { this.token = token; this.type = type; this.scheduledTime = scheduledTime; }
@JsonCreator public Entity(@JsonProperty("type") final String type, @JsonProperty("group") final String group, @JsonProperty("target") final String target, @JsonProperty("parentName") final String parentName, @JsonProperty("deployToJvms") final Boolean deployToJvms) { this.type = type; this.group = group; this.target = target; this.parentName = parentName; this.deployToJvms = deployToJvms == null ? true : deployToJvms; }
@JsonCreator public JobTypeStats( @JsonProperty("type") Types type, @JsonProperty("count") int count) { this.type = type; this.count = count; }
@JsonCreator public TierInfo( @JsonProperty("preemptible") boolean preemptible, @JsonProperty("revocable") boolean revocable) { this.preemptible = preemptible; this.revocable = revocable; }
@JsonCreator public ResourceOptions(@JsonProperty("default_analyzer") String analyzer, @JsonProperty("resources") Map<String, Set<String>> resources) throws InstantiationException, IllegalAccessException, ClassNotFoundException { if (analyzer == null) { this.defaultAnalyzer = new WhitespaceAnalyzer(); } else { this.defaultAnalyzer = (Analyzer) Class.forName(analyzer).newInstance(); } if (resources != null) { this.resources.putAll(resources); } }
/** * @param port int * @param hostname String * @param zone the zone of the server * @param useTls boolean */ @JsonCreator public HostMetadata(@JsonProperty("hostname") String hostname, @JsonProperty("port") int port, @JsonProperty("zone") String zone, @JsonProperty("useTls") boolean useTls) { this.port = port; this.hostname = hostname; this.zone = zone; this.useTls = useTls; }
@JsonCreator public JsonTableGroupScan(@JsonProperty("userName") final String userName, @JsonProperty("scanSpec") JsonScanSpec scanSpec, @JsonProperty("storage") FileSystemConfig storagePluginConfig, @JsonProperty("format") MapRDBFormatPluginConfig formatPluginConfig, @JsonProperty("columns") List<SchemaPath> columns, @JacksonInject StoragePluginRegistry pluginRegistry) throws IOException, ExecutionSetupException { this (userName, (FileSystemPlugin) pluginRegistry.getPlugin(storagePluginConfig), (MapRDBFormatPlugin) pluginRegistry.getFormatPlugin(storagePluginConfig, formatPluginConfig), scanSpec, columns); }
@JsonCreator public BinaryTableGroupScan(@JsonProperty("userName") final String userName, @JsonProperty("hbaseScanSpec") HBaseScanSpec scanSpec, @JsonProperty("storage") FileSystemConfig storagePluginConfig, @JsonProperty("format") MapRDBFormatPluginConfig formatPluginConfig, @JsonProperty("columns") List<SchemaPath> columns, @JacksonInject StoragePluginRegistry pluginRegistry) throws IOException, ExecutionSetupException { this (userName, (FileSystemPlugin) pluginRegistry.getPlugin(storagePluginConfig), (MapRDBFormatPlugin) pluginRegistry.getFormatPlugin(storagePluginConfig, formatPluginConfig), scanSpec, columns); }
@JsonCreator public static MSPEnum fromValue(String value) { for (MSPEnum e : MSPEnum.values()) { if (e.value.equals(value)) { return e; } } throw new IllegalArgumentException(value); }
@JsonCreator public ChangesetFileDetail(@JsonProperty("fileAction") ChangesetFileAction fileAction, @JsonProperty("file") String file, @JsonProperty("additions") int additions, @JsonProperty("deletions") int deletions) { super(fileAction, file); this.additions = additions; this.deletions = deletions; }
@JsonCreator private static DevSummaryChangedEvent fromJSON(@JsonProperty ("repositoryId") int repositoryId, @JsonProperty ("dvcsType") String dvcsType, @JsonProperty ("issueKeys") Set<String> issueKeys, @JsonProperty ("date") Date date) { return new DevSummaryChangedEvent(repositoryId, dvcsType, issueKeys, date); }
@JsonCreator public EnrichedEventBody(@JsonProperty("extraData") Map<String, String> extraData, @JsonProperty("message") String message) { if (extraData == null) { this.extraData = new HashMap<String, String>(); } else { this.extraData = extraData; } this.message = message; }
@JsonCreator public ServingInfo(@JsonProperty("hdfsPath") String hdfsPath, @JsonProperty("helixResource") String helixResource, @JsonProperty("numPartitions") int numPartitions, @JsonProperty("partitionerType") PartitionerType partitionerType) { this.hdfsPath = Preconditions.checkNotNull(hdfsPath); this.helixResource = Preconditions.checkNotNull(helixResource); this.numPartitions = numPartitions; this.partitionerType = partitionerType; }
@JsonCreator public UserPageAdClick( @JsonProperty("userId") String userId, @JsonProperty("pageId") String pageId, @JsonProperty("adId") String adId) { this.userId = userId; this.pageId = pageId; this.adId = adId; }
@JsonCreator public EnrichedPageView( @JsonProperty("pageKey") String pageKey, @JsonProperty("memberId") int memberId, @JsonProperty("company") String company) { super(pageKey, memberId); this.company = company; }
@JsonCreator public static AwayState forValue(String v) { for (AwayState s : AwayState.values()) { if (s.state.equals(v)) { return s; } } throw new IllegalArgumentException("Invalid state: " + v); }
@JsonCreator public static HvacMode forValue(String v) { for (HvacMode hm : HvacMode.values()) { if (hm.mode.equals(v)) { return hm; } } throw new IllegalArgumentException("Invalid hvac_mode: " + v); }
@JsonCreator public static HvacState forValue(String v) { for (HvacState hs : HvacState.values()) { if (hs.state.equals(v)) { return hs; } } throw new IllegalArgumentException("Invalid hvac_state: " + v); }
@JsonCreator public static BatteryHealth forValue(String v) { for (BatteryHealth bs : BatteryHealth.values()) { if (bs.state.equals(v)) { return bs; } } throw new IllegalArgumentException("Invalid battery_state: " + v); }
@JsonCreator public static AlarmState forValue(String v) { for (AlarmState as : AlarmState.values()) { if (as.state.equals(v)) { return as; } } throw new IllegalArgumentException("Invalid alarm_state: " + v); }
@JsonCreator public static ColorState forValue(String v) { for (ColorState cs : ColorState.values()) { if (cs.state.equals(v)) { return cs; } } throw new IllegalArgumentException("Invalid color_state: " + v); }
@JsonCreator public static SelectionType forValue(String v) { for (SelectionType st : SelectionType.values()) { if (st.type.equals(v)) { return st; } } throw new IllegalArgumentException("Invalid selection type: " + v); }
@JsonCreator public static HvacMode forValue(String v) { for (HvacMode hm : HvacMode.values()) { if (hm.mode.equals(v)) { return hm; } } throw new IllegalArgumentException("Invalid hvacMode: " + v); }