org.codehaus.jackson.annotate.JsonProperty Java Examples

The following examples show how to use org.codehaus.jackson.annotate.JsonProperty. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ColumnMapperBigInteger.java    From stratio-cassandra with Apache License 2.0 6 votes vote down vote up
/**
 * 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();
}
 
Example #2
Source File: SnowballAnalyzerBuilder.java    From stratio-cassandra with Apache License 2.0 6 votes vote down vote up
/**
 * 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);
}
 
Example #3
Source File: IndexMetadata.java    From Raigad with Apache License 2.0 5 votes vote down vote up
@JsonCreator
public IndexMetadata(
        @JsonProperty("indexName") String indexName,
        @JsonProperty("indexNamePattern") String indexNamePattern,
        @JsonProperty("retentionType") String retentionType,
        @JsonProperty("retentionPeriod") String retentionPeriod,
        @JsonProperty("preCreate") Boolean preCreate) throws UnsupportedAutoIndexException {

    if (retentionType == null) {
        retentionType = "DAILY";
    }
    RETENTION_TYPE retType = RETENTION_TYPE.valueOf(retentionType.toUpperCase());

    // If legacy prefix is used, then quote it so it will be used as plain text in
    // date pattern
    String prefix = (indexName == null) ? "" : "'" + indexName + "'";

    String namePattern = (indexNamePattern == null)
        ? prefix + retType.datePattern
        : indexNamePattern;

    this.indexNamePattern = (indexName == null && indexNamePattern == null)
        ? null
        : namePattern;

    this.formatter = DateTimeFormat.forPattern(namePattern).withZoneUTC();
    this.indexNameFilter = new DatePatternIndexNameFilter(formatter);

    if (retentionPeriod == null) {
        this.retentionPeriod = null;
    } else if (retentionPeriod.startsWith("P")) {
        this.retentionPeriod = ISOPeriodFormat.standard().parsePeriod(retentionPeriod);
    } else {
        Integer num = Integer.parseInt(retentionPeriod);
        String period = String.format(retType.periodFormat, num);
        this.retentionPeriod = ISOPeriodFormat.standard().parsePeriod(period);
    }

    this.preCreate = preCreate == null ? false : preCreate;
}
 
Example #4
Source File: GeoShapeCondition.java    From stratio-cassandra with Apache License 2.0 5 votes vote down vote up
/**
 * Constructor using the field name and the value to be matched.
 *
 * @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 name of the field to be matched.
 * @param shape The shape to be matched.
 */
@JsonCreator
public GeoShapeCondition(@JsonProperty("boost") Float boost,
                         @JsonProperty("field") String field,
                         @JsonProperty("operator") GeoOperator operator,
                         @JsonProperty("shape") GeoShape shape) {
    super(boost);
    this.field = field;
    this.shape = shape;
    this.operator = operator;
}
 
Example #5
Source File: TestRailService.java    From TestRailSDK with MIT License 5 votes vote down vote up
public Milestone updateMilestone(int milestoneId, final boolean isCompleted) {
    return postRESTBodyReturn(TestRailCommand.UPDATE_MILESTONE.getCommand(),
            Integer.toString(milestoneId),
            new BaseEntity() {
                @JsonProperty("is_completed")
                private String isCompletedBoolean = isCompleted ? "1":"0";
            },
            Milestone.class);
}
 
Example #6
Source File: TestRailService.java    From TestRailSDK with MIT License 5 votes vote down vote up
/**
 * Updates an existing configuration.
 * @param name The new name of the configuration
 * @param configId The ID of the configuration
 */
public void updateConfig(final String name, int configId) {
    postRESTBody(TestRailCommand.UPDATE_CONFIG.getCommand(), Integer.toString(configId),
            new BaseEntity() {
                @JsonProperty("name")
                private String nameString = name;
            });
}
 
Example #7
Source File: TestTopStateHandoffMetrics.java    From helix with Apache License 2.0 5 votes vote down vote up
@JsonCreator
public CurrentStateInfo(
    @JsonProperty("CurrentState") String cs,
    @JsonProperty("PreviousState") String ps,
    @JsonProperty("StartTime") long start,
    @JsonProperty("EndTime") long end
) {
  currentState = cs;
  previousState = ps;
  startTime = start;
  endTime = end;
}
 
Example #8
Source File: RegistryPathStatus.java    From hadoop with Apache License 2.0 5 votes vote down vote up
/**
 * Construct an instance
 * @param path full path
 * @param time time
 * @param size entry size
 * @param children number of children
 */
public RegistryPathStatus(
    @JsonProperty("path") String path,
    @JsonProperty("time") long time,
    @JsonProperty("size") long size,
    @JsonProperty("children") int children) {
  this.path = path;
  this.time = time;
  this.size = size;
  this.children = children;
}
 
Example #9
Source File: Schema.java    From stratio-cassandra with Apache License 2.0 5 votes vote down vote up
/**
 * Builds a new {@code ColumnsMapper} for the specified getAnalyzer and cell mappers.
 *
 * @param columnMappers   The {@link Column} mappers to be used.
 * @param analyzers        The {@link AnalyzerBuilder}s to be used.
 * @param defaultAnalyzer The name of the class of the getAnalyzer to be used.
 */
@JsonCreator
public Schema(@JsonProperty("fields") Map<String, ColumnMapper> columnMappers,
              @JsonProperty("analyzers") Map<String, AnalyzerBuilder> analyzers,
              @JsonProperty("default_analyzer") String defaultAnalyzer) {

    this.mapping = new Mapping(columnMappers);
    this.analysis = new Analysis(analyzers);
    this.defaultAnalyzer = analysis.getDefaultAnalyzer(defaultAnalyzer);
    this.analyzer = mapping.getAnalyzer(this.defaultAnalyzer, analysis);
}
 
Example #10
Source File: Entity.java    From jwala with Apache License 2.0 5 votes vote down vote up
@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;
}
 
Example #11
Source File: RegistryPathStatus.java    From big-c with Apache License 2.0 5 votes vote down vote up
/**
 * Construct an instance
 * @param path full path
 * @param time time
 * @param size entry size
 * @param children number of children
 */
public RegistryPathStatus(
    @JsonProperty("path") String path,
    @JsonProperty("time") long time,
    @JsonProperty("size") long size,
    @JsonProperty("children") int children) {
  this.path = path;
  this.time = time;
  this.size = size;
  this.children = children;
}
 
Example #12
Source File: Search.java    From stratio-cassandra with Apache License 2.0 5 votes vote down vote up
/**
 * Returns a new {@link Search} composed by the specified querying and filtering conditions.
 *
 * @param queryCondition  The {@link Condition} for querying, maybe {@code null} meaning no querying.
 * @param filterCondition The {@link Condition} for filtering, maybe {@code null} meaning no filtering.
 * @param sort            The {@link Sort} for the query. Note that is the order in which the data will be read
 *                        before querying, not the order of the results after querying.
 */
@JsonCreator
public Search(@JsonProperty("query") Condition queryCondition,
              @JsonProperty("filter") Condition filterCondition,
              @JsonProperty("sort") Sort sort) {
    this.queryCondition = queryCondition;
    this.filterCondition = filterCondition;
    this.sort = sort;
}
 
Example #13
Source File: PhraseCondition.java    From stratio-cassandra with Apache License 2.0 5 votes vote down vote up
/**
 * Constructor using the field name and the value to be matched.
 *
 * @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 name of the field to be matched.
 * @param values The phrase terms to be matched.
 * @param slop   The number of other words permitted between words in phrase.
 */
@JsonCreator
public PhraseCondition(@JsonProperty("boost") Float boost,
                       @JsonProperty("field") String field,
                       @JsonProperty("values") List<String> values,
                       @JsonProperty("slop") Integer slop) {
    super(boost);

    this.field = field;
    this.values = values;
    this.slop = slop == null ? DEFAULT_SLOP : slop;
}
 
Example #14
Source File: PageView.java    From samza with Apache License 2.0 5 votes vote down vote up
public PageView(@JsonProperty("view-id") String viewId,
                @JsonProperty("page-id") String pageId,
                @JsonProperty("user-id") String userId) {
  this.viewId = viewId;
  this.pageId = pageId;
  this.userId = userId;
}
 
Example #15
Source File: ColumnMapperDouble.java    From stratio-cassandra with Apache License 2.0 5 votes vote down vote up
/**
 * Builds a new {@link ColumnMapperDouble} using the specified boost.
 *
 * @param boost The boost to be used.
 */
@JsonCreator
public ColumnMapperDouble(@JsonProperty("boost") Float boost) {
    super(new AbstractType<?>[]{AsciiType.instance,
                                UTF8Type.instance,
                                Int32Type.instance,
                                LongType.instance,
                                IntegerType.instance,
                                FloatType.instance,
                                DoubleType.instance,
                                DecimalType.instance}, new AbstractType[]{DoubleType.instance});
    this.boost = boost == null ? DEFAULT_BOOST : boost;
}
 
Example #16
Source File: TestRailService.java    From TestRailSDK with MIT License 5 votes vote down vote up
/**
 * Creates a new configuration group.
 * @param name The name of the configuration group
 * @param projectId The ID of the project the configuration group should be added to
 */
public void addConfigGroup(final String name, int projectId) {
    postRESTBody(TestRailCommand.ADD_CONFIG_GROUP.getCommand(), null,
            new BaseEntity() {
                @JsonProperty("name")
                private String nameString = name;
            });
}
 
Example #17
Source File: GeoBBoxCondition.java    From stratio-cassandra with Apache License 2.0 5 votes vote down vote up
/**
 * Constructor using the field name and the value to be matched.
 *
 * @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 name of the field to be matched.
 */
@JsonCreator
public GeoBBoxCondition(@JsonProperty("boost") Float boost,
                        @JsonProperty("field") String field,
                        @JsonProperty("min_longitude") double minLongitude,
                        @JsonProperty("max_longitude") double maxLongitude,
                        @JsonProperty("min_latitude") double minLatitude,
                        @JsonProperty("max_latitude") double maxLatitude) {
    super(boost);
    this.field = field;
    this.minLongitude = minLongitude;
    this.maxLongitude = maxLongitude;
    this.minLatitude = minLatitude;
    this.maxLatitude = maxLatitude;
}
 
Example #18
Source File: GeoRectangle.java    From stratio-cassandra with Apache License 2.0 5 votes vote down vote up
/**
 * Builds a new {@link GeoRectangle} defined by the specified geographical positions.
 *
 * @param minLongitude The minimum longitude in the rectangle to be built.
 * @param maxLongitude The maximum longitude in the rectangle to be built.
 * @param minLatitude  The minimum latitude in the rectangle to be built.
 * @param maxLatitude  The maximum latitude in the rectangle to be built.
 */
@JsonCreator
public GeoRectangle(@JsonProperty("min_longitude") double minLongitude,
                    @JsonProperty("max_longitude") double maxLongitude,
                    @JsonProperty("min_latitude") double minLatitude,
                    @JsonProperty("max_latitude") double maxLatitude) {
    checkLongitude(minLongitude);
    checkLongitude(maxLongitude);
    checkLatitude(minLatitude);
    checkLatitude(maxLatitude);
    this.minLongitude = minLongitude;
    this.maxLongitude = maxLongitude;
    this.minLatitude = minLatitude;
    this.maxLatitude = maxLatitude;
}
 
Example #19
Source File: SamzaSqlRelRecord.java    From samza with Apache License 2.0 5 votes vote down vote up
/**
 * Creates a {@link SamzaSqlRelRecord} from the list of relational fields and values.
 * @param fieldNames Ordered list of field names in the row.
 * @param fieldValues  Ordered list of all the values in the row. Some of the fields can be null. This could be
 *                     result of delete change capture event in the stream or because of the result of the outer
 *                     join or the fields themselves are null in the original stream.
 */
public SamzaSqlRelRecord(@JsonProperty("fieldNames") List<String> fieldNames,
    @JsonProperty("fieldValues") List<Object> fieldValues) {
  if (fieldNames.size() != fieldValues.size()) {
    throw new IllegalArgumentException("Field Names and values are not of same length.");
  }

  this.fieldNames = new ArrayList<>();
  this.fieldValues = new ArrayList<>();

  this.fieldNames.addAll(fieldNames);
  this.fieldValues.addAll(fieldValues);

  hashCode = Objects.hash(fieldNames, fieldValues);
}
 
Example #20
Source File: FileSetInfo.java    From terrapin with Apache License 2.0 5 votes vote down vote up
@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;
}
 
Example #21
Source File: UserPageViews.java    From samza-hello-samza with Apache License 2.0 5 votes vote down vote up
/**
 * Constructs a user page view count.
 *
 * @param userId the id of the user viewing the pages
 * @param count number of page views by the user
 */
public UserPageViews(
    @JsonProperty("userId") String userId,
    @JsonProperty("count") int count) {
  this.userId = userId;
  this.count = count;
}
 
Example #22
Source File: Vendor.java    From basiclti-util-java with Apache License 2.0 4 votes vote down vote up
@JsonProperty("code")
public String getCode() {
    return code;
}
 
Example #23
Source File: ApplicationState.java    From reef with Apache License 2.0 4 votes vote down vote up
@JsonProperty(Constants.AM_HOST_HTTP_ADDRESS)
public String getAmHostHttpAddress() {
  return amHostHttpAddress;
}
 
Example #24
Source File: ServiceProvider.java    From basiclti-util-java with Apache License 2.0 4 votes vote down vote up
@JsonProperty("@id")
public String get_id() {
    return _id;
}
 
Example #25
Source File: SamzaSqlRelMsgMetadata.java    From samza with Apache License 2.0 4 votes vote down vote up
@JsonProperty("eventTime")
public long getEventTime() {
  return eventTime;
}
 
Example #26
Source File: JsonTaskModelMixIn.java    From samza with Apache License 2.0 4 votes vote down vote up
@JsonProperty("system-stream-partitions")
abstract Set<SystemStreamPartition> getSystemStreamPartitions();
 
Example #27
Source File: Commands.java    From reef with Apache License 2.0 4 votes vote down vote up
@JsonProperty(Constants.COMMAND)
  @JsonSerialize(include = JsonSerialize.Inclusion.NON_EMPTY)
  public String getCommand() {
  return this.command;
}
 
Example #28
Source File: Name.java    From basiclti-util-java with Apache License 2.0 4 votes vote down vote up
@JsonProperty("default_value")
public void setDefault_value(String default_value) {
    this.default_value = default_value;
}
 
Example #29
Source File: ServiceOffered.java    From basiclti-util-java with Apache License 2.0 4 votes vote down vote up
@JsonProperty("@type")
public void set_type(String _type) {
    this._type = _type;
}
 
Example #30
Source File: JsonContainerModelMixIn.java    From samza with Apache License 2.0 4 votes vote down vote up
@JsonProperty(PROCESSOR_ID_KEY)
abstract String getId();