-
-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
169 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
70 changes: 70 additions & 0 deletions
70
src/main/java/org/typesense/model/CollectionUpdateSchema.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
package org.typesense.model; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
import org.typesense.model.Field; | ||
|
||
import io.swagger.v3.oas.annotations.media.Schema; | ||
import javax.xml.bind.annotation.XmlElement; | ||
import javax.xml.bind.annotation.XmlRootElement; | ||
import javax.xml.bind.annotation.XmlAccessType; | ||
import javax.xml.bind.annotation.XmlAccessorType; | ||
import javax.xml.bind.annotation.XmlType; | ||
import javax.xml.bind.annotation.XmlEnum; | ||
import javax.xml.bind.annotation.XmlEnumValue; | ||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import com.fasterxml.jackson.annotation.JsonValue; | ||
import com.fasterxml.jackson.annotation.JsonCreator; | ||
|
||
public class CollectionUpdateSchema { | ||
|
||
@Schema(example = "[{\"name\":\"company_name\",\"type\":\"string\",\"facet\":false},{\"name\":\"num_employees\",\"type\":\"int32\",\"facet\":false},{\"name\":\"country\",\"type\":\"string\",\"facet\":true}]", required = true, description = "A list of fields for querying, filtering and faceting") | ||
/** | ||
* A list of fields for querying, filtering and faceting | ||
**/ | ||
private List<Field> fields = new ArrayList<Field>(); | ||
/** | ||
* A list of fields for querying, filtering and faceting | ||
* @return fields | ||
**/ | ||
@JsonProperty("fields") | ||
public List<Field> getFields() { | ||
return fields; | ||
} | ||
|
||
public void setFields(List<Field> fields) { | ||
this.fields = fields; | ||
} | ||
|
||
public CollectionUpdateSchema fields(List<Field> fields) { | ||
this.fields = fields; | ||
return this; | ||
} | ||
|
||
public CollectionUpdateSchema addFieldsItem(Field fieldsItem) { | ||
this.fields.add(fieldsItem); | ||
return this; | ||
} | ||
|
||
|
||
@Override | ||
public String toString() { | ||
StringBuilder sb = new StringBuilder(); | ||
sb.append("class CollectionUpdateSchema {\n"); | ||
|
||
sb.append(" fields: ").append(toIndentedString(fields)).append("\n"); | ||
sb.append("}"); | ||
return sb.toString(); | ||
} | ||
|
||
/** | ||
* Convert the given object to string with each line indented by 4 spaces | ||
* (except the first line). | ||
*/ | ||
private static String toIndentedString(java.lang.Object o) { | ||
if (o == null) { | ||
return "null"; | ||
} | ||
return o.toString().replace("\n", "\n "); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters