index
int64
repo_id
string
file_path
string
content
string
0
java-sources/ai/buildin/buildin-api-client/1.0.4/org/openapitools/client
java-sources/ai/buildin/buildin-api-client/1.0.4/org/openapitools/client/model/PropertyValueSelect.java
/* * Buildin API * Buildin Developer API * * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ package org.openapitools.client.model; import java.util.Objects; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; import org.openapitools.client.model.PropertyValueSelectSelect; import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.google.gson.JsonArray; import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; import com.google.gson.JsonObject; import com.google.gson.JsonParseException; import com.google.gson.TypeAdapterFactory; import com.google.gson.reflect.TypeToken; import com.google.gson.TypeAdapter; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Set; import org.openapitools.client.JSON; /** * PropertyValueSelect */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.14.0") public class PropertyValueSelect { public static final String SERIALIZED_NAME_ID = "id"; @SerializedName(SERIALIZED_NAME_ID) @javax.annotation.Nullable private String id; public static final String SERIALIZED_NAME_TYPE = "type"; @SerializedName(SERIALIZED_NAME_TYPE) @javax.annotation.Nullable private Object type = null; public static final String SERIALIZED_NAME_SELECT = "select"; @SerializedName(SERIALIZED_NAME_SELECT) @javax.annotation.Nonnull private PropertyValueSelectSelect select; public PropertyValueSelect() { } public PropertyValueSelect id(@javax.annotation.Nullable String id) { this.id = id; return this; } /** * Get id * @return id */ @javax.annotation.Nullable public String getId() { return id; } public void setId(@javax.annotation.Nullable String id) { this.id = id; } public PropertyValueSelect type(@javax.annotation.Nullable Object type) { this.type = type; return this; } /** * Get type * @return type */ @javax.annotation.Nullable public Object getType() { return type; } public void setType(@javax.annotation.Nullable Object type) { this.type = type; } public PropertyValueSelect select(@javax.annotation.Nonnull PropertyValueSelectSelect select) { this.select = select; return this; } /** * Get select * @return select */ @javax.annotation.Nonnull public PropertyValueSelectSelect getSelect() { return select; } public void setSelect(@javax.annotation.Nonnull PropertyValueSelectSelect select) { this.select = select; } @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } PropertyValueSelect propertyValueSelect = (PropertyValueSelect) o; return Objects.equals(this.id, propertyValueSelect.id) && Objects.equals(this.type, propertyValueSelect.type) && Objects.equals(this.select, propertyValueSelect.select); } @Override public int hashCode() { return Objects.hash(id, type, select); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class PropertyValueSelect {\n"); sb.append(" id: ").append(toIndentedString(id)).append("\n"); sb.append(" type: ").append(toIndentedString(type)).append("\n"); sb.append(" select: ").append(toIndentedString(select)).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 String toIndentedString(Object o) { if (o == null) { return "null"; } return o.toString().replace("\n", "\n "); } public static HashSet<String> openapiFields; public static HashSet<String> openapiRequiredFields; static { // a set of all properties/fields (JSON key names) openapiFields = new HashSet<String>(Arrays.asList("id", "type", "select")); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet<String>(Arrays.asList("type", "select")); } /** * Validates the JSON Element and throws an exception if issues found * * @param jsonElement JSON Element * @throws IOException if the JSON Element is invalid with respect to PropertyValueSelect */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!PropertyValueSelect.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in PropertyValueSelect is not found in the empty JSON string", PropertyValueSelect.openapiRequiredFields.toString())); } } Set<Map.Entry<String, JsonElement>> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields for (Map.Entry<String, JsonElement> entry : entries) { if (!PropertyValueSelect.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `PropertyValueSelect` properties. JSON: %s", entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string for (String requiredField : PropertyValueSelect.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); } } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("id") != null && !jsonObj.get("id").isJsonNull()) && !jsonObj.get("id").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); } // validate the required field `select` PropertyValueSelectSelect.validateJsonElement(jsonObj.get("select")); } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { if (!PropertyValueSelect.class.isAssignableFrom(type.getRawType())) { return null; // this class only serializes 'PropertyValueSelect' and its subtypes } final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); final TypeAdapter<PropertyValueSelect> thisAdapter = gson.getDelegateAdapter(this, TypeToken.get(PropertyValueSelect.class)); return (TypeAdapter<T>) new TypeAdapter<PropertyValueSelect>() { @Override public void write(JsonWriter out, PropertyValueSelect value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); elementAdapter.write(out, obj); } @Override public PropertyValueSelect read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } /** * Create an instance of PropertyValueSelect given an JSON string * * @param jsonString JSON string * @return An instance of PropertyValueSelect * @throws IOException if the JSON string is invalid with respect to PropertyValueSelect */ public static PropertyValueSelect fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, PropertyValueSelect.class); } /** * Convert an instance of PropertyValueSelect to an JSON string * * @return JSON string */ public String toJson() { return JSON.getGson().toJson(this); } }
0
java-sources/ai/buildin/buildin-api-client/1.0.4/org/openapitools/client
java-sources/ai/buildin/buildin-api-client/1.0.4/org/openapitools/client/model/PropertyValueSelectSelect.java
/* * Buildin API * Buildin Developer API * * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ package org.openapitools.client.model; import java.util.Objects; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.google.gson.JsonArray; import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; import com.google.gson.JsonObject; import com.google.gson.JsonParseException; import com.google.gson.TypeAdapterFactory; import com.google.gson.reflect.TypeToken; import com.google.gson.TypeAdapter; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Set; import org.openapitools.client.JSON; /** * PropertyValueSelectSelect */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.14.0") public class PropertyValueSelectSelect { public static final String SERIALIZED_NAME_ID = "id"; @SerializedName(SERIALIZED_NAME_ID) @javax.annotation.Nullable private String id; public static final String SERIALIZED_NAME_NAME = "name"; @SerializedName(SERIALIZED_NAME_NAME) @javax.annotation.Nullable private String name; public static final String SERIALIZED_NAME_COLOR = "color"; @SerializedName(SERIALIZED_NAME_COLOR) @javax.annotation.Nullable private String color; public PropertyValueSelectSelect() { } public PropertyValueSelectSelect id(@javax.annotation.Nullable String id) { this.id = id; return this; } /** * Get id * @return id */ @javax.annotation.Nullable public String getId() { return id; } public void setId(@javax.annotation.Nullable String id) { this.id = id; } public PropertyValueSelectSelect name(@javax.annotation.Nullable String name) { this.name = name; return this; } /** * Get name * @return name */ @javax.annotation.Nullable public String getName() { return name; } public void setName(@javax.annotation.Nullable String name) { this.name = name; } public PropertyValueSelectSelect color(@javax.annotation.Nullable String color) { this.color = color; return this; } /** * Get color * @return color */ @javax.annotation.Nullable public String getColor() { return color; } public void setColor(@javax.annotation.Nullable String color) { this.color = color; } @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } PropertyValueSelectSelect propertyValueSelectSelect = (PropertyValueSelectSelect) o; return Objects.equals(this.id, propertyValueSelectSelect.id) && Objects.equals(this.name, propertyValueSelectSelect.name) && Objects.equals(this.color, propertyValueSelectSelect.color); } @Override public int hashCode() { return Objects.hash(id, name, color); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class PropertyValueSelectSelect {\n"); sb.append(" id: ").append(toIndentedString(id)).append("\n"); sb.append(" name: ").append(toIndentedString(name)).append("\n"); sb.append(" color: ").append(toIndentedString(color)).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 String toIndentedString(Object o) { if (o == null) { return "null"; } return o.toString().replace("\n", "\n "); } public static HashSet<String> openapiFields; public static HashSet<String> openapiRequiredFields; static { // a set of all properties/fields (JSON key names) openapiFields = new HashSet<String>(Arrays.asList("id", "name", "color")); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet<String>(0); } /** * Validates the JSON Element and throws an exception if issues found * * @param jsonElement JSON Element * @throws IOException if the JSON Element is invalid with respect to PropertyValueSelectSelect */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!PropertyValueSelectSelect.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in PropertyValueSelectSelect is not found in the empty JSON string", PropertyValueSelectSelect.openapiRequiredFields.toString())); } } Set<Map.Entry<String, JsonElement>> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields for (Map.Entry<String, JsonElement> entry : entries) { if (!PropertyValueSelectSelect.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `PropertyValueSelectSelect` properties. JSON: %s", entry.getKey(), jsonElement.toString())); } } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("id") != null && !jsonObj.get("id").isJsonNull()) && !jsonObj.get("id").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); } if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); } if ((jsonObj.get("color") != null && !jsonObj.get("color").isJsonNull()) && !jsonObj.get("color").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `color` to be a primitive type in the JSON string but got `%s`", jsonObj.get("color").toString())); } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { if (!PropertyValueSelectSelect.class.isAssignableFrom(type.getRawType())) { return null; // this class only serializes 'PropertyValueSelectSelect' and its subtypes } final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); final TypeAdapter<PropertyValueSelectSelect> thisAdapter = gson.getDelegateAdapter(this, TypeToken.get(PropertyValueSelectSelect.class)); return (TypeAdapter<T>) new TypeAdapter<PropertyValueSelectSelect>() { @Override public void write(JsonWriter out, PropertyValueSelectSelect value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); elementAdapter.write(out, obj); } @Override public PropertyValueSelectSelect read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } /** * Create an instance of PropertyValueSelectSelect given an JSON string * * @param jsonString JSON string * @return An instance of PropertyValueSelectSelect * @throws IOException if the JSON string is invalid with respect to PropertyValueSelectSelect */ public static PropertyValueSelectSelect fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, PropertyValueSelectSelect.class); } /** * Convert an instance of PropertyValueSelectSelect to an JSON string * * @return JSON string */ public String toJson() { return JSON.getGson().toJson(this); } }
0
java-sources/ai/buildin/buildin-api-client/1.0.4/org/openapitools/client
java-sources/ai/buildin/buildin-api-client/1.0.4/org/openapitools/client/model/PropertyValueTitle.java
/* * Buildin API * Buildin Developer API * * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ package org.openapitools.client.model; import java.util.Objects; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.ArrayList; import java.util.Arrays; import java.util.List; import org.openapitools.client.model.RichTextItem; import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.google.gson.JsonArray; import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; import com.google.gson.JsonObject; import com.google.gson.JsonParseException; import com.google.gson.TypeAdapterFactory; import com.google.gson.reflect.TypeToken; import com.google.gson.TypeAdapter; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Set; import org.openapitools.client.JSON; /** * PropertyValueTitle */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.14.0") public class PropertyValueTitle { public static final String SERIALIZED_NAME_ID = "id"; @SerializedName(SERIALIZED_NAME_ID) @javax.annotation.Nullable private String id; public static final String SERIALIZED_NAME_TYPE = "type"; @SerializedName(SERIALIZED_NAME_TYPE) @javax.annotation.Nullable private Object type = null; public static final String SERIALIZED_NAME_TITLE = "title"; @SerializedName(SERIALIZED_NAME_TITLE) @javax.annotation.Nonnull private List<RichTextItem> title = new ArrayList<>(); public PropertyValueTitle() { } public PropertyValueTitle id(@javax.annotation.Nullable String id) { this.id = id; return this; } /** * Get id * @return id */ @javax.annotation.Nullable public String getId() { return id; } public void setId(@javax.annotation.Nullable String id) { this.id = id; } public PropertyValueTitle type(@javax.annotation.Nullable Object type) { this.type = type; return this; } /** * Get type * @return type */ @javax.annotation.Nullable public Object getType() { return type; } public void setType(@javax.annotation.Nullable Object type) { this.type = type; } public PropertyValueTitle title(@javax.annotation.Nonnull List<RichTextItem> title) { this.title = title; return this; } public PropertyValueTitle addTitleItem(RichTextItem titleItem) { if (this.title == null) { this.title = new ArrayList<>(); } this.title.add(titleItem); return this; } /** * Get title * @return title */ @javax.annotation.Nonnull public List<RichTextItem> getTitle() { return title; } public void setTitle(@javax.annotation.Nonnull List<RichTextItem> title) { this.title = title; } @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } PropertyValueTitle propertyValueTitle = (PropertyValueTitle) o; return Objects.equals(this.id, propertyValueTitle.id) && Objects.equals(this.type, propertyValueTitle.type) && Objects.equals(this.title, propertyValueTitle.title); } @Override public int hashCode() { return Objects.hash(id, type, title); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class PropertyValueTitle {\n"); sb.append(" id: ").append(toIndentedString(id)).append("\n"); sb.append(" type: ").append(toIndentedString(type)).append("\n"); sb.append(" title: ").append(toIndentedString(title)).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 String toIndentedString(Object o) { if (o == null) { return "null"; } return o.toString().replace("\n", "\n "); } public static HashSet<String> openapiFields; public static HashSet<String> openapiRequiredFields; static { // a set of all properties/fields (JSON key names) openapiFields = new HashSet<String>(Arrays.asList("id", "type", "title")); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet<String>(Arrays.asList("type", "title")); } /** * Validates the JSON Element and throws an exception if issues found * * @param jsonElement JSON Element * @throws IOException if the JSON Element is invalid with respect to PropertyValueTitle */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!PropertyValueTitle.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in PropertyValueTitle is not found in the empty JSON string", PropertyValueTitle.openapiRequiredFields.toString())); } } Set<Map.Entry<String, JsonElement>> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields for (Map.Entry<String, JsonElement> entry : entries) { if (!PropertyValueTitle.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `PropertyValueTitle` properties. JSON: %s", entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string for (String requiredField : PropertyValueTitle.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); } } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("id") != null && !jsonObj.get("id").isJsonNull()) && !jsonObj.get("id").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); } // ensure the json data is an array if (!jsonObj.get("title").isJsonArray()) { throw new IllegalArgumentException(String.format("Expected the field `title` to be an array in the JSON string but got `%s`", jsonObj.get("title").toString())); } JsonArray jsonArraytitle = jsonObj.getAsJsonArray("title"); // validate the required field `title` (array) for (int i = 0; i < jsonArraytitle.size(); i++) { RichTextItem.validateJsonElement(jsonArraytitle.get(i)); }; } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { if (!PropertyValueTitle.class.isAssignableFrom(type.getRawType())) { return null; // this class only serializes 'PropertyValueTitle' and its subtypes } final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); final TypeAdapter<PropertyValueTitle> thisAdapter = gson.getDelegateAdapter(this, TypeToken.get(PropertyValueTitle.class)); return (TypeAdapter<T>) new TypeAdapter<PropertyValueTitle>() { @Override public void write(JsonWriter out, PropertyValueTitle value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); elementAdapter.write(out, obj); } @Override public PropertyValueTitle read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } /** * Create an instance of PropertyValueTitle given an JSON string * * @param jsonString JSON string * @return An instance of PropertyValueTitle * @throws IOException if the JSON string is invalid with respect to PropertyValueTitle */ public static PropertyValueTitle fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, PropertyValueTitle.class); } /** * Convert an instance of PropertyValueTitle to an JSON string * * @return JSON string */ public String toJson() { return JSON.getGson().toJson(this); } }
0
java-sources/ai/buildin/buildin-api-client/1.0.4/org/openapitools/client
java-sources/ai/buildin/buildin-api-client/1.0.4/org/openapitools/client/model/PropertyValueUrl.java
/* * Buildin API * Buildin Developer API * * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ package org.openapitools.client.model; import java.util.Objects; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.google.gson.JsonArray; import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; import com.google.gson.JsonObject; import com.google.gson.JsonParseException; import com.google.gson.TypeAdapterFactory; import com.google.gson.reflect.TypeToken; import com.google.gson.TypeAdapter; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Set; import org.openapitools.client.JSON; /** * PropertyValueUrl */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.14.0") public class PropertyValueUrl { public static final String SERIALIZED_NAME_ID = "id"; @SerializedName(SERIALIZED_NAME_ID) @javax.annotation.Nullable private String id; public static final String SERIALIZED_NAME_TYPE = "type"; @SerializedName(SERIALIZED_NAME_TYPE) @javax.annotation.Nullable private Object type = null; public static final String SERIALIZED_NAME_URL = "url"; @SerializedName(SERIALIZED_NAME_URL) @javax.annotation.Nonnull private String url; public PropertyValueUrl() { } public PropertyValueUrl id(@javax.annotation.Nullable String id) { this.id = id; return this; } /** * Get id * @return id */ @javax.annotation.Nullable public String getId() { return id; } public void setId(@javax.annotation.Nullable String id) { this.id = id; } public PropertyValueUrl type(@javax.annotation.Nullable Object type) { this.type = type; return this; } /** * Get type * @return type */ @javax.annotation.Nullable public Object getType() { return type; } public void setType(@javax.annotation.Nullable Object type) { this.type = type; } public PropertyValueUrl url(@javax.annotation.Nonnull String url) { this.url = url; return this; } /** * Get url * @return url */ @javax.annotation.Nonnull public String getUrl() { return url; } public void setUrl(@javax.annotation.Nonnull String url) { this.url = url; } @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } PropertyValueUrl propertyValueUrl = (PropertyValueUrl) o; return Objects.equals(this.id, propertyValueUrl.id) && Objects.equals(this.type, propertyValueUrl.type) && Objects.equals(this.url, propertyValueUrl.url); } @Override public int hashCode() { return Objects.hash(id, type, url); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class PropertyValueUrl {\n"); sb.append(" id: ").append(toIndentedString(id)).append("\n"); sb.append(" type: ").append(toIndentedString(type)).append("\n"); sb.append(" url: ").append(toIndentedString(url)).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 String toIndentedString(Object o) { if (o == null) { return "null"; } return o.toString().replace("\n", "\n "); } public static HashSet<String> openapiFields; public static HashSet<String> openapiRequiredFields; static { // a set of all properties/fields (JSON key names) openapiFields = new HashSet<String>(Arrays.asList("id", "type", "url")); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet<String>(Arrays.asList("type", "url")); } /** * Validates the JSON Element and throws an exception if issues found * * @param jsonElement JSON Element * @throws IOException if the JSON Element is invalid with respect to PropertyValueUrl */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!PropertyValueUrl.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in PropertyValueUrl is not found in the empty JSON string", PropertyValueUrl.openapiRequiredFields.toString())); } } Set<Map.Entry<String, JsonElement>> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields for (Map.Entry<String, JsonElement> entry : entries) { if (!PropertyValueUrl.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `PropertyValueUrl` properties. JSON: %s", entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string for (String requiredField : PropertyValueUrl.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); } } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("id") != null && !jsonObj.get("id").isJsonNull()) && !jsonObj.get("id").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); } if (!jsonObj.get("url").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `url` to be a primitive type in the JSON string but got `%s`", jsonObj.get("url").toString())); } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { if (!PropertyValueUrl.class.isAssignableFrom(type.getRawType())) { return null; // this class only serializes 'PropertyValueUrl' and its subtypes } final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); final TypeAdapter<PropertyValueUrl> thisAdapter = gson.getDelegateAdapter(this, TypeToken.get(PropertyValueUrl.class)); return (TypeAdapter<T>) new TypeAdapter<PropertyValueUrl>() { @Override public void write(JsonWriter out, PropertyValueUrl value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); elementAdapter.write(out, obj); } @Override public PropertyValueUrl read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } /** * Create an instance of PropertyValueUrl given an JSON string * * @param jsonString JSON string * @return An instance of PropertyValueUrl * @throws IOException if the JSON string is invalid with respect to PropertyValueUrl */ public static PropertyValueUrl fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, PropertyValueUrl.class); } /** * Convert an instance of PropertyValueUrl to an JSON string * * @return JSON string */ public String toJson() { return JSON.getGson().toJson(this); } }
0
java-sources/ai/buildin/buildin-api-client/1.0.4/org/openapitools/client
java-sources/ai/buildin/buildin-api-client/1.0.4/org/openapitools/client/model/QueryDatabaseRequest.java
/* * Buildin API * Buildin Developer API * * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ package org.openapitools.client.model; import java.util.Objects; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.math.BigDecimal; import java.util.Arrays; import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.google.gson.JsonArray; import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; import com.google.gson.JsonObject; import com.google.gson.JsonParseException; import com.google.gson.TypeAdapterFactory; import com.google.gson.reflect.TypeToken; import com.google.gson.TypeAdapter; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Set; import org.openapitools.client.JSON; /** * QueryDatabaseRequest */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.14.0") public class QueryDatabaseRequest { public static final String SERIALIZED_NAME_START_CURSOR = "start_cursor"; @SerializedName(SERIALIZED_NAME_START_CURSOR) @javax.annotation.Nullable private String startCursor; public static final String SERIALIZED_NAME_PAGE_SIZE = "page_size"; @SerializedName(SERIALIZED_NAME_PAGE_SIZE) @javax.annotation.Nullable private Integer pageSize = 50; public static final String SERIALIZED_NAME_AFTER_CREATED_AT = "after_created_at"; @SerializedName(SERIALIZED_NAME_AFTER_CREATED_AT) @javax.annotation.Nullable private BigDecimal afterCreatedAt; public static final String SERIALIZED_NAME_AFTER_UPDATED_AT = "after_updated_at"; @SerializedName(SERIALIZED_NAME_AFTER_UPDATED_AT) @javax.annotation.Nullable private BigDecimal afterUpdatedAt; public QueryDatabaseRequest() { } public QueryDatabaseRequest startCursor(@javax.annotation.Nullable String startCursor) { this.startCursor = startCursor; return this; } /** * 分页游标,使用页面ID作为游标值 * @return startCursor */ @javax.annotation.Nullable public String getStartCursor() { return startCursor; } public void setStartCursor(@javax.annotation.Nullable String startCursor) { this.startCursor = startCursor; } public QueryDatabaseRequest pageSize(@javax.annotation.Nullable Integer pageSize) { this.pageSize = pageSize; return this; } /** * 每页记录数 * minimum: 1 * maximum: 100 * @return pageSize */ @javax.annotation.Nullable public Integer getPageSize() { return pageSize; } public void setPageSize(@javax.annotation.Nullable Integer pageSize) { this.pageSize = pageSize; } public QueryDatabaseRequest afterCreatedAt(@javax.annotation.Nullable BigDecimal afterCreatedAt) { this.afterCreatedAt = afterCreatedAt; return this; } /** * 筛选创建时间晚于此时间戳的记录 * @return afterCreatedAt */ @javax.annotation.Nullable public BigDecimal getAfterCreatedAt() { return afterCreatedAt; } public void setAfterCreatedAt(@javax.annotation.Nullable BigDecimal afterCreatedAt) { this.afterCreatedAt = afterCreatedAt; } public QueryDatabaseRequest afterUpdatedAt(@javax.annotation.Nullable BigDecimal afterUpdatedAt) { this.afterUpdatedAt = afterUpdatedAt; return this; } /** * 筛选更新时间晚于此时间戳的记录 * @return afterUpdatedAt */ @javax.annotation.Nullable public BigDecimal getAfterUpdatedAt() { return afterUpdatedAt; } public void setAfterUpdatedAt(@javax.annotation.Nullable BigDecimal afterUpdatedAt) { this.afterUpdatedAt = afterUpdatedAt; } @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } QueryDatabaseRequest queryDatabaseRequest = (QueryDatabaseRequest) o; return Objects.equals(this.startCursor, queryDatabaseRequest.startCursor) && Objects.equals(this.pageSize, queryDatabaseRequest.pageSize) && Objects.equals(this.afterCreatedAt, queryDatabaseRequest.afterCreatedAt) && Objects.equals(this.afterUpdatedAt, queryDatabaseRequest.afterUpdatedAt); } @Override public int hashCode() { return Objects.hash(startCursor, pageSize, afterCreatedAt, afterUpdatedAt); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class QueryDatabaseRequest {\n"); sb.append(" startCursor: ").append(toIndentedString(startCursor)).append("\n"); sb.append(" pageSize: ").append(toIndentedString(pageSize)).append("\n"); sb.append(" afterCreatedAt: ").append(toIndentedString(afterCreatedAt)).append("\n"); sb.append(" afterUpdatedAt: ").append(toIndentedString(afterUpdatedAt)).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 String toIndentedString(Object o) { if (o == null) { return "null"; } return o.toString().replace("\n", "\n "); } public static HashSet<String> openapiFields; public static HashSet<String> openapiRequiredFields; static { // a set of all properties/fields (JSON key names) openapiFields = new HashSet<String>(Arrays.asList("start_cursor", "page_size", "after_created_at", "after_updated_at")); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet<String>(0); } /** * Validates the JSON Element and throws an exception if issues found * * @param jsonElement JSON Element * @throws IOException if the JSON Element is invalid with respect to QueryDatabaseRequest */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!QueryDatabaseRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in QueryDatabaseRequest is not found in the empty JSON string", QueryDatabaseRequest.openapiRequiredFields.toString())); } } Set<Map.Entry<String, JsonElement>> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields for (Map.Entry<String, JsonElement> entry : entries) { if (!QueryDatabaseRequest.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `QueryDatabaseRequest` properties. JSON: %s", entry.getKey(), jsonElement.toString())); } } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("start_cursor") != null && !jsonObj.get("start_cursor").isJsonNull()) && !jsonObj.get("start_cursor").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `start_cursor` to be a primitive type in the JSON string but got `%s`", jsonObj.get("start_cursor").toString())); } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { if (!QueryDatabaseRequest.class.isAssignableFrom(type.getRawType())) { return null; // this class only serializes 'QueryDatabaseRequest' and its subtypes } final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); final TypeAdapter<QueryDatabaseRequest> thisAdapter = gson.getDelegateAdapter(this, TypeToken.get(QueryDatabaseRequest.class)); return (TypeAdapter<T>) new TypeAdapter<QueryDatabaseRequest>() { @Override public void write(JsonWriter out, QueryDatabaseRequest value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); elementAdapter.write(out, obj); } @Override public QueryDatabaseRequest read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } /** * Create an instance of QueryDatabaseRequest given an JSON string * * @param jsonString JSON string * @return An instance of QueryDatabaseRequest * @throws IOException if the JSON string is invalid with respect to QueryDatabaseRequest */ public static QueryDatabaseRequest fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, QueryDatabaseRequest.class); } /** * Convert an instance of QueryDatabaseRequest to an JSON string * * @return JSON string */ public String toJson() { return JSON.getGson().toJson(this); } }
0
java-sources/ai/buildin/buildin-api-client/1.0.4/org/openapitools/client
java-sources/ai/buildin/buildin-api-client/1.0.4/org/openapitools/client/model/QueryDatabaseResponse.java
/* * Buildin API * Buildin Developer API * * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ package org.openapitools.client.model; import java.util.Objects; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.ArrayList; import java.util.Arrays; import java.util.List; import org.openapitools.client.model.Page; import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.google.gson.JsonArray; import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; import com.google.gson.JsonObject; import com.google.gson.JsonParseException; import com.google.gson.TypeAdapterFactory; import com.google.gson.reflect.TypeToken; import com.google.gson.TypeAdapter; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Set; import org.openapitools.client.JSON; /** * QueryDatabaseResponse */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.14.0") public class QueryDatabaseResponse { /** * Gets or Sets _object */ @JsonAdapter(ObjectEnum.Adapter.class) public enum ObjectEnum { LIST("list"); private String value; ObjectEnum(String value) { this.value = value; } public String getValue() { return value; } @Override public String toString() { return String.valueOf(value); } public static ObjectEnum fromValue(String value) { for (ObjectEnum b : ObjectEnum.values()) { if (b.value.equals(value)) { return b; } } throw new IllegalArgumentException("Unexpected value '" + value + "'"); } public static class Adapter extends TypeAdapter<ObjectEnum> { @Override public void write(final JsonWriter jsonWriter, final ObjectEnum enumeration) throws IOException { jsonWriter.value(enumeration.getValue()); } @Override public ObjectEnum read(final JsonReader jsonReader) throws IOException { String value = jsonReader.nextString(); return ObjectEnum.fromValue(value); } } public static void validateJsonElement(JsonElement jsonElement) throws IOException { String value = jsonElement.getAsString(); ObjectEnum.fromValue(value); } } public static final String SERIALIZED_NAME_OBJECT = "object"; @SerializedName(SERIALIZED_NAME_OBJECT) @javax.annotation.Nullable private ObjectEnum _object; public static final String SERIALIZED_NAME_RESULTS = "results"; @SerializedName(SERIALIZED_NAME_RESULTS) @javax.annotation.Nullable private List<Page> results = new ArrayList<>(); public static final String SERIALIZED_NAME_NEXT_CURSOR = "next_cursor"; @SerializedName(SERIALIZED_NAME_NEXT_CURSOR) @javax.annotation.Nullable private String nextCursor; public static final String SERIALIZED_NAME_HAS_MORE = "has_more"; @SerializedName(SERIALIZED_NAME_HAS_MORE) @javax.annotation.Nullable private Boolean hasMore; /** * Gets or Sets type */ @JsonAdapter(TypeEnum.Adapter.class) public enum TypeEnum { PAGE("page"); private String value; TypeEnum(String value) { this.value = value; } public String getValue() { return value; } @Override public String toString() { return String.valueOf(value); } public static TypeEnum fromValue(String value) { for (TypeEnum b : TypeEnum.values()) { if (b.value.equals(value)) { return b; } } throw new IllegalArgumentException("Unexpected value '" + value + "'"); } public static class Adapter extends TypeAdapter<TypeEnum> { @Override public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) throws IOException { jsonWriter.value(enumeration.getValue()); } @Override public TypeEnum read(final JsonReader jsonReader) throws IOException { String value = jsonReader.nextString(); return TypeEnum.fromValue(value); } } public static void validateJsonElement(JsonElement jsonElement) throws IOException { String value = jsonElement.getAsString(); TypeEnum.fromValue(value); } } public static final String SERIALIZED_NAME_TYPE = "type"; @SerializedName(SERIALIZED_NAME_TYPE) @javax.annotation.Nullable private TypeEnum type; public static final String SERIALIZED_NAME_PAGE = "page"; @SerializedName(SERIALIZED_NAME_PAGE) @javax.annotation.Nullable private Object page; public QueryDatabaseResponse() { } public QueryDatabaseResponse _object(@javax.annotation.Nullable ObjectEnum _object) { this._object = _object; return this; } /** * Get _object * @return _object */ @javax.annotation.Nullable public ObjectEnum getObject() { return _object; } public void setObject(@javax.annotation.Nullable ObjectEnum _object) { this._object = _object; } public QueryDatabaseResponse results(@javax.annotation.Nullable List<Page> results) { this.results = results; return this; } public QueryDatabaseResponse addResultsItem(Page resultsItem) { if (this.results == null) { this.results = new ArrayList<>(); } this.results.add(resultsItem); return this; } /** * Get results * @return results */ @javax.annotation.Nullable public List<Page> getResults() { return results; } public void setResults(@javax.annotation.Nullable List<Page> results) { this.results = results; } public QueryDatabaseResponse nextCursor(@javax.annotation.Nullable String nextCursor) { this.nextCursor = nextCursor; return this; } /** * 下一页游标,使用最后一个项目的ID作为游标值 * @return nextCursor */ @javax.annotation.Nullable public String getNextCursor() { return nextCursor; } public void setNextCursor(@javax.annotation.Nullable String nextCursor) { this.nextCursor = nextCursor; } public QueryDatabaseResponse hasMore(@javax.annotation.Nullable Boolean hasMore) { this.hasMore = hasMore; return this; } /** * Get hasMore * @return hasMore */ @javax.annotation.Nullable public Boolean getHasMore() { return hasMore; } public void setHasMore(@javax.annotation.Nullable Boolean hasMore) { this.hasMore = hasMore; } public QueryDatabaseResponse type(@javax.annotation.Nullable TypeEnum type) { this.type = type; return this; } /** * Get type * @return type */ @javax.annotation.Nullable public TypeEnum getType() { return type; } public void setType(@javax.annotation.Nullable TypeEnum type) { this.type = type; } public QueryDatabaseResponse page(@javax.annotation.Nullable Object page) { this.page = page; return this; } /** * Get page * @return page */ @javax.annotation.Nullable public Object getPage() { return page; } public void setPage(@javax.annotation.Nullable Object page) { this.page = page; } @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } QueryDatabaseResponse queryDatabaseResponse = (QueryDatabaseResponse) o; return Objects.equals(this._object, queryDatabaseResponse._object) && Objects.equals(this.results, queryDatabaseResponse.results) && Objects.equals(this.nextCursor, queryDatabaseResponse.nextCursor) && Objects.equals(this.hasMore, queryDatabaseResponse.hasMore) && Objects.equals(this.type, queryDatabaseResponse.type) && Objects.equals(this.page, queryDatabaseResponse.page); } @Override public int hashCode() { return Objects.hash(_object, results, nextCursor, hasMore, type, page); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class QueryDatabaseResponse {\n"); sb.append(" _object: ").append(toIndentedString(_object)).append("\n"); sb.append(" results: ").append(toIndentedString(results)).append("\n"); sb.append(" nextCursor: ").append(toIndentedString(nextCursor)).append("\n"); sb.append(" hasMore: ").append(toIndentedString(hasMore)).append("\n"); sb.append(" type: ").append(toIndentedString(type)).append("\n"); sb.append(" page: ").append(toIndentedString(page)).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 String toIndentedString(Object o) { if (o == null) { return "null"; } return o.toString().replace("\n", "\n "); } public static HashSet<String> openapiFields; public static HashSet<String> openapiRequiredFields; static { // a set of all properties/fields (JSON key names) openapiFields = new HashSet<String>(Arrays.asList("object", "results", "next_cursor", "has_more", "type", "page")); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet<String>(0); } /** * Validates the JSON Element and throws an exception if issues found * * @param jsonElement JSON Element * @throws IOException if the JSON Element is invalid with respect to QueryDatabaseResponse */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!QueryDatabaseResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in QueryDatabaseResponse is not found in the empty JSON string", QueryDatabaseResponse.openapiRequiredFields.toString())); } } Set<Map.Entry<String, JsonElement>> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields for (Map.Entry<String, JsonElement> entry : entries) { if (!QueryDatabaseResponse.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `QueryDatabaseResponse` properties. JSON: %s", entry.getKey(), jsonElement.toString())); } } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("object") != null && !jsonObj.get("object").isJsonNull()) && !jsonObj.get("object").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `object` to be a primitive type in the JSON string but got `%s`", jsonObj.get("object").toString())); } // validate the optional field `object` if (jsonObj.get("object") != null && !jsonObj.get("object").isJsonNull()) { ObjectEnum.validateJsonElement(jsonObj.get("object")); } if (jsonObj.get("results") != null && !jsonObj.get("results").isJsonNull()) { JsonArray jsonArrayresults = jsonObj.getAsJsonArray("results"); if (jsonArrayresults != null) { // ensure the json data is an array if (!jsonObj.get("results").isJsonArray()) { throw new IllegalArgumentException(String.format("Expected the field `results` to be an array in the JSON string but got `%s`", jsonObj.get("results").toString())); } // validate the optional field `results` (array) for (int i = 0; i < jsonArrayresults.size(); i++) { Page.validateJsonElement(jsonArrayresults.get(i)); }; } } if ((jsonObj.get("next_cursor") != null && !jsonObj.get("next_cursor").isJsonNull()) && !jsonObj.get("next_cursor").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `next_cursor` to be a primitive type in the JSON string but got `%s`", jsonObj.get("next_cursor").toString())); } if ((jsonObj.get("type") != null && !jsonObj.get("type").isJsonNull()) && !jsonObj.get("type").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); } // validate the optional field `type` if (jsonObj.get("type") != null && !jsonObj.get("type").isJsonNull()) { TypeEnum.validateJsonElement(jsonObj.get("type")); } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { if (!QueryDatabaseResponse.class.isAssignableFrom(type.getRawType())) { return null; // this class only serializes 'QueryDatabaseResponse' and its subtypes } final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); final TypeAdapter<QueryDatabaseResponse> thisAdapter = gson.getDelegateAdapter(this, TypeToken.get(QueryDatabaseResponse.class)); return (TypeAdapter<T>) new TypeAdapter<QueryDatabaseResponse>() { @Override public void write(JsonWriter out, QueryDatabaseResponse value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); elementAdapter.write(out, obj); } @Override public QueryDatabaseResponse read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } /** * Create an instance of QueryDatabaseResponse given an JSON string * * @param jsonString JSON string * @return An instance of QueryDatabaseResponse * @throws IOException if the JSON string is invalid with respect to QueryDatabaseResponse */ public static QueryDatabaseResponse fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, QueryDatabaseResponse.class); } /** * Convert an instance of QueryDatabaseResponse to an JSON string * * @return JSON string */ public String toJson() { return JSON.getGson().toJson(this); } }
0
java-sources/ai/buildin/buildin-api-client/1.0.4/org/openapitools/client
java-sources/ai/buildin/buildin-api-client/1.0.4/org/openapitools/client/model/RichTextItem.java
/* * Buildin API * Buildin Developer API * * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ package org.openapitools.client.model; import java.util.Objects; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; import org.openapitools.client.model.RichTextItemAnnotations; import org.openapitools.client.model.RichTextItemEquation; import org.openapitools.client.model.RichTextItemMention; import org.openapitools.client.model.RichTextItemText; import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.google.gson.JsonArray; import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; import com.google.gson.JsonObject; import com.google.gson.JsonParseException; import com.google.gson.TypeAdapterFactory; import com.google.gson.reflect.TypeToken; import com.google.gson.TypeAdapter; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Set; import org.openapitools.client.JSON; /** * RichTextItem */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.14.0") public class RichTextItem { /** * Gets or Sets type */ @JsonAdapter(TypeEnum.Adapter.class) public enum TypeEnum { TEXT("text"), MENTION("mention"), EQUATION("equation"); private String value; TypeEnum(String value) { this.value = value; } public String getValue() { return value; } @Override public String toString() { return String.valueOf(value); } public static TypeEnum fromValue(String value) { for (TypeEnum b : TypeEnum.values()) { if (b.value.equals(value)) { return b; } } throw new IllegalArgumentException("Unexpected value '" + value + "'"); } public static class Adapter extends TypeAdapter<TypeEnum> { @Override public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) throws IOException { jsonWriter.value(enumeration.getValue()); } @Override public TypeEnum read(final JsonReader jsonReader) throws IOException { String value = jsonReader.nextString(); return TypeEnum.fromValue(value); } } public static void validateJsonElement(JsonElement jsonElement) throws IOException { String value = jsonElement.getAsString(); TypeEnum.fromValue(value); } } public static final String SERIALIZED_NAME_TYPE = "type"; @SerializedName(SERIALIZED_NAME_TYPE) @javax.annotation.Nullable private TypeEnum type; public static final String SERIALIZED_NAME_TEXT = "text"; @SerializedName(SERIALIZED_NAME_TEXT) @javax.annotation.Nullable private RichTextItemText text; public static final String SERIALIZED_NAME_MENTION = "mention"; @SerializedName(SERIALIZED_NAME_MENTION) @javax.annotation.Nullable private RichTextItemMention mention; public static final String SERIALIZED_NAME_EQUATION = "equation"; @SerializedName(SERIALIZED_NAME_EQUATION) @javax.annotation.Nullable private RichTextItemEquation equation; public static final String SERIALIZED_NAME_ANNOTATIONS = "annotations"; @SerializedName(SERIALIZED_NAME_ANNOTATIONS) @javax.annotation.Nullable private RichTextItemAnnotations annotations; public static final String SERIALIZED_NAME_PLAIN_TEXT = "plain_text"; @SerializedName(SERIALIZED_NAME_PLAIN_TEXT) @javax.annotation.Nullable private String plainText; public static final String SERIALIZED_NAME_HREF = "href"; @SerializedName(SERIALIZED_NAME_HREF) @javax.annotation.Nullable private String href; public RichTextItem() { } public RichTextItem type(@javax.annotation.Nullable TypeEnum type) { this.type = type; return this; } /** * Get type * @return type */ @javax.annotation.Nullable public TypeEnum getType() { return type; } public void setType(@javax.annotation.Nullable TypeEnum type) { this.type = type; } public RichTextItem text(@javax.annotation.Nullable RichTextItemText text) { this.text = text; return this; } /** * Get text * @return text */ @javax.annotation.Nullable public RichTextItemText getText() { return text; } public void setText(@javax.annotation.Nullable RichTextItemText text) { this.text = text; } public RichTextItem mention(@javax.annotation.Nullable RichTextItemMention mention) { this.mention = mention; return this; } /** * Get mention * @return mention */ @javax.annotation.Nullable public RichTextItemMention getMention() { return mention; } public void setMention(@javax.annotation.Nullable RichTextItemMention mention) { this.mention = mention; } public RichTextItem equation(@javax.annotation.Nullable RichTextItemEquation equation) { this.equation = equation; return this; } /** * Get equation * @return equation */ @javax.annotation.Nullable public RichTextItemEquation getEquation() { return equation; } public void setEquation(@javax.annotation.Nullable RichTextItemEquation equation) { this.equation = equation; } public RichTextItem annotations(@javax.annotation.Nullable RichTextItemAnnotations annotations) { this.annotations = annotations; return this; } /** * Get annotations * @return annotations */ @javax.annotation.Nullable public RichTextItemAnnotations getAnnotations() { return annotations; } public void setAnnotations(@javax.annotation.Nullable RichTextItemAnnotations annotations) { this.annotations = annotations; } public RichTextItem plainText(@javax.annotation.Nullable String plainText) { this.plainText = plainText; return this; } /** * Get plainText * @return plainText */ @javax.annotation.Nullable public String getPlainText() { return plainText; } public void setPlainText(@javax.annotation.Nullable String plainText) { this.plainText = plainText; } public RichTextItem href(@javax.annotation.Nullable String href) { this.href = href; return this; } /** * Get href * @return href */ @javax.annotation.Nullable public String getHref() { return href; } public void setHref(@javax.annotation.Nullable String href) { this.href = href; } @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } RichTextItem richTextItem = (RichTextItem) o; return Objects.equals(this.type, richTextItem.type) && Objects.equals(this.text, richTextItem.text) && Objects.equals(this.mention, richTextItem.mention) && Objects.equals(this.equation, richTextItem.equation) && Objects.equals(this.annotations, richTextItem.annotations) && Objects.equals(this.plainText, richTextItem.plainText) && Objects.equals(this.href, richTextItem.href); } @Override public int hashCode() { return Objects.hash(type, text, mention, equation, annotations, plainText, href); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class RichTextItem {\n"); sb.append(" type: ").append(toIndentedString(type)).append("\n"); sb.append(" text: ").append(toIndentedString(text)).append("\n"); sb.append(" mention: ").append(toIndentedString(mention)).append("\n"); sb.append(" equation: ").append(toIndentedString(equation)).append("\n"); sb.append(" annotations: ").append(toIndentedString(annotations)).append("\n"); sb.append(" plainText: ").append(toIndentedString(plainText)).append("\n"); sb.append(" href: ").append(toIndentedString(href)).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 String toIndentedString(Object o) { if (o == null) { return "null"; } return o.toString().replace("\n", "\n "); } public static HashSet<String> openapiFields; public static HashSet<String> openapiRequiredFields; static { // a set of all properties/fields (JSON key names) openapiFields = new HashSet<String>(Arrays.asList("type", "text", "mention", "equation", "annotations", "plain_text", "href")); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet<String>(0); } /** * Validates the JSON Element and throws an exception if issues found * * @param jsonElement JSON Element * @throws IOException if the JSON Element is invalid with respect to RichTextItem */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!RichTextItem.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in RichTextItem is not found in the empty JSON string", RichTextItem.openapiRequiredFields.toString())); } } Set<Map.Entry<String, JsonElement>> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields for (Map.Entry<String, JsonElement> entry : entries) { if (!RichTextItem.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `RichTextItem` properties. JSON: %s", entry.getKey(), jsonElement.toString())); } } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("type") != null && !jsonObj.get("type").isJsonNull()) && !jsonObj.get("type").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); } // validate the optional field `type` if (jsonObj.get("type") != null && !jsonObj.get("type").isJsonNull()) { TypeEnum.validateJsonElement(jsonObj.get("type")); } // validate the optional field `text` if (jsonObj.get("text") != null && !jsonObj.get("text").isJsonNull()) { RichTextItemText.validateJsonElement(jsonObj.get("text")); } // validate the optional field `mention` if (jsonObj.get("mention") != null && !jsonObj.get("mention").isJsonNull()) { RichTextItemMention.validateJsonElement(jsonObj.get("mention")); } // validate the optional field `equation` if (jsonObj.get("equation") != null && !jsonObj.get("equation").isJsonNull()) { RichTextItemEquation.validateJsonElement(jsonObj.get("equation")); } // validate the optional field `annotations` if (jsonObj.get("annotations") != null && !jsonObj.get("annotations").isJsonNull()) { RichTextItemAnnotations.validateJsonElement(jsonObj.get("annotations")); } if ((jsonObj.get("plain_text") != null && !jsonObj.get("plain_text").isJsonNull()) && !jsonObj.get("plain_text").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `plain_text` to be a primitive type in the JSON string but got `%s`", jsonObj.get("plain_text").toString())); } if ((jsonObj.get("href") != null && !jsonObj.get("href").isJsonNull()) && !jsonObj.get("href").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `href` to be a primitive type in the JSON string but got `%s`", jsonObj.get("href").toString())); } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { if (!RichTextItem.class.isAssignableFrom(type.getRawType())) { return null; // this class only serializes 'RichTextItem' and its subtypes } final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); final TypeAdapter<RichTextItem> thisAdapter = gson.getDelegateAdapter(this, TypeToken.get(RichTextItem.class)); return (TypeAdapter<T>) new TypeAdapter<RichTextItem>() { @Override public void write(JsonWriter out, RichTextItem value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); elementAdapter.write(out, obj); } @Override public RichTextItem read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } /** * Create an instance of RichTextItem given an JSON string * * @param jsonString JSON string * @return An instance of RichTextItem * @throws IOException if the JSON string is invalid with respect to RichTextItem */ public static RichTextItem fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, RichTextItem.class); } /** * Convert an instance of RichTextItem to an JSON string * * @return JSON string */ public String toJson() { return JSON.getGson().toJson(this); } }
0
java-sources/ai/buildin/buildin-api-client/1.0.4/org/openapitools/client
java-sources/ai/buildin/buildin-api-client/1.0.4/org/openapitools/client/model/RichTextItemAnnotations.java
/* * Buildin API * Buildin Developer API * * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ package org.openapitools.client.model; import java.util.Objects; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.google.gson.JsonArray; import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; import com.google.gson.JsonObject; import com.google.gson.JsonParseException; import com.google.gson.TypeAdapterFactory; import com.google.gson.reflect.TypeToken; import com.google.gson.TypeAdapter; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Set; import org.openapitools.client.JSON; /** * RichTextItemAnnotations */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.14.0") public class RichTextItemAnnotations { public static final String SERIALIZED_NAME_BOLD = "bold"; @SerializedName(SERIALIZED_NAME_BOLD) @javax.annotation.Nullable private Boolean bold; public static final String SERIALIZED_NAME_ITALIC = "italic"; @SerializedName(SERIALIZED_NAME_ITALIC) @javax.annotation.Nullable private Boolean italic; public static final String SERIALIZED_NAME_STRIKETHROUGH = "strikethrough"; @SerializedName(SERIALIZED_NAME_STRIKETHROUGH) @javax.annotation.Nullable private Boolean strikethrough; public static final String SERIALIZED_NAME_UNDERLINE = "underline"; @SerializedName(SERIALIZED_NAME_UNDERLINE) @javax.annotation.Nullable private Boolean underline; public static final String SERIALIZED_NAME_CODE = "code"; @SerializedName(SERIALIZED_NAME_CODE) @javax.annotation.Nullable private Boolean code; /** * Gets or Sets color */ @JsonAdapter(ColorEnum.Adapter.class) public enum ColorEnum { DEFAULT("default"), GRAY("gray"), BROWN("brown"), ORANGE("orange"), YELLOW("yellow"), GREEN("green"), BLUE("blue"), PURPLE("purple"), PINK("pink"), RED("red"); private String value; ColorEnum(String value) { this.value = value; } public String getValue() { return value; } @Override public String toString() { return String.valueOf(value); } public static ColorEnum fromValue(String value) { for (ColorEnum b : ColorEnum.values()) { if (b.value.equals(value)) { return b; } } throw new IllegalArgumentException("Unexpected value '" + value + "'"); } public static class Adapter extends TypeAdapter<ColorEnum> { @Override public void write(final JsonWriter jsonWriter, final ColorEnum enumeration) throws IOException { jsonWriter.value(enumeration.getValue()); } @Override public ColorEnum read(final JsonReader jsonReader) throws IOException { String value = jsonReader.nextString(); return ColorEnum.fromValue(value); } } public static void validateJsonElement(JsonElement jsonElement) throws IOException { String value = jsonElement.getAsString(); ColorEnum.fromValue(value); } } public static final String SERIALIZED_NAME_COLOR = "color"; @SerializedName(SERIALIZED_NAME_COLOR) @javax.annotation.Nullable private ColorEnum color; public RichTextItemAnnotations() { } public RichTextItemAnnotations bold(@javax.annotation.Nullable Boolean bold) { this.bold = bold; return this; } /** * Get bold * @return bold */ @javax.annotation.Nullable public Boolean getBold() { return bold; } public void setBold(@javax.annotation.Nullable Boolean bold) { this.bold = bold; } public RichTextItemAnnotations italic(@javax.annotation.Nullable Boolean italic) { this.italic = italic; return this; } /** * Get italic * @return italic */ @javax.annotation.Nullable public Boolean getItalic() { return italic; } public void setItalic(@javax.annotation.Nullable Boolean italic) { this.italic = italic; } public RichTextItemAnnotations strikethrough(@javax.annotation.Nullable Boolean strikethrough) { this.strikethrough = strikethrough; return this; } /** * Get strikethrough * @return strikethrough */ @javax.annotation.Nullable public Boolean getStrikethrough() { return strikethrough; } public void setStrikethrough(@javax.annotation.Nullable Boolean strikethrough) { this.strikethrough = strikethrough; } public RichTextItemAnnotations underline(@javax.annotation.Nullable Boolean underline) { this.underline = underline; return this; } /** * Get underline * @return underline */ @javax.annotation.Nullable public Boolean getUnderline() { return underline; } public void setUnderline(@javax.annotation.Nullable Boolean underline) { this.underline = underline; } public RichTextItemAnnotations code(@javax.annotation.Nullable Boolean code) { this.code = code; return this; } /** * Get code * @return code */ @javax.annotation.Nullable public Boolean getCode() { return code; } public void setCode(@javax.annotation.Nullable Boolean code) { this.code = code; } public RichTextItemAnnotations color(@javax.annotation.Nullable ColorEnum color) { this.color = color; return this; } /** * Get color * @return color */ @javax.annotation.Nullable public ColorEnum getColor() { return color; } public void setColor(@javax.annotation.Nullable ColorEnum color) { this.color = color; } @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } RichTextItemAnnotations richTextItemAnnotations = (RichTextItemAnnotations) o; return Objects.equals(this.bold, richTextItemAnnotations.bold) && Objects.equals(this.italic, richTextItemAnnotations.italic) && Objects.equals(this.strikethrough, richTextItemAnnotations.strikethrough) && Objects.equals(this.underline, richTextItemAnnotations.underline) && Objects.equals(this.code, richTextItemAnnotations.code) && Objects.equals(this.color, richTextItemAnnotations.color); } @Override public int hashCode() { return Objects.hash(bold, italic, strikethrough, underline, code, color); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class RichTextItemAnnotations {\n"); sb.append(" bold: ").append(toIndentedString(bold)).append("\n"); sb.append(" italic: ").append(toIndentedString(italic)).append("\n"); sb.append(" strikethrough: ").append(toIndentedString(strikethrough)).append("\n"); sb.append(" underline: ").append(toIndentedString(underline)).append("\n"); sb.append(" code: ").append(toIndentedString(code)).append("\n"); sb.append(" color: ").append(toIndentedString(color)).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 String toIndentedString(Object o) { if (o == null) { return "null"; } return o.toString().replace("\n", "\n "); } public static HashSet<String> openapiFields; public static HashSet<String> openapiRequiredFields; static { // a set of all properties/fields (JSON key names) openapiFields = new HashSet<String>(Arrays.asList("bold", "italic", "strikethrough", "underline", "code", "color")); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet<String>(0); } /** * Validates the JSON Element and throws an exception if issues found * * @param jsonElement JSON Element * @throws IOException if the JSON Element is invalid with respect to RichTextItemAnnotations */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!RichTextItemAnnotations.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in RichTextItemAnnotations is not found in the empty JSON string", RichTextItemAnnotations.openapiRequiredFields.toString())); } } Set<Map.Entry<String, JsonElement>> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields for (Map.Entry<String, JsonElement> entry : entries) { if (!RichTextItemAnnotations.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `RichTextItemAnnotations` properties. JSON: %s", entry.getKey(), jsonElement.toString())); } } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("color") != null && !jsonObj.get("color").isJsonNull()) && !jsonObj.get("color").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `color` to be a primitive type in the JSON string but got `%s`", jsonObj.get("color").toString())); } // validate the optional field `color` if (jsonObj.get("color") != null && !jsonObj.get("color").isJsonNull()) { ColorEnum.validateJsonElement(jsonObj.get("color")); } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { if (!RichTextItemAnnotations.class.isAssignableFrom(type.getRawType())) { return null; // this class only serializes 'RichTextItemAnnotations' and its subtypes } final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); final TypeAdapter<RichTextItemAnnotations> thisAdapter = gson.getDelegateAdapter(this, TypeToken.get(RichTextItemAnnotations.class)); return (TypeAdapter<T>) new TypeAdapter<RichTextItemAnnotations>() { @Override public void write(JsonWriter out, RichTextItemAnnotations value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); elementAdapter.write(out, obj); } @Override public RichTextItemAnnotations read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } /** * Create an instance of RichTextItemAnnotations given an JSON string * * @param jsonString JSON string * @return An instance of RichTextItemAnnotations * @throws IOException if the JSON string is invalid with respect to RichTextItemAnnotations */ public static RichTextItemAnnotations fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, RichTextItemAnnotations.class); } /** * Convert an instance of RichTextItemAnnotations to an JSON string * * @return JSON string */ public String toJson() { return JSON.getGson().toJson(this); } }
0
java-sources/ai/buildin/buildin-api-client/1.0.4/org/openapitools/client
java-sources/ai/buildin/buildin-api-client/1.0.4/org/openapitools/client/model/RichTextItemEquation.java
/* * Buildin API * Buildin Developer API * * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ package org.openapitools.client.model; import java.util.Objects; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.google.gson.JsonArray; import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; import com.google.gson.JsonObject; import com.google.gson.JsonParseException; import com.google.gson.TypeAdapterFactory; import com.google.gson.reflect.TypeToken; import com.google.gson.TypeAdapter; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Set; import org.openapitools.client.JSON; /** * RichTextItemEquation */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.14.0") public class RichTextItemEquation { public static final String SERIALIZED_NAME_EXPRESSION = "expression"; @SerializedName(SERIALIZED_NAME_EXPRESSION) @javax.annotation.Nullable private String expression; public RichTextItemEquation() { } public RichTextItemEquation expression(@javax.annotation.Nullable String expression) { this.expression = expression; return this; } /** * Get expression * @return expression */ @javax.annotation.Nullable public String getExpression() { return expression; } public void setExpression(@javax.annotation.Nullable String expression) { this.expression = expression; } @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } RichTextItemEquation richTextItemEquation = (RichTextItemEquation) o; return Objects.equals(this.expression, richTextItemEquation.expression); } @Override public int hashCode() { return Objects.hash(expression); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class RichTextItemEquation {\n"); sb.append(" expression: ").append(toIndentedString(expression)).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 String toIndentedString(Object o) { if (o == null) { return "null"; } return o.toString().replace("\n", "\n "); } public static HashSet<String> openapiFields; public static HashSet<String> openapiRequiredFields; static { // a set of all properties/fields (JSON key names) openapiFields = new HashSet<String>(Arrays.asList("expression")); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet<String>(0); } /** * Validates the JSON Element and throws an exception if issues found * * @param jsonElement JSON Element * @throws IOException if the JSON Element is invalid with respect to RichTextItemEquation */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!RichTextItemEquation.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in RichTextItemEquation is not found in the empty JSON string", RichTextItemEquation.openapiRequiredFields.toString())); } } Set<Map.Entry<String, JsonElement>> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields for (Map.Entry<String, JsonElement> entry : entries) { if (!RichTextItemEquation.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `RichTextItemEquation` properties. JSON: %s", entry.getKey(), jsonElement.toString())); } } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("expression") != null && !jsonObj.get("expression").isJsonNull()) && !jsonObj.get("expression").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `expression` to be a primitive type in the JSON string but got `%s`", jsonObj.get("expression").toString())); } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { if (!RichTextItemEquation.class.isAssignableFrom(type.getRawType())) { return null; // this class only serializes 'RichTextItemEquation' and its subtypes } final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); final TypeAdapter<RichTextItemEquation> thisAdapter = gson.getDelegateAdapter(this, TypeToken.get(RichTextItemEquation.class)); return (TypeAdapter<T>) new TypeAdapter<RichTextItemEquation>() { @Override public void write(JsonWriter out, RichTextItemEquation value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); elementAdapter.write(out, obj); } @Override public RichTextItemEquation read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } /** * Create an instance of RichTextItemEquation given an JSON string * * @param jsonString JSON string * @return An instance of RichTextItemEquation * @throws IOException if the JSON string is invalid with respect to RichTextItemEquation */ public static RichTextItemEquation fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, RichTextItemEquation.class); } /** * Convert an instance of RichTextItemEquation to an JSON string * * @return JSON string */ public String toJson() { return JSON.getGson().toJson(this); } }
0
java-sources/ai/buildin/buildin-api-client/1.0.4/org/openapitools/client
java-sources/ai/buildin/buildin-api-client/1.0.4/org/openapitools/client/model/RichTextItemMention.java
/* * Buildin API * Buildin Developer API * * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ package org.openapitools.client.model; import java.util.Objects; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; import org.openapitools.client.model.RichTextItemMentionDate; import org.openapitools.client.model.RichTextItemMentionUser; import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.google.gson.JsonArray; import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; import com.google.gson.JsonObject; import com.google.gson.JsonParseException; import com.google.gson.TypeAdapterFactory; import com.google.gson.reflect.TypeToken; import com.google.gson.TypeAdapter; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Set; import org.openapitools.client.JSON; /** * RichTextItemMention */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.14.0") public class RichTextItemMention { /** * Gets or Sets type */ @JsonAdapter(TypeEnum.Adapter.class) public enum TypeEnum { USER("user"), PAGE("page"), DATE("date"); private String value; TypeEnum(String value) { this.value = value; } public String getValue() { return value; } @Override public String toString() { return String.valueOf(value); } public static TypeEnum fromValue(String value) { for (TypeEnum b : TypeEnum.values()) { if (b.value.equals(value)) { return b; } } throw new IllegalArgumentException("Unexpected value '" + value + "'"); } public static class Adapter extends TypeAdapter<TypeEnum> { @Override public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) throws IOException { jsonWriter.value(enumeration.getValue()); } @Override public TypeEnum read(final JsonReader jsonReader) throws IOException { String value = jsonReader.nextString(); return TypeEnum.fromValue(value); } } public static void validateJsonElement(JsonElement jsonElement) throws IOException { String value = jsonElement.getAsString(); TypeEnum.fromValue(value); } } public static final String SERIALIZED_NAME_TYPE = "type"; @SerializedName(SERIALIZED_NAME_TYPE) @javax.annotation.Nullable private TypeEnum type; public static final String SERIALIZED_NAME_USER = "user"; @SerializedName(SERIALIZED_NAME_USER) @javax.annotation.Nullable private RichTextItemMentionUser user; public static final String SERIALIZED_NAME_PAGE = "page"; @SerializedName(SERIALIZED_NAME_PAGE) @javax.annotation.Nullable private RichTextItemMentionUser page; public static final String SERIALIZED_NAME_DATE = "date"; @SerializedName(SERIALIZED_NAME_DATE) @javax.annotation.Nullable private RichTextItemMentionDate date; public RichTextItemMention() { } public RichTextItemMention type(@javax.annotation.Nullable TypeEnum type) { this.type = type; return this; } /** * Get type * @return type */ @javax.annotation.Nullable public TypeEnum getType() { return type; } public void setType(@javax.annotation.Nullable TypeEnum type) { this.type = type; } public RichTextItemMention user(@javax.annotation.Nullable RichTextItemMentionUser user) { this.user = user; return this; } /** * Get user * @return user */ @javax.annotation.Nullable public RichTextItemMentionUser getUser() { return user; } public void setUser(@javax.annotation.Nullable RichTextItemMentionUser user) { this.user = user; } public RichTextItemMention page(@javax.annotation.Nullable RichTextItemMentionUser page) { this.page = page; return this; } /** * Get page * @return page */ @javax.annotation.Nullable public RichTextItemMentionUser getPage() { return page; } public void setPage(@javax.annotation.Nullable RichTextItemMentionUser page) { this.page = page; } public RichTextItemMention date(@javax.annotation.Nullable RichTextItemMentionDate date) { this.date = date; return this; } /** * Get date * @return date */ @javax.annotation.Nullable public RichTextItemMentionDate getDate() { return date; } public void setDate(@javax.annotation.Nullable RichTextItemMentionDate date) { this.date = date; } @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } RichTextItemMention richTextItemMention = (RichTextItemMention) o; return Objects.equals(this.type, richTextItemMention.type) && Objects.equals(this.user, richTextItemMention.user) && Objects.equals(this.page, richTextItemMention.page) && Objects.equals(this.date, richTextItemMention.date); } @Override public int hashCode() { return Objects.hash(type, user, page, date); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class RichTextItemMention {\n"); sb.append(" type: ").append(toIndentedString(type)).append("\n"); sb.append(" user: ").append(toIndentedString(user)).append("\n"); sb.append(" page: ").append(toIndentedString(page)).append("\n"); sb.append(" date: ").append(toIndentedString(date)).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 String toIndentedString(Object o) { if (o == null) { return "null"; } return o.toString().replace("\n", "\n "); } public static HashSet<String> openapiFields; public static HashSet<String> openapiRequiredFields; static { // a set of all properties/fields (JSON key names) openapiFields = new HashSet<String>(Arrays.asList("type", "user", "page", "date")); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet<String>(0); } /** * Validates the JSON Element and throws an exception if issues found * * @param jsonElement JSON Element * @throws IOException if the JSON Element is invalid with respect to RichTextItemMention */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!RichTextItemMention.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in RichTextItemMention is not found in the empty JSON string", RichTextItemMention.openapiRequiredFields.toString())); } } Set<Map.Entry<String, JsonElement>> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields for (Map.Entry<String, JsonElement> entry : entries) { if (!RichTextItemMention.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `RichTextItemMention` properties. JSON: %s", entry.getKey(), jsonElement.toString())); } } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("type") != null && !jsonObj.get("type").isJsonNull()) && !jsonObj.get("type").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); } // validate the optional field `type` if (jsonObj.get("type") != null && !jsonObj.get("type").isJsonNull()) { TypeEnum.validateJsonElement(jsonObj.get("type")); } // validate the optional field `user` if (jsonObj.get("user") != null && !jsonObj.get("user").isJsonNull()) { RichTextItemMentionUser.validateJsonElement(jsonObj.get("user")); } // validate the optional field `page` if (jsonObj.get("page") != null && !jsonObj.get("page").isJsonNull()) { RichTextItemMentionUser.validateJsonElement(jsonObj.get("page")); } // validate the optional field `date` if (jsonObj.get("date") != null && !jsonObj.get("date").isJsonNull()) { RichTextItemMentionDate.validateJsonElement(jsonObj.get("date")); } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { if (!RichTextItemMention.class.isAssignableFrom(type.getRawType())) { return null; // this class only serializes 'RichTextItemMention' and its subtypes } final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); final TypeAdapter<RichTextItemMention> thisAdapter = gson.getDelegateAdapter(this, TypeToken.get(RichTextItemMention.class)); return (TypeAdapter<T>) new TypeAdapter<RichTextItemMention>() { @Override public void write(JsonWriter out, RichTextItemMention value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); elementAdapter.write(out, obj); } @Override public RichTextItemMention read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } /** * Create an instance of RichTextItemMention given an JSON string * * @param jsonString JSON string * @return An instance of RichTextItemMention * @throws IOException if the JSON string is invalid with respect to RichTextItemMention */ public static RichTextItemMention fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, RichTextItemMention.class); } /** * Convert an instance of RichTextItemMention to an JSON string * * @return JSON string */ public String toJson() { return JSON.getGson().toJson(this); } }
0
java-sources/ai/buildin/buildin-api-client/1.0.4/org/openapitools/client
java-sources/ai/buildin/buildin-api-client/1.0.4/org/openapitools/client/model/RichTextItemMentionDate.java
/* * Buildin API * Buildin Developer API * * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ package org.openapitools.client.model; import java.util.Objects; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.google.gson.JsonArray; import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; import com.google.gson.JsonObject; import com.google.gson.JsonParseException; import com.google.gson.TypeAdapterFactory; import com.google.gson.reflect.TypeToken; import com.google.gson.TypeAdapter; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Set; import org.openapitools.client.JSON; /** * RichTextItemMentionDate */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.14.0") public class RichTextItemMentionDate { public static final String SERIALIZED_NAME_START = "start"; @SerializedName(SERIALIZED_NAME_START) @javax.annotation.Nullable private String start; public static final String SERIALIZED_NAME_END = "end"; @SerializedName(SERIALIZED_NAME_END) @javax.annotation.Nullable private String end; public static final String SERIALIZED_NAME_TIME_ZONE = "time_zone"; @SerializedName(SERIALIZED_NAME_TIME_ZONE) @javax.annotation.Nullable private String timeZone; public RichTextItemMentionDate() { } public RichTextItemMentionDate start(@javax.annotation.Nullable String start) { this.start = start; return this; } /** * Get start * @return start */ @javax.annotation.Nullable public String getStart() { return start; } public void setStart(@javax.annotation.Nullable String start) { this.start = start; } public RichTextItemMentionDate end(@javax.annotation.Nullable String end) { this.end = end; return this; } /** * Get end * @return end */ @javax.annotation.Nullable public String getEnd() { return end; } public void setEnd(@javax.annotation.Nullable String end) { this.end = end; } public RichTextItemMentionDate timeZone(@javax.annotation.Nullable String timeZone) { this.timeZone = timeZone; return this; } /** * Get timeZone * @return timeZone */ @javax.annotation.Nullable public String getTimeZone() { return timeZone; } public void setTimeZone(@javax.annotation.Nullable String timeZone) { this.timeZone = timeZone; } @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } RichTextItemMentionDate richTextItemMentionDate = (RichTextItemMentionDate) o; return Objects.equals(this.start, richTextItemMentionDate.start) && Objects.equals(this.end, richTextItemMentionDate.end) && Objects.equals(this.timeZone, richTextItemMentionDate.timeZone); } @Override public int hashCode() { return Objects.hash(start, end, timeZone); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class RichTextItemMentionDate {\n"); sb.append(" start: ").append(toIndentedString(start)).append("\n"); sb.append(" end: ").append(toIndentedString(end)).append("\n"); sb.append(" timeZone: ").append(toIndentedString(timeZone)).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 String toIndentedString(Object o) { if (o == null) { return "null"; } return o.toString().replace("\n", "\n "); } public static HashSet<String> openapiFields; public static HashSet<String> openapiRequiredFields; static { // a set of all properties/fields (JSON key names) openapiFields = new HashSet<String>(Arrays.asList("start", "end", "time_zone")); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet<String>(0); } /** * Validates the JSON Element and throws an exception if issues found * * @param jsonElement JSON Element * @throws IOException if the JSON Element is invalid with respect to RichTextItemMentionDate */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!RichTextItemMentionDate.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in RichTextItemMentionDate is not found in the empty JSON string", RichTextItemMentionDate.openapiRequiredFields.toString())); } } Set<Map.Entry<String, JsonElement>> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields for (Map.Entry<String, JsonElement> entry : entries) { if (!RichTextItemMentionDate.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `RichTextItemMentionDate` properties. JSON: %s", entry.getKey(), jsonElement.toString())); } } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("start") != null && !jsonObj.get("start").isJsonNull()) && !jsonObj.get("start").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `start` to be a primitive type in the JSON string but got `%s`", jsonObj.get("start").toString())); } if ((jsonObj.get("end") != null && !jsonObj.get("end").isJsonNull()) && !jsonObj.get("end").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `end` to be a primitive type in the JSON string but got `%s`", jsonObj.get("end").toString())); } if ((jsonObj.get("time_zone") != null && !jsonObj.get("time_zone").isJsonNull()) && !jsonObj.get("time_zone").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `time_zone` to be a primitive type in the JSON string but got `%s`", jsonObj.get("time_zone").toString())); } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { if (!RichTextItemMentionDate.class.isAssignableFrom(type.getRawType())) { return null; // this class only serializes 'RichTextItemMentionDate' and its subtypes } final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); final TypeAdapter<RichTextItemMentionDate> thisAdapter = gson.getDelegateAdapter(this, TypeToken.get(RichTextItemMentionDate.class)); return (TypeAdapter<T>) new TypeAdapter<RichTextItemMentionDate>() { @Override public void write(JsonWriter out, RichTextItemMentionDate value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); elementAdapter.write(out, obj); } @Override public RichTextItemMentionDate read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } /** * Create an instance of RichTextItemMentionDate given an JSON string * * @param jsonString JSON string * @return An instance of RichTextItemMentionDate * @throws IOException if the JSON string is invalid with respect to RichTextItemMentionDate */ public static RichTextItemMentionDate fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, RichTextItemMentionDate.class); } /** * Convert an instance of RichTextItemMentionDate to an JSON string * * @return JSON string */ public String toJson() { return JSON.getGson().toJson(this); } }
0
java-sources/ai/buildin/buildin-api-client/1.0.4/org/openapitools/client
java-sources/ai/buildin/buildin-api-client/1.0.4/org/openapitools/client/model/RichTextItemMentionUser.java
/* * Buildin API * Buildin Developer API * * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ package org.openapitools.client.model; import java.util.Objects; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; import java.util.UUID; import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.google.gson.JsonArray; import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; import com.google.gson.JsonObject; import com.google.gson.JsonParseException; import com.google.gson.TypeAdapterFactory; import com.google.gson.reflect.TypeToken; import com.google.gson.TypeAdapter; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Set; import org.openapitools.client.JSON; /** * RichTextItemMentionUser */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.14.0") public class RichTextItemMentionUser { public static final String SERIALIZED_NAME_ID = "id"; @SerializedName(SERIALIZED_NAME_ID) @javax.annotation.Nullable private UUID id; public RichTextItemMentionUser() { } public RichTextItemMentionUser id(@javax.annotation.Nullable UUID id) { this.id = id; return this; } /** * Get id * @return id */ @javax.annotation.Nullable public UUID getId() { return id; } public void setId(@javax.annotation.Nullable UUID id) { this.id = id; } @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } RichTextItemMentionUser richTextItemMentionUser = (RichTextItemMentionUser) o; return Objects.equals(this.id, richTextItemMentionUser.id); } @Override public int hashCode() { return Objects.hash(id); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class RichTextItemMentionUser {\n"); sb.append(" id: ").append(toIndentedString(id)).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 String toIndentedString(Object o) { if (o == null) { return "null"; } return o.toString().replace("\n", "\n "); } public static HashSet<String> openapiFields; public static HashSet<String> openapiRequiredFields; static { // a set of all properties/fields (JSON key names) openapiFields = new HashSet<String>(Arrays.asList("id")); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet<String>(0); } /** * Validates the JSON Element and throws an exception if issues found * * @param jsonElement JSON Element * @throws IOException if the JSON Element is invalid with respect to RichTextItemMentionUser */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!RichTextItemMentionUser.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in RichTextItemMentionUser is not found in the empty JSON string", RichTextItemMentionUser.openapiRequiredFields.toString())); } } Set<Map.Entry<String, JsonElement>> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields for (Map.Entry<String, JsonElement> entry : entries) { if (!RichTextItemMentionUser.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `RichTextItemMentionUser` properties. JSON: %s", entry.getKey(), jsonElement.toString())); } } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("id") != null && !jsonObj.get("id").isJsonNull()) && !jsonObj.get("id").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { if (!RichTextItemMentionUser.class.isAssignableFrom(type.getRawType())) { return null; // this class only serializes 'RichTextItemMentionUser' and its subtypes } final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); final TypeAdapter<RichTextItemMentionUser> thisAdapter = gson.getDelegateAdapter(this, TypeToken.get(RichTextItemMentionUser.class)); return (TypeAdapter<T>) new TypeAdapter<RichTextItemMentionUser>() { @Override public void write(JsonWriter out, RichTextItemMentionUser value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); elementAdapter.write(out, obj); } @Override public RichTextItemMentionUser read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } /** * Create an instance of RichTextItemMentionUser given an JSON string * * @param jsonString JSON string * @return An instance of RichTextItemMentionUser * @throws IOException if the JSON string is invalid with respect to RichTextItemMentionUser */ public static RichTextItemMentionUser fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, RichTextItemMentionUser.class); } /** * Convert an instance of RichTextItemMentionUser to an JSON string * * @return JSON string */ public String toJson() { return JSON.getGson().toJson(this); } }
0
java-sources/ai/buildin/buildin-api-client/1.0.4/org/openapitools/client
java-sources/ai/buildin/buildin-api-client/1.0.4/org/openapitools/client/model/RichTextItemText.java
/* * Buildin API * Buildin Developer API * * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ package org.openapitools.client.model; import java.util.Objects; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; import org.openapitools.client.model.RichTextItemTextLink; import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.google.gson.JsonArray; import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; import com.google.gson.JsonObject; import com.google.gson.JsonParseException; import com.google.gson.TypeAdapterFactory; import com.google.gson.reflect.TypeToken; import com.google.gson.TypeAdapter; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Set; import org.openapitools.client.JSON; /** * RichTextItemText */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.14.0") public class RichTextItemText { public static final String SERIALIZED_NAME_CONTENT = "content"; @SerializedName(SERIALIZED_NAME_CONTENT) @javax.annotation.Nullable private String content; public static final String SERIALIZED_NAME_LINK = "link"; @SerializedName(SERIALIZED_NAME_LINK) @javax.annotation.Nullable private RichTextItemTextLink link; public RichTextItemText() { } public RichTextItemText content(@javax.annotation.Nullable String content) { this.content = content; return this; } /** * Get content * @return content */ @javax.annotation.Nullable public String getContent() { return content; } public void setContent(@javax.annotation.Nullable String content) { this.content = content; } public RichTextItemText link(@javax.annotation.Nullable RichTextItemTextLink link) { this.link = link; return this; } /** * Get link * @return link */ @javax.annotation.Nullable public RichTextItemTextLink getLink() { return link; } public void setLink(@javax.annotation.Nullable RichTextItemTextLink link) { this.link = link; } @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } RichTextItemText richTextItemText = (RichTextItemText) o; return Objects.equals(this.content, richTextItemText.content) && Objects.equals(this.link, richTextItemText.link); } @Override public int hashCode() { return Objects.hash(content, link); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class RichTextItemText {\n"); sb.append(" content: ").append(toIndentedString(content)).append("\n"); sb.append(" link: ").append(toIndentedString(link)).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 String toIndentedString(Object o) { if (o == null) { return "null"; } return o.toString().replace("\n", "\n "); } public static HashSet<String> openapiFields; public static HashSet<String> openapiRequiredFields; static { // a set of all properties/fields (JSON key names) openapiFields = new HashSet<String>(Arrays.asList("content", "link")); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet<String>(0); } /** * Validates the JSON Element and throws an exception if issues found * * @param jsonElement JSON Element * @throws IOException if the JSON Element is invalid with respect to RichTextItemText */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!RichTextItemText.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in RichTextItemText is not found in the empty JSON string", RichTextItemText.openapiRequiredFields.toString())); } } Set<Map.Entry<String, JsonElement>> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields for (Map.Entry<String, JsonElement> entry : entries) { if (!RichTextItemText.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `RichTextItemText` properties. JSON: %s", entry.getKey(), jsonElement.toString())); } } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("content") != null && !jsonObj.get("content").isJsonNull()) && !jsonObj.get("content").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `content` to be a primitive type in the JSON string but got `%s`", jsonObj.get("content").toString())); } // validate the optional field `link` if (jsonObj.get("link") != null && !jsonObj.get("link").isJsonNull()) { RichTextItemTextLink.validateJsonElement(jsonObj.get("link")); } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { if (!RichTextItemText.class.isAssignableFrom(type.getRawType())) { return null; // this class only serializes 'RichTextItemText' and its subtypes } final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); final TypeAdapter<RichTextItemText> thisAdapter = gson.getDelegateAdapter(this, TypeToken.get(RichTextItemText.class)); return (TypeAdapter<T>) new TypeAdapter<RichTextItemText>() { @Override public void write(JsonWriter out, RichTextItemText value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); elementAdapter.write(out, obj); } @Override public RichTextItemText read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } /** * Create an instance of RichTextItemText given an JSON string * * @param jsonString JSON string * @return An instance of RichTextItemText * @throws IOException if the JSON string is invalid with respect to RichTextItemText */ public static RichTextItemText fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, RichTextItemText.class); } /** * Convert an instance of RichTextItemText to an JSON string * * @return JSON string */ public String toJson() { return JSON.getGson().toJson(this); } }
0
java-sources/ai/buildin/buildin-api-client/1.0.4/org/openapitools/client
java-sources/ai/buildin/buildin-api-client/1.0.4/org/openapitools/client/model/RichTextItemTextLink.java
/* * Buildin API * Buildin Developer API * * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ package org.openapitools.client.model; import java.util.Objects; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.google.gson.JsonArray; import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; import com.google.gson.JsonObject; import com.google.gson.JsonParseException; import com.google.gson.TypeAdapterFactory; import com.google.gson.reflect.TypeToken; import com.google.gson.TypeAdapter; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Set; import org.openapitools.client.JSON; /** * RichTextItemTextLink */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.14.0") public class RichTextItemTextLink { public static final String SERIALIZED_NAME_URL = "url"; @SerializedName(SERIALIZED_NAME_URL) @javax.annotation.Nullable private String url; public RichTextItemTextLink() { } public RichTextItemTextLink url(@javax.annotation.Nullable String url) { this.url = url; return this; } /** * Get url * @return url */ @javax.annotation.Nullable public String getUrl() { return url; } public void setUrl(@javax.annotation.Nullable String url) { this.url = url; } @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } RichTextItemTextLink richTextItemTextLink = (RichTextItemTextLink) o; return Objects.equals(this.url, richTextItemTextLink.url); } @Override public int hashCode() { return Objects.hash(url); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class RichTextItemTextLink {\n"); sb.append(" url: ").append(toIndentedString(url)).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 String toIndentedString(Object o) { if (o == null) { return "null"; } return o.toString().replace("\n", "\n "); } public static HashSet<String> openapiFields; public static HashSet<String> openapiRequiredFields; static { // a set of all properties/fields (JSON key names) openapiFields = new HashSet<String>(Arrays.asList("url")); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet<String>(0); } /** * Validates the JSON Element and throws an exception if issues found * * @param jsonElement JSON Element * @throws IOException if the JSON Element is invalid with respect to RichTextItemTextLink */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!RichTextItemTextLink.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in RichTextItemTextLink is not found in the empty JSON string", RichTextItemTextLink.openapiRequiredFields.toString())); } } Set<Map.Entry<String, JsonElement>> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields for (Map.Entry<String, JsonElement> entry : entries) { if (!RichTextItemTextLink.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `RichTextItemTextLink` properties. JSON: %s", entry.getKey(), jsonElement.toString())); } } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("url") != null && !jsonObj.get("url").isJsonNull()) && !jsonObj.get("url").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `url` to be a primitive type in the JSON string but got `%s`", jsonObj.get("url").toString())); } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { if (!RichTextItemTextLink.class.isAssignableFrom(type.getRawType())) { return null; // this class only serializes 'RichTextItemTextLink' and its subtypes } final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); final TypeAdapter<RichTextItemTextLink> thisAdapter = gson.getDelegateAdapter(this, TypeToken.get(RichTextItemTextLink.class)); return (TypeAdapter<T>) new TypeAdapter<RichTextItemTextLink>() { @Override public void write(JsonWriter out, RichTextItemTextLink value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); elementAdapter.write(out, obj); } @Override public RichTextItemTextLink read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } /** * Create an instance of RichTextItemTextLink given an JSON string * * @param jsonString JSON string * @return An instance of RichTextItemTextLink * @throws IOException if the JSON string is invalid with respect to RichTextItemTextLink */ public static RichTextItemTextLink fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, RichTextItemTextLink.class); } /** * Convert an instance of RichTextItemTextLink to an JSON string * * @return JSON string */ public String toJson() { return JSON.getGson().toJson(this); } }
0
java-sources/ai/buildin/buildin-api-client/1.0.4/org/openapitools/client
java-sources/ai/buildin/buildin-api-client/1.0.4/org/openapitools/client/model/SearchRequest.java
/* * Buildin API * Buildin Developer API * * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ package org.openapitools.client.model; import java.util.Objects; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.google.gson.JsonArray; import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; import com.google.gson.JsonObject; import com.google.gson.JsonParseException; import com.google.gson.TypeAdapterFactory; import com.google.gson.reflect.TypeToken; import com.google.gson.TypeAdapter; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Set; import org.openapitools.client.JSON; /** * SearchRequest */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.14.0") public class SearchRequest { public static final String SERIALIZED_NAME_QUERY = "query"; @SerializedName(SERIALIZED_NAME_QUERY) @javax.annotation.Nonnull private String query; public SearchRequest() { } public SearchRequest query(@javax.annotation.Nonnull String query) { this.query = query; return this; } /** * 搜索关键词 * @return query */ @javax.annotation.Nonnull public String getQuery() { return query; } public void setQuery(@javax.annotation.Nonnull String query) { this.query = query; } @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } SearchRequest searchRequest = (SearchRequest) o; return Objects.equals(this.query, searchRequest.query); } @Override public int hashCode() { return Objects.hash(query); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class SearchRequest {\n"); sb.append(" query: ").append(toIndentedString(query)).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 String toIndentedString(Object o) { if (o == null) { return "null"; } return o.toString().replace("\n", "\n "); } public static HashSet<String> openapiFields; public static HashSet<String> openapiRequiredFields; static { // a set of all properties/fields (JSON key names) openapiFields = new HashSet<String>(Arrays.asList("query")); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet<String>(Arrays.asList("query")); } /** * Validates the JSON Element and throws an exception if issues found * * @param jsonElement JSON Element * @throws IOException if the JSON Element is invalid with respect to SearchRequest */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!SearchRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in SearchRequest is not found in the empty JSON string", SearchRequest.openapiRequiredFields.toString())); } } Set<Map.Entry<String, JsonElement>> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields for (Map.Entry<String, JsonElement> entry : entries) { if (!SearchRequest.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SearchRequest` properties. JSON: %s", entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string for (String requiredField : SearchRequest.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); } } JsonObject jsonObj = jsonElement.getAsJsonObject(); if (!jsonObj.get("query").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `query` to be a primitive type in the JSON string but got `%s`", jsonObj.get("query").toString())); } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { if (!SearchRequest.class.isAssignableFrom(type.getRawType())) { return null; // this class only serializes 'SearchRequest' and its subtypes } final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); final TypeAdapter<SearchRequest> thisAdapter = gson.getDelegateAdapter(this, TypeToken.get(SearchRequest.class)); return (TypeAdapter<T>) new TypeAdapter<SearchRequest>() { @Override public void write(JsonWriter out, SearchRequest value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); elementAdapter.write(out, obj); } @Override public SearchRequest read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } /** * Create an instance of SearchRequest given an JSON string * * @param jsonString JSON string * @return An instance of SearchRequest * @throws IOException if the JSON string is invalid with respect to SearchRequest */ public static SearchRequest fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, SearchRequest.class); } /** * Convert an instance of SearchRequest to an JSON string * * @return JSON string */ public String toJson() { return JSON.getGson().toJson(this); } }
0
java-sources/ai/buildin/buildin-api-client/1.0.4/org/openapitools/client
java-sources/ai/buildin/buildin-api-client/1.0.4/org/openapitools/client/model/SearchResult.java
/* * Buildin API * Buildin Developer API * * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ package org.openapitools.client.model; import java.util.Objects; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.ArrayList; import java.util.Arrays; import java.util.List; import org.openapitools.client.model.SearchResultDataInner; import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.google.gson.JsonArray; import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; import com.google.gson.JsonObject; import com.google.gson.JsonParseException; import com.google.gson.TypeAdapterFactory; import com.google.gson.reflect.TypeToken; import com.google.gson.TypeAdapter; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Set; import org.openapitools.client.JSON; /** * SearchResult */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.14.0") public class SearchResult { public static final String SERIALIZED_NAME_SUCCESS = "success"; @SerializedName(SERIALIZED_NAME_SUCCESS) @javax.annotation.Nullable private Boolean success; public static final String SERIALIZED_NAME_DATA = "data"; @SerializedName(SERIALIZED_NAME_DATA) @javax.annotation.Nullable private List<SearchResultDataInner> data = new ArrayList<>(); public SearchResult() { } public SearchResult success(@javax.annotation.Nullable Boolean success) { this.success = success; return this; } /** * 搜索是否成功 * @return success */ @javax.annotation.Nullable public Boolean getSuccess() { return success; } public void setSuccess(@javax.annotation.Nullable Boolean success) { this.success = success; } public SearchResult data(@javax.annotation.Nullable List<SearchResultDataInner> data) { this.data = data; return this; } public SearchResult addDataItem(SearchResultDataInner dataItem) { if (this.data == null) { this.data = new ArrayList<>(); } this.data.add(dataItem); return this; } /** * Get data * @return data */ @javax.annotation.Nullable public List<SearchResultDataInner> getData() { return data; } public void setData(@javax.annotation.Nullable List<SearchResultDataInner> data) { this.data = data; } @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } SearchResult searchResult = (SearchResult) o; return Objects.equals(this.success, searchResult.success) && Objects.equals(this.data, searchResult.data); } @Override public int hashCode() { return Objects.hash(success, data); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class SearchResult {\n"); sb.append(" success: ").append(toIndentedString(success)).append("\n"); sb.append(" data: ").append(toIndentedString(data)).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 String toIndentedString(Object o) { if (o == null) { return "null"; } return o.toString().replace("\n", "\n "); } public static HashSet<String> openapiFields; public static HashSet<String> openapiRequiredFields; static { // a set of all properties/fields (JSON key names) openapiFields = new HashSet<String>(Arrays.asList("success", "data")); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet<String>(0); } /** * Validates the JSON Element and throws an exception if issues found * * @param jsonElement JSON Element * @throws IOException if the JSON Element is invalid with respect to SearchResult */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!SearchResult.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in SearchResult is not found in the empty JSON string", SearchResult.openapiRequiredFields.toString())); } } Set<Map.Entry<String, JsonElement>> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields for (Map.Entry<String, JsonElement> entry : entries) { if (!SearchResult.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SearchResult` properties. JSON: %s", entry.getKey(), jsonElement.toString())); } } JsonObject jsonObj = jsonElement.getAsJsonObject(); if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { JsonArray jsonArraydata = jsonObj.getAsJsonArray("data"); if (jsonArraydata != null) { // ensure the json data is an array if (!jsonObj.get("data").isJsonArray()) { throw new IllegalArgumentException(String.format("Expected the field `data` to be an array in the JSON string but got `%s`", jsonObj.get("data").toString())); } // validate the optional field `data` (array) for (int i = 0; i < jsonArraydata.size(); i++) { SearchResultDataInner.validateJsonElement(jsonArraydata.get(i)); }; } } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { if (!SearchResult.class.isAssignableFrom(type.getRawType())) { return null; // this class only serializes 'SearchResult' and its subtypes } final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); final TypeAdapter<SearchResult> thisAdapter = gson.getDelegateAdapter(this, TypeToken.get(SearchResult.class)); return (TypeAdapter<T>) new TypeAdapter<SearchResult>() { @Override public void write(JsonWriter out, SearchResult value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); elementAdapter.write(out, obj); } @Override public SearchResult read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } /** * Create an instance of SearchResult given an JSON string * * @param jsonString JSON string * @return An instance of SearchResult * @throws IOException if the JSON string is invalid with respect to SearchResult */ public static SearchResult fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, SearchResult.class); } /** * Convert an instance of SearchResult to an JSON string * * @return JSON string */ public String toJson() { return JSON.getGson().toJson(this); } }
0
java-sources/ai/buildin/buildin-api-client/1.0.4/org/openapitools/client
java-sources/ai/buildin/buildin-api-client/1.0.4/org/openapitools/client/model/SearchResultDataInner.java
/* * Buildin API * Buildin Developer API * * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ package org.openapitools.client.model; import java.util.Objects; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; import java.util.UUID; import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.google.gson.JsonArray; import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; import com.google.gson.JsonObject; import com.google.gson.JsonParseException; import com.google.gson.TypeAdapterFactory; import com.google.gson.reflect.TypeToken; import com.google.gson.TypeAdapter; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Set; import org.openapitools.client.JSON; /** * SearchResultDataInner */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.14.0") public class SearchResultDataInner { public static final String SERIALIZED_NAME_UUID = "uuid"; @SerializedName(SERIALIZED_NAME_UUID) @javax.annotation.Nullable private UUID uuid; public static final String SERIALIZED_NAME_TITLE = "title"; @SerializedName(SERIALIZED_NAME_TITLE) @javax.annotation.Nullable private String title; public static final String SERIALIZED_NAME_CONTENT = "content"; @SerializedName(SERIALIZED_NAME_CONTENT) @javax.annotation.Nullable private String content; public static final String SERIALIZED_NAME_TYPE = "type"; @SerializedName(SERIALIZED_NAME_TYPE) @javax.annotation.Nullable private String type; public SearchResultDataInner() { } public SearchResultDataInner uuid(@javax.annotation.Nullable UUID uuid) { this.uuid = uuid; return this; } /** * 页面或块的唯一标识符 * @return uuid */ @javax.annotation.Nullable public UUID getUuid() { return uuid; } public void setUuid(@javax.annotation.Nullable UUID uuid) { this.uuid = uuid; } public SearchResultDataInner title(@javax.annotation.Nullable String title) { this.title = title; return this; } /** * 页面或块的标题 * @return title */ @javax.annotation.Nullable public String getTitle() { return title; } public void setTitle(@javax.annotation.Nullable String title) { this.title = title; } public SearchResultDataInner content(@javax.annotation.Nullable String content) { this.content = content; return this; } /** * 页面或块的内容片段 * @return content */ @javax.annotation.Nullable public String getContent() { return content; } public void setContent(@javax.annotation.Nullable String content) { this.content = content; } public SearchResultDataInner type(@javax.annotation.Nullable String type) { this.type = type; return this; } /** * 结果类型 * @return type */ @javax.annotation.Nullable public String getType() { return type; } public void setType(@javax.annotation.Nullable String type) { this.type = type; } @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } SearchResultDataInner searchResultDataInner = (SearchResultDataInner) o; return Objects.equals(this.uuid, searchResultDataInner.uuid) && Objects.equals(this.title, searchResultDataInner.title) && Objects.equals(this.content, searchResultDataInner.content) && Objects.equals(this.type, searchResultDataInner.type); } @Override public int hashCode() { return Objects.hash(uuid, title, content, type); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class SearchResultDataInner {\n"); sb.append(" uuid: ").append(toIndentedString(uuid)).append("\n"); sb.append(" title: ").append(toIndentedString(title)).append("\n"); sb.append(" content: ").append(toIndentedString(content)).append("\n"); sb.append(" type: ").append(toIndentedString(type)).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 String toIndentedString(Object o) { if (o == null) { return "null"; } return o.toString().replace("\n", "\n "); } public static HashSet<String> openapiFields; public static HashSet<String> openapiRequiredFields; static { // a set of all properties/fields (JSON key names) openapiFields = new HashSet<String>(Arrays.asList("uuid", "title", "content", "type")); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet<String>(0); } /** * Validates the JSON Element and throws an exception if issues found * * @param jsonElement JSON Element * @throws IOException if the JSON Element is invalid with respect to SearchResultDataInner */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!SearchResultDataInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in SearchResultDataInner is not found in the empty JSON string", SearchResultDataInner.openapiRequiredFields.toString())); } } Set<Map.Entry<String, JsonElement>> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields for (Map.Entry<String, JsonElement> entry : entries) { if (!SearchResultDataInner.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SearchResultDataInner` properties. JSON: %s", entry.getKey(), jsonElement.toString())); } } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("uuid") != null && !jsonObj.get("uuid").isJsonNull()) && !jsonObj.get("uuid").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `uuid` to be a primitive type in the JSON string but got `%s`", jsonObj.get("uuid").toString())); } if ((jsonObj.get("title") != null && !jsonObj.get("title").isJsonNull()) && !jsonObj.get("title").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `title` to be a primitive type in the JSON string but got `%s`", jsonObj.get("title").toString())); } if ((jsonObj.get("content") != null && !jsonObj.get("content").isJsonNull()) && !jsonObj.get("content").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `content` to be a primitive type in the JSON string but got `%s`", jsonObj.get("content").toString())); } if ((jsonObj.get("type") != null && !jsonObj.get("type").isJsonNull()) && !jsonObj.get("type").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { if (!SearchResultDataInner.class.isAssignableFrom(type.getRawType())) { return null; // this class only serializes 'SearchResultDataInner' and its subtypes } final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); final TypeAdapter<SearchResultDataInner> thisAdapter = gson.getDelegateAdapter(this, TypeToken.get(SearchResultDataInner.class)); return (TypeAdapter<T>) new TypeAdapter<SearchResultDataInner>() { @Override public void write(JsonWriter out, SearchResultDataInner value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); elementAdapter.write(out, obj); } @Override public SearchResultDataInner read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } /** * Create an instance of SearchResultDataInner given an JSON string * * @param jsonString JSON string * @return An instance of SearchResultDataInner * @throws IOException if the JSON string is invalid with respect to SearchResultDataInner */ public static SearchResultDataInner fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, SearchResultDataInner.class); } /** * Convert an instance of SearchResultDataInner to an JSON string * * @return JSON string */ public String toJson() { return JSON.getGson().toJson(this); } }
0
java-sources/ai/buildin/buildin-api-client/1.0.4/org/openapitools/client
java-sources/ai/buildin/buildin-api-client/1.0.4/org/openapitools/client/model/UpdateBlockRequest.java
/* * Buildin API * Buildin Developer API * * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ package org.openapitools.client.model; import java.util.Objects; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; import org.openapitools.client.model.BlockData; import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.google.gson.JsonArray; import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; import com.google.gson.JsonObject; import com.google.gson.JsonParseException; import com.google.gson.TypeAdapterFactory; import com.google.gson.reflect.TypeToken; import com.google.gson.TypeAdapter; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Set; import org.openapitools.client.JSON; /** * UpdateBlockRequest */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.14.0") public class UpdateBlockRequest { /** * Gets or Sets type */ @JsonAdapter(TypeEnum.Adapter.class) public enum TypeEnum { PARAGRAPH("paragraph"), HEADING_1("heading_1"), HEADING_2("heading_2"), HEADING_3("heading_3"), BULLETED_LIST_ITEM("bulleted_list_item"), NUMBERED_LIST_ITEM("numbered_list_item"), TO_DO("to_do"), QUOTE("quote"), TOGGLE("toggle"), CODE("code"), IMAGE("image"), FILE("file"), BOOKMARK("bookmark"), EMBED("embed"), CALLOUT("callout"), EQUATION("equation"), LINK_TO_PAGE("link_to_page"), TEMPLATE("template"), SYNCED_BLOCK("synced_block"), DIVIDER("divider"), COLUMN_LIST("column_list"), COLUMN("column"), TABLE("table"), TABLE_ROW("table_row"), CHILD_PAGE("child_page"), CHILD_DATABASE("child_database"); private String value; TypeEnum(String value) { this.value = value; } public String getValue() { return value; } @Override public String toString() { return String.valueOf(value); } public static TypeEnum fromValue(String value) { for (TypeEnum b : TypeEnum.values()) { if (b.value.equals(value)) { return b; } } throw new IllegalArgumentException("Unexpected value '" + value + "'"); } public static class Adapter extends TypeAdapter<TypeEnum> { @Override public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) throws IOException { jsonWriter.value(enumeration.getValue()); } @Override public TypeEnum read(final JsonReader jsonReader) throws IOException { String value = jsonReader.nextString(); return TypeEnum.fromValue(value); } } public static void validateJsonElement(JsonElement jsonElement) throws IOException { String value = jsonElement.getAsString(); TypeEnum.fromValue(value); } } public static final String SERIALIZED_NAME_TYPE = "type"; @SerializedName(SERIALIZED_NAME_TYPE) @javax.annotation.Nullable private TypeEnum type; public static final String SERIALIZED_NAME_ARCHIVED = "archived"; @SerializedName(SERIALIZED_NAME_ARCHIVED) @javax.annotation.Nullable private Boolean archived; public static final String SERIALIZED_NAME_DATA = "data"; @SerializedName(SERIALIZED_NAME_DATA) @javax.annotation.Nullable private BlockData data; public UpdateBlockRequest() { } public UpdateBlockRequest type(@javax.annotation.Nullable TypeEnum type) { this.type = type; return this; } /** * Get type * @return type */ @javax.annotation.Nullable public TypeEnum getType() { return type; } public void setType(@javax.annotation.Nullable TypeEnum type) { this.type = type; } public UpdateBlockRequest archived(@javax.annotation.Nullable Boolean archived) { this.archived = archived; return this; } /** * 设置为true来归档(删除)块 * @return archived */ @javax.annotation.Nullable public Boolean getArchived() { return archived; } public void setArchived(@javax.annotation.Nullable Boolean archived) { this.archived = archived; } public UpdateBlockRequest data(@javax.annotation.Nullable BlockData data) { this.data = data; return this; } /** * Get data * @return data */ @javax.annotation.Nullable public BlockData getData() { return data; } public void setData(@javax.annotation.Nullable BlockData data) { this.data = data; } @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } UpdateBlockRequest updateBlockRequest = (UpdateBlockRequest) o; return Objects.equals(this.type, updateBlockRequest.type) && Objects.equals(this.archived, updateBlockRequest.archived) && Objects.equals(this.data, updateBlockRequest.data); } @Override public int hashCode() { return Objects.hash(type, archived, data); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class UpdateBlockRequest {\n"); sb.append(" type: ").append(toIndentedString(type)).append("\n"); sb.append(" archived: ").append(toIndentedString(archived)).append("\n"); sb.append(" data: ").append(toIndentedString(data)).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 String toIndentedString(Object o) { if (o == null) { return "null"; } return o.toString().replace("\n", "\n "); } public static HashSet<String> openapiFields; public static HashSet<String> openapiRequiredFields; static { // a set of all properties/fields (JSON key names) openapiFields = new HashSet<String>(Arrays.asList("type", "archived", "data")); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet<String>(0); } /** * Validates the JSON Element and throws an exception if issues found * * @param jsonElement JSON Element * @throws IOException if the JSON Element is invalid with respect to UpdateBlockRequest */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!UpdateBlockRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in UpdateBlockRequest is not found in the empty JSON string", UpdateBlockRequest.openapiRequiredFields.toString())); } } Set<Map.Entry<String, JsonElement>> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields for (Map.Entry<String, JsonElement> entry : entries) { if (!UpdateBlockRequest.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UpdateBlockRequest` properties. JSON: %s", entry.getKey(), jsonElement.toString())); } } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("type") != null && !jsonObj.get("type").isJsonNull()) && !jsonObj.get("type").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); } // validate the optional field `type` if (jsonObj.get("type") != null && !jsonObj.get("type").isJsonNull()) { TypeEnum.validateJsonElement(jsonObj.get("type")); } // validate the optional field `data` if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { BlockData.validateJsonElement(jsonObj.get("data")); } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { if (!UpdateBlockRequest.class.isAssignableFrom(type.getRawType())) { return null; // this class only serializes 'UpdateBlockRequest' and its subtypes } final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); final TypeAdapter<UpdateBlockRequest> thisAdapter = gson.getDelegateAdapter(this, TypeToken.get(UpdateBlockRequest.class)); return (TypeAdapter<T>) new TypeAdapter<UpdateBlockRequest>() { @Override public void write(JsonWriter out, UpdateBlockRequest value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); elementAdapter.write(out, obj); } @Override public UpdateBlockRequest read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } /** * Create an instance of UpdateBlockRequest given an JSON string * * @param jsonString JSON string * @return An instance of UpdateBlockRequest * @throws IOException if the JSON string is invalid with respect to UpdateBlockRequest */ public static UpdateBlockRequest fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, UpdateBlockRequest.class); } /** * Convert an instance of UpdateBlockRequest to an JSON string * * @return JSON string */ public String toJson() { return JSON.getGson().toJson(this); } }
0
java-sources/ai/buildin/buildin-api-client/1.0.4/org/openapitools/client
java-sources/ai/buildin/buildin-api-client/1.0.4/org/openapitools/client/model/UpdateDatabaseRequest.java
/* * Buildin API * Buildin Developer API * * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ package org.openapitools.client.model; import java.util.Objects; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; import org.openapitools.client.model.Cover; import org.openapitools.client.model.Icon; import org.openapitools.client.model.RichTextItem; import org.openapitools.client.model.UpdateDatabaseRequestPropertiesValue; import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.google.gson.JsonArray; import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; import com.google.gson.JsonObject; import com.google.gson.JsonParseException; import com.google.gson.TypeAdapterFactory; import com.google.gson.reflect.TypeToken; import com.google.gson.TypeAdapter; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Set; import org.openapitools.client.JSON; /** * UpdateDatabaseRequest */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.14.0") public class UpdateDatabaseRequest { public static final String SERIALIZED_NAME_TITLE = "title"; @SerializedName(SERIALIZED_NAME_TITLE) @javax.annotation.Nullable private List<RichTextItem> title = new ArrayList<>(); public static final String SERIALIZED_NAME_ICON = "icon"; @SerializedName(SERIALIZED_NAME_ICON) @javax.annotation.Nullable private Icon icon; public static final String SERIALIZED_NAME_COVER = "cover"; @SerializedName(SERIALIZED_NAME_COVER) @javax.annotation.Nullable private Cover cover; public static final String SERIALIZED_NAME_PROPERTIES = "properties"; @SerializedName(SERIALIZED_NAME_PROPERTIES) @javax.annotation.Nullable private Map<String, UpdateDatabaseRequestPropertiesValue> properties = new HashMap<>(); public static final String SERIALIZED_NAME_ARCHIVED = "archived"; @SerializedName(SERIALIZED_NAME_ARCHIVED) @javax.annotation.Nullable private Boolean archived; public UpdateDatabaseRequest() { } public UpdateDatabaseRequest title(@javax.annotation.Nullable List<RichTextItem> title) { this.title = title; return this; } public UpdateDatabaseRequest addTitleItem(RichTextItem titleItem) { if (this.title == null) { this.title = new ArrayList<>(); } this.title.add(titleItem); return this; } /** * Get title * @return title */ @javax.annotation.Nullable public List<RichTextItem> getTitle() { return title; } public void setTitle(@javax.annotation.Nullable List<RichTextItem> title) { this.title = title; } public UpdateDatabaseRequest icon(@javax.annotation.Nullable Icon icon) { this.icon = icon; return this; } /** * Get icon * @return icon */ @javax.annotation.Nullable public Icon getIcon() { return icon; } public void setIcon(@javax.annotation.Nullable Icon icon) { this.icon = icon; } public UpdateDatabaseRequest cover(@javax.annotation.Nullable Cover cover) { this.cover = cover; return this; } /** * Get cover * @return cover */ @javax.annotation.Nullable public Cover getCover() { return cover; } public void setCover(@javax.annotation.Nullable Cover cover) { this.cover = cover; } public UpdateDatabaseRequest properties(@javax.annotation.Nullable Map<String, UpdateDatabaseRequestPropertiesValue> properties) { this.properties = properties; return this; } public UpdateDatabaseRequest putPropertiesItem(String key, UpdateDatabaseRequestPropertiesValue propertiesItem) { if (this.properties == null) { this.properties = new HashMap<>(); } this.properties.put(key, propertiesItem); return this; } /** * Get properties * @return properties */ @javax.annotation.Nullable public Map<String, UpdateDatabaseRequestPropertiesValue> getProperties() { return properties; } public void setProperties(@javax.annotation.Nullable Map<String, UpdateDatabaseRequestPropertiesValue> properties) { this.properties = properties; } public UpdateDatabaseRequest archived(@javax.annotation.Nullable Boolean archived) { this.archived = archived; return this; } /** * Get archived * @return archived */ @javax.annotation.Nullable public Boolean getArchived() { return archived; } public void setArchived(@javax.annotation.Nullable Boolean archived) { this.archived = archived; } @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } UpdateDatabaseRequest updateDatabaseRequest = (UpdateDatabaseRequest) o; return Objects.equals(this.title, updateDatabaseRequest.title) && Objects.equals(this.icon, updateDatabaseRequest.icon) && Objects.equals(this.cover, updateDatabaseRequest.cover) && Objects.equals(this.properties, updateDatabaseRequest.properties) && Objects.equals(this.archived, updateDatabaseRequest.archived); } @Override public int hashCode() { return Objects.hash(title, icon, cover, properties, archived); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class UpdateDatabaseRequest {\n"); sb.append(" title: ").append(toIndentedString(title)).append("\n"); sb.append(" icon: ").append(toIndentedString(icon)).append("\n"); sb.append(" cover: ").append(toIndentedString(cover)).append("\n"); sb.append(" properties: ").append(toIndentedString(properties)).append("\n"); sb.append(" archived: ").append(toIndentedString(archived)).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 String toIndentedString(Object o) { if (o == null) { return "null"; } return o.toString().replace("\n", "\n "); } public static HashSet<String> openapiFields; public static HashSet<String> openapiRequiredFields; static { // a set of all properties/fields (JSON key names) openapiFields = new HashSet<String>(Arrays.asList("title", "icon", "cover", "properties", "archived")); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet<String>(0); } /** * Validates the JSON Element and throws an exception if issues found * * @param jsonElement JSON Element * @throws IOException if the JSON Element is invalid with respect to UpdateDatabaseRequest */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!UpdateDatabaseRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in UpdateDatabaseRequest is not found in the empty JSON string", UpdateDatabaseRequest.openapiRequiredFields.toString())); } } Set<Map.Entry<String, JsonElement>> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields for (Map.Entry<String, JsonElement> entry : entries) { if (!UpdateDatabaseRequest.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UpdateDatabaseRequest` properties. JSON: %s", entry.getKey(), jsonElement.toString())); } } JsonObject jsonObj = jsonElement.getAsJsonObject(); if (jsonObj.get("title") != null && !jsonObj.get("title").isJsonNull()) { JsonArray jsonArraytitle = jsonObj.getAsJsonArray("title"); if (jsonArraytitle != null) { // ensure the json data is an array if (!jsonObj.get("title").isJsonArray()) { throw new IllegalArgumentException(String.format("Expected the field `title` to be an array in the JSON string but got `%s`", jsonObj.get("title").toString())); } // validate the optional field `title` (array) for (int i = 0; i < jsonArraytitle.size(); i++) { RichTextItem.validateJsonElement(jsonArraytitle.get(i)); }; } } // validate the optional field `icon` if (jsonObj.get("icon") != null && !jsonObj.get("icon").isJsonNull()) { Icon.validateJsonElement(jsonObj.get("icon")); } // validate the optional field `cover` if (jsonObj.get("cover") != null && !jsonObj.get("cover").isJsonNull()) { Cover.validateJsonElement(jsonObj.get("cover")); } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { if (!UpdateDatabaseRequest.class.isAssignableFrom(type.getRawType())) { return null; // this class only serializes 'UpdateDatabaseRequest' and its subtypes } final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); final TypeAdapter<UpdateDatabaseRequest> thisAdapter = gson.getDelegateAdapter(this, TypeToken.get(UpdateDatabaseRequest.class)); return (TypeAdapter<T>) new TypeAdapter<UpdateDatabaseRequest>() { @Override public void write(JsonWriter out, UpdateDatabaseRequest value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); elementAdapter.write(out, obj); } @Override public UpdateDatabaseRequest read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } /** * Create an instance of UpdateDatabaseRequest given an JSON string * * @param jsonString JSON string * @return An instance of UpdateDatabaseRequest * @throws IOException if the JSON string is invalid with respect to UpdateDatabaseRequest */ public static UpdateDatabaseRequest fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, UpdateDatabaseRequest.class); } /** * Convert an instance of UpdateDatabaseRequest to an JSON string * * @return JSON string */ public String toJson() { return JSON.getGson().toJson(this); } }
0
java-sources/ai/buildin/buildin-api-client/1.0.4/org/openapitools/client
java-sources/ai/buildin/buildin-api-client/1.0.4/org/openapitools/client/model/UpdateDatabaseRequestPropertiesValue.java
/* * Buildin API * Buildin Developer API * * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ package org.openapitools.client.model; import java.util.Objects; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; import org.openapitools.client.model.PropertySchema; import org.openapitools.client.model.PropertySchemaFormulaFormula; import org.openapitools.client.model.PropertySchemaNumberNumber; import org.openapitools.client.model.PropertySchemaRelationRelation; import org.openapitools.client.model.PropertySchemaSelectSelect; import org.openapitools.jackson.nullable.JsonNullable; import java.io.IOException; import java.lang.reflect.Type; import java.util.logging.Level; import java.util.logging.Logger; import java.util.ArrayList; import java.util.Collections; import java.util.HashSet; import java.util.HashMap; import java.util.List; import java.util.Map; import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.google.gson.JsonParseException; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; import com.google.gson.reflect.TypeToken; import com.google.gson.JsonPrimitive; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonDeserializer; import com.google.gson.JsonSerializationContext; import com.google.gson.JsonSerializer; import com.google.gson.JsonElement; import com.google.gson.JsonObject; import com.google.gson.JsonArray; import com.google.gson.JsonParseException; import org.openapitools.client.JSON; @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.14.0") public class UpdateDatabaseRequestPropertiesValue extends AbstractOpenApiSchema { private static final Logger log = Logger.getLogger(UpdateDatabaseRequestPropertiesValue.class.getName()); public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { if (!UpdateDatabaseRequestPropertiesValue.class.isAssignableFrom(type.getRawType())) { return null; // this class only serializes 'UpdateDatabaseRequestPropertiesValue' and its subtypes } final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); final TypeAdapter<PropertySchema> adapterPropertySchema = gson.getDelegateAdapter(this, TypeToken.get(PropertySchema.class)); return (TypeAdapter<T>) new TypeAdapter<UpdateDatabaseRequestPropertiesValue>() { @Override public void write(JsonWriter out, UpdateDatabaseRequestPropertiesValue value) throws IOException { if (value == null || value.getActualInstance() == null) { elementAdapter.write(out, null); return; } // check if the actual instance is of the type `PropertySchema` if (value.getActualInstance() instanceof PropertySchema) { JsonElement element = adapterPropertySchema.toJsonTree((PropertySchema)value.getActualInstance()); elementAdapter.write(out, element); return; } throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: PropertySchema"); } @Override public UpdateDatabaseRequestPropertiesValue read(JsonReader in) throws IOException { Object deserialized = null; JsonElement jsonElement = elementAdapter.read(in); int match = 0; ArrayList<String> errorMessages = new ArrayList<>(); TypeAdapter actualAdapter = elementAdapter; // deserialize PropertySchema try { // validate the JSON object to see if any exception is thrown PropertySchema.validateJsonElement(jsonElement); actualAdapter = adapterPropertySchema; match++; log.log(Level.FINER, "Input data matches schema 'PropertySchema'"); } catch (Exception e) { // deserialization failed, continue errorMessages.add(String.format("Deserialization for PropertySchema failed with `%s`.", e.getMessage())); log.log(Level.FINER, "Input data does not match schema 'PropertySchema'", e); } if (match == 1) { UpdateDatabaseRequestPropertiesValue ret = new UpdateDatabaseRequestPropertiesValue(); ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); return ret; } throw new IOException(String.format("Failed deserialization for UpdateDatabaseRequestPropertiesValue: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonElement.toString())); } }.nullSafe(); } } // store a list of schema names defined in oneOf public static final Map<String, Class<?>> schemas = new HashMap<String, Class<?>>(); public UpdateDatabaseRequestPropertiesValue() { super("oneOf", Boolean.TRUE); } public UpdateDatabaseRequestPropertiesValue(Object o) { super("oneOf", Boolean.TRUE); setActualInstance(o); } static { schemas.put("PropertySchema", PropertySchema.class); } @Override public Map<String, Class<?>> getSchemas() { return UpdateDatabaseRequestPropertiesValue.schemas; } /** * Set the instance that matches the oneOf child schema, check * the instance parameter is valid against the oneOf child schemas: * PropertySchema * * It could be an instance of the 'oneOf' schemas. */ @Override public void setActualInstance(Object instance) { if (instance == null) { super.setActualInstance(instance); return; } if (instance instanceof PropertySchema) { super.setActualInstance(instance); return; } throw new RuntimeException("Invalid instance type. Must be PropertySchema"); } /** * Get the actual instance, which can be the following: * PropertySchema * * @return The actual instance (PropertySchema) */ @SuppressWarnings("unchecked") @Override public Object getActualInstance() { return super.getActualInstance(); } /** * Get the actual instance of `PropertySchema`. If the actual instance is not `PropertySchema`, * the ClassCastException will be thrown. * * @return The actual instance of `PropertySchema` * @throws ClassCastException if the instance is not `PropertySchema` */ public PropertySchema getPropertySchema() throws ClassCastException { return (PropertySchema)super.getActualInstance(); } /** * Validates the JSON Element and throws an exception if issues found * * @param jsonElement JSON Element * @throws IOException if the JSON Element is invalid with respect to UpdateDatabaseRequestPropertiesValue */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { // validate oneOf schemas one by one int validCount = 0; ArrayList<String> errorMessages = new ArrayList<>(); // validate the json string with PropertySchema try { PropertySchema.validateJsonElement(jsonElement); validCount++; } catch (Exception e) { errorMessages.add(String.format("Deserialization for PropertySchema failed with `%s`.", e.getMessage())); // continue to the next one } if (validCount != 1) { throw new IOException(String.format("The JSON string is invalid for UpdateDatabaseRequestPropertiesValue with oneOf schemas: PropertySchema. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonElement.toString())); } } /** * Create an instance of UpdateDatabaseRequestPropertiesValue given an JSON string * * @param jsonString JSON string * @return An instance of UpdateDatabaseRequestPropertiesValue * @throws IOException if the JSON string is invalid with respect to UpdateDatabaseRequestPropertiesValue */ public static UpdateDatabaseRequestPropertiesValue fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, UpdateDatabaseRequestPropertiesValue.class); } /** * Convert an instance of UpdateDatabaseRequestPropertiesValue to an JSON string * * @return JSON string */ public String toJson() { return JSON.getGson().toJson(this); } }
0
java-sources/ai/buildin/buildin-api-client/1.0.4/org/openapitools/client
java-sources/ai/buildin/buildin-api-client/1.0.4/org/openapitools/client/model/UpdatePageRequest.java
/* * Buildin API * Buildin Developer API * * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ package org.openapitools.client.model; import java.util.Objects; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; import java.util.HashMap; import java.util.Map; import org.openapitools.client.model.Cover; import org.openapitools.client.model.Icon; import org.openapitools.client.model.PropertyValue; import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.google.gson.JsonArray; import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; import com.google.gson.JsonObject; import com.google.gson.JsonParseException; import com.google.gson.TypeAdapterFactory; import com.google.gson.reflect.TypeToken; import com.google.gson.TypeAdapter; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Set; import org.openapitools.client.JSON; /** * UpdatePageRequest */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.14.0") public class UpdatePageRequest { public static final String SERIALIZED_NAME_PROPERTIES = "properties"; @SerializedName(SERIALIZED_NAME_PROPERTIES) @javax.annotation.Nullable private Map<String, PropertyValue> properties = new HashMap<>(); public static final String SERIALIZED_NAME_ICON = "icon"; @SerializedName(SERIALIZED_NAME_ICON) @javax.annotation.Nullable private Icon icon; public static final String SERIALIZED_NAME_COVER = "cover"; @SerializedName(SERIALIZED_NAME_COVER) @javax.annotation.Nullable private Cover cover; public static final String SERIALIZED_NAME_ARCHIVED = "archived"; @SerializedName(SERIALIZED_NAME_ARCHIVED) @javax.annotation.Nullable private Boolean archived; public UpdatePageRequest() { } public UpdatePageRequest properties(@javax.annotation.Nullable Map<String, PropertyValue> properties) { this.properties = properties; return this; } public UpdatePageRequest putPropertiesItem(String key, PropertyValue propertiesItem) { if (this.properties == null) { this.properties = new HashMap<>(); } this.properties.put(key, propertiesItem); return this; } /** * Get properties * @return properties */ @javax.annotation.Nullable public Map<String, PropertyValue> getProperties() { return properties; } public void setProperties(@javax.annotation.Nullable Map<String, PropertyValue> properties) { this.properties = properties; } public UpdatePageRequest icon(@javax.annotation.Nullable Icon icon) { this.icon = icon; return this; } /** * Get icon * @return icon */ @javax.annotation.Nullable public Icon getIcon() { return icon; } public void setIcon(@javax.annotation.Nullable Icon icon) { this.icon = icon; } public UpdatePageRequest cover(@javax.annotation.Nullable Cover cover) { this.cover = cover; return this; } /** * Get cover * @return cover */ @javax.annotation.Nullable public Cover getCover() { return cover; } public void setCover(@javax.annotation.Nullable Cover cover) { this.cover = cover; } public UpdatePageRequest archived(@javax.annotation.Nullable Boolean archived) { this.archived = archived; return this; } /** * Get archived * @return archived */ @javax.annotation.Nullable public Boolean getArchived() { return archived; } public void setArchived(@javax.annotation.Nullable Boolean archived) { this.archived = archived; } @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } UpdatePageRequest updatePageRequest = (UpdatePageRequest) o; return Objects.equals(this.properties, updatePageRequest.properties) && Objects.equals(this.icon, updatePageRequest.icon) && Objects.equals(this.cover, updatePageRequest.cover) && Objects.equals(this.archived, updatePageRequest.archived); } @Override public int hashCode() { return Objects.hash(properties, icon, cover, archived); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class UpdatePageRequest {\n"); sb.append(" properties: ").append(toIndentedString(properties)).append("\n"); sb.append(" icon: ").append(toIndentedString(icon)).append("\n"); sb.append(" cover: ").append(toIndentedString(cover)).append("\n"); sb.append(" archived: ").append(toIndentedString(archived)).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 String toIndentedString(Object o) { if (o == null) { return "null"; } return o.toString().replace("\n", "\n "); } public static HashSet<String> openapiFields; public static HashSet<String> openapiRequiredFields; static { // a set of all properties/fields (JSON key names) openapiFields = new HashSet<String>(Arrays.asList("properties", "icon", "cover", "archived")); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet<String>(0); } /** * Validates the JSON Element and throws an exception if issues found * * @param jsonElement JSON Element * @throws IOException if the JSON Element is invalid with respect to UpdatePageRequest */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!UpdatePageRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in UpdatePageRequest is not found in the empty JSON string", UpdatePageRequest.openapiRequiredFields.toString())); } } Set<Map.Entry<String, JsonElement>> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields for (Map.Entry<String, JsonElement> entry : entries) { if (!UpdatePageRequest.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UpdatePageRequest` properties. JSON: %s", entry.getKey(), jsonElement.toString())); } } JsonObject jsonObj = jsonElement.getAsJsonObject(); // validate the optional field `icon` if (jsonObj.get("icon") != null && !jsonObj.get("icon").isJsonNull()) { Icon.validateJsonElement(jsonObj.get("icon")); } // validate the optional field `cover` if (jsonObj.get("cover") != null && !jsonObj.get("cover").isJsonNull()) { Cover.validateJsonElement(jsonObj.get("cover")); } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { if (!UpdatePageRequest.class.isAssignableFrom(type.getRawType())) { return null; // this class only serializes 'UpdatePageRequest' and its subtypes } final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); final TypeAdapter<UpdatePageRequest> thisAdapter = gson.getDelegateAdapter(this, TypeToken.get(UpdatePageRequest.class)); return (TypeAdapter<T>) new TypeAdapter<UpdatePageRequest>() { @Override public void write(JsonWriter out, UpdatePageRequest value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); elementAdapter.write(out, obj); } @Override public UpdatePageRequest read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } /** * Create an instance of UpdatePageRequest given an JSON string * * @param jsonString JSON string * @return An instance of UpdatePageRequest * @throws IOException if the JSON string is invalid with respect to UpdatePageRequest */ public static UpdatePageRequest fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, UpdatePageRequest.class); } /** * Convert an instance of UpdatePageRequest to an JSON string * * @return JSON string */ public String toJson() { return JSON.getGson().toJson(this); } }
0
java-sources/ai/buildin/buildin-api-client/1.0.4/org/openapitools/client
java-sources/ai/buildin/buildin-api-client/1.0.4/org/openapitools/client/model/User.java
/* * Buildin API * Buildin Developer API * * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ package org.openapitools.client.model; import java.util.Objects; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; import java.util.UUID; import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.google.gson.JsonArray; import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; import com.google.gson.JsonObject; import com.google.gson.JsonParseException; import com.google.gson.TypeAdapterFactory; import com.google.gson.reflect.TypeToken; import com.google.gson.TypeAdapter; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Set; import org.openapitools.client.JSON; /** * User */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.14.0") public class User { /** * Gets or Sets _object */ @JsonAdapter(ObjectEnum.Adapter.class) public enum ObjectEnum { USER("user"); private String value; ObjectEnum(String value) { this.value = value; } public String getValue() { return value; } @Override public String toString() { return String.valueOf(value); } public static ObjectEnum fromValue(String value) { for (ObjectEnum b : ObjectEnum.values()) { if (b.value.equals(value)) { return b; } } throw new IllegalArgumentException("Unexpected value '" + value + "'"); } public static class Adapter extends TypeAdapter<ObjectEnum> { @Override public void write(final JsonWriter jsonWriter, final ObjectEnum enumeration) throws IOException { jsonWriter.value(enumeration.getValue()); } @Override public ObjectEnum read(final JsonReader jsonReader) throws IOException { String value = jsonReader.nextString(); return ObjectEnum.fromValue(value); } } public static void validateJsonElement(JsonElement jsonElement) throws IOException { String value = jsonElement.getAsString(); ObjectEnum.fromValue(value); } } public static final String SERIALIZED_NAME_OBJECT = "object"; @SerializedName(SERIALIZED_NAME_OBJECT) @javax.annotation.Nullable private ObjectEnum _object; public static final String SERIALIZED_NAME_ID = "id"; @SerializedName(SERIALIZED_NAME_ID) @javax.annotation.Nullable private UUID id; public User() { } public User _object(@javax.annotation.Nullable ObjectEnum _object) { this._object = _object; return this; } /** * Get _object * @return _object */ @javax.annotation.Nullable public ObjectEnum getObject() { return _object; } public void setObject(@javax.annotation.Nullable ObjectEnum _object) { this._object = _object; } public User id(@javax.annotation.Nullable UUID id) { this.id = id; return this; } /** * Get id * @return id */ @javax.annotation.Nullable public UUID getId() { return id; } public void setId(@javax.annotation.Nullable UUID id) { this.id = id; } @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } User user = (User) o; return Objects.equals(this._object, user._object) && Objects.equals(this.id, user.id); } @Override public int hashCode() { return Objects.hash(_object, id); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class User {\n"); sb.append(" _object: ").append(toIndentedString(_object)).append("\n"); sb.append(" id: ").append(toIndentedString(id)).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 String toIndentedString(Object o) { if (o == null) { return "null"; } return o.toString().replace("\n", "\n "); } public static HashSet<String> openapiFields; public static HashSet<String> openapiRequiredFields; static { // a set of all properties/fields (JSON key names) openapiFields = new HashSet<String>(Arrays.asList("object", "id")); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet<String>(0); } /** * Validates the JSON Element and throws an exception if issues found * * @param jsonElement JSON Element * @throws IOException if the JSON Element is invalid with respect to User */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!User.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in User is not found in the empty JSON string", User.openapiRequiredFields.toString())); } } Set<Map.Entry<String, JsonElement>> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields for (Map.Entry<String, JsonElement> entry : entries) { if (!User.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `User` properties. JSON: %s", entry.getKey(), jsonElement.toString())); } } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("object") != null && !jsonObj.get("object").isJsonNull()) && !jsonObj.get("object").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `object` to be a primitive type in the JSON string but got `%s`", jsonObj.get("object").toString())); } // validate the optional field `object` if (jsonObj.get("object") != null && !jsonObj.get("object").isJsonNull()) { ObjectEnum.validateJsonElement(jsonObj.get("object")); } if ((jsonObj.get("id") != null && !jsonObj.get("id").isJsonNull()) && !jsonObj.get("id").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { if (!User.class.isAssignableFrom(type.getRawType())) { return null; // this class only serializes 'User' and its subtypes } final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); final TypeAdapter<User> thisAdapter = gson.getDelegateAdapter(this, TypeToken.get(User.class)); return (TypeAdapter<T>) new TypeAdapter<User>() { @Override public void write(JsonWriter out, User value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); elementAdapter.write(out, obj); } @Override public User read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } /** * Create an instance of User given an JSON string * * @param jsonString JSON string * @return An instance of User * @throws IOException if the JSON string is invalid with respect to User */ public static User fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, User.class); } /** * Convert an instance of User to an JSON string * * @return JSON string */ public String toJson() { return JSON.getGson().toJson(this); } }
0
java-sources/ai/buildin/buildin-api-client/1.0.4/org/openapitools/client
java-sources/ai/buildin/buildin-api-client/1.0.4/org/openapitools/client/model/UserMe.java
/* * Buildin API * Buildin Developer API * * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ package org.openapitools.client.model; import java.util.Objects; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.net.URI; import java.util.Arrays; import java.util.UUID; import org.openapitools.client.model.UserMePerson; import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.google.gson.JsonArray; import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; import com.google.gson.JsonObject; import com.google.gson.JsonParseException; import com.google.gson.TypeAdapterFactory; import com.google.gson.reflect.TypeToken; import com.google.gson.TypeAdapter; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Set; import org.openapitools.client.JSON; /** * UserMe */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.14.0") public class UserMe { /** * Gets or Sets _object */ @JsonAdapter(ObjectEnum.Adapter.class) public enum ObjectEnum { USER("user"); private String value; ObjectEnum(String value) { this.value = value; } public String getValue() { return value; } @Override public String toString() { return String.valueOf(value); } public static ObjectEnum fromValue(String value) { for (ObjectEnum b : ObjectEnum.values()) { if (b.value.equals(value)) { return b; } } throw new IllegalArgumentException("Unexpected value '" + value + "'"); } public static class Adapter extends TypeAdapter<ObjectEnum> { @Override public void write(final JsonWriter jsonWriter, final ObjectEnum enumeration) throws IOException { jsonWriter.value(enumeration.getValue()); } @Override public ObjectEnum read(final JsonReader jsonReader) throws IOException { String value = jsonReader.nextString(); return ObjectEnum.fromValue(value); } } public static void validateJsonElement(JsonElement jsonElement) throws IOException { String value = jsonElement.getAsString(); ObjectEnum.fromValue(value); } } public static final String SERIALIZED_NAME_OBJECT = "object"; @SerializedName(SERIALIZED_NAME_OBJECT) @javax.annotation.Nullable private ObjectEnum _object; public static final String SERIALIZED_NAME_ID = "id"; @SerializedName(SERIALIZED_NAME_ID) @javax.annotation.Nullable private UUID id; /** * Gets or Sets type */ @JsonAdapter(TypeEnum.Adapter.class) public enum TypeEnum { PERSON("person"); private String value; TypeEnum(String value) { this.value = value; } public String getValue() { return value; } @Override public String toString() { return String.valueOf(value); } public static TypeEnum fromValue(String value) { for (TypeEnum b : TypeEnum.values()) { if (b.value.equals(value)) { return b; } } throw new IllegalArgumentException("Unexpected value '" + value + "'"); } public static class Adapter extends TypeAdapter<TypeEnum> { @Override public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) throws IOException { jsonWriter.value(enumeration.getValue()); } @Override public TypeEnum read(final JsonReader jsonReader) throws IOException { String value = jsonReader.nextString(); return TypeEnum.fromValue(value); } } public static void validateJsonElement(JsonElement jsonElement) throws IOException { String value = jsonElement.getAsString(); TypeEnum.fromValue(value); } } public static final String SERIALIZED_NAME_TYPE = "type"; @SerializedName(SERIALIZED_NAME_TYPE) @javax.annotation.Nullable private TypeEnum type; public static final String SERIALIZED_NAME_PERSON = "person"; @SerializedName(SERIALIZED_NAME_PERSON) @javax.annotation.Nullable private UserMePerson person; public static final String SERIALIZED_NAME_NAME = "name"; @SerializedName(SERIALIZED_NAME_NAME) @javax.annotation.Nullable private String name; public static final String SERIALIZED_NAME_AVATAR_URL = "avatar_url"; @SerializedName(SERIALIZED_NAME_AVATAR_URL) @javax.annotation.Nullable private URI avatarUrl; public UserMe() { } public UserMe _object(@javax.annotation.Nullable ObjectEnum _object) { this._object = _object; return this; } /** * Get _object * @return _object */ @javax.annotation.Nullable public ObjectEnum getObject() { return _object; } public void setObject(@javax.annotation.Nullable ObjectEnum _object) { this._object = _object; } public UserMe id(@javax.annotation.Nullable UUID id) { this.id = id; return this; } /** * 用户唯一标识符 * @return id */ @javax.annotation.Nullable public UUID getId() { return id; } public void setId(@javax.annotation.Nullable UUID id) { this.id = id; } public UserMe type(@javax.annotation.Nullable TypeEnum type) { this.type = type; return this; } /** * Get type * @return type */ @javax.annotation.Nullable public TypeEnum getType() { return type; } public void setType(@javax.annotation.Nullable TypeEnum type) { this.type = type; } public UserMe person(@javax.annotation.Nullable UserMePerson person) { this.person = person; return this; } /** * Get person * @return person */ @javax.annotation.Nullable public UserMePerson getPerson() { return person; } public void setPerson(@javax.annotation.Nullable UserMePerson person) { this.person = person; } public UserMe name(@javax.annotation.Nullable String name) { this.name = name; return this; } /** * 用户显示名称 * @return name */ @javax.annotation.Nullable public String getName() { return name; } public void setName(@javax.annotation.Nullable String name) { this.name = name; } public UserMe avatarUrl(@javax.annotation.Nullable URI avatarUrl) { this.avatarUrl = avatarUrl; return this; } /** * 用户头像URL * @return avatarUrl */ @javax.annotation.Nullable public URI getAvatarUrl() { return avatarUrl; } public void setAvatarUrl(@javax.annotation.Nullable URI avatarUrl) { this.avatarUrl = avatarUrl; } @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } UserMe userMe = (UserMe) o; return Objects.equals(this._object, userMe._object) && Objects.equals(this.id, userMe.id) && Objects.equals(this.type, userMe.type) && Objects.equals(this.person, userMe.person) && Objects.equals(this.name, userMe.name) && Objects.equals(this.avatarUrl, userMe.avatarUrl); } @Override public int hashCode() { return Objects.hash(_object, id, type, person, name, avatarUrl); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class UserMe {\n"); sb.append(" _object: ").append(toIndentedString(_object)).append("\n"); sb.append(" id: ").append(toIndentedString(id)).append("\n"); sb.append(" type: ").append(toIndentedString(type)).append("\n"); sb.append(" person: ").append(toIndentedString(person)).append("\n"); sb.append(" name: ").append(toIndentedString(name)).append("\n"); sb.append(" avatarUrl: ").append(toIndentedString(avatarUrl)).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 String toIndentedString(Object o) { if (o == null) { return "null"; } return o.toString().replace("\n", "\n "); } public static HashSet<String> openapiFields; public static HashSet<String> openapiRequiredFields; static { // a set of all properties/fields (JSON key names) openapiFields = new HashSet<String>(Arrays.asList("object", "id", "type", "person", "name", "avatar_url")); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet<String>(0); } /** * Validates the JSON Element and throws an exception if issues found * * @param jsonElement JSON Element * @throws IOException if the JSON Element is invalid with respect to UserMe */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!UserMe.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in UserMe is not found in the empty JSON string", UserMe.openapiRequiredFields.toString())); } } Set<Map.Entry<String, JsonElement>> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields for (Map.Entry<String, JsonElement> entry : entries) { if (!UserMe.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UserMe` properties. JSON: %s", entry.getKey(), jsonElement.toString())); } } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("object") != null && !jsonObj.get("object").isJsonNull()) && !jsonObj.get("object").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `object` to be a primitive type in the JSON string but got `%s`", jsonObj.get("object").toString())); } // validate the optional field `object` if (jsonObj.get("object") != null && !jsonObj.get("object").isJsonNull()) { ObjectEnum.validateJsonElement(jsonObj.get("object")); } if ((jsonObj.get("id") != null && !jsonObj.get("id").isJsonNull()) && !jsonObj.get("id").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); } if ((jsonObj.get("type") != null && !jsonObj.get("type").isJsonNull()) && !jsonObj.get("type").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); } // validate the optional field `type` if (jsonObj.get("type") != null && !jsonObj.get("type").isJsonNull()) { TypeEnum.validateJsonElement(jsonObj.get("type")); } // validate the optional field `person` if (jsonObj.get("person") != null && !jsonObj.get("person").isJsonNull()) { UserMePerson.validateJsonElement(jsonObj.get("person")); } if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); } if ((jsonObj.get("avatar_url") != null && !jsonObj.get("avatar_url").isJsonNull()) && !jsonObj.get("avatar_url").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `avatar_url` to be a primitive type in the JSON string but got `%s`", jsonObj.get("avatar_url").toString())); } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { if (!UserMe.class.isAssignableFrom(type.getRawType())) { return null; // this class only serializes 'UserMe' and its subtypes } final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); final TypeAdapter<UserMe> thisAdapter = gson.getDelegateAdapter(this, TypeToken.get(UserMe.class)); return (TypeAdapter<T>) new TypeAdapter<UserMe>() { @Override public void write(JsonWriter out, UserMe value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); elementAdapter.write(out, obj); } @Override public UserMe read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } /** * Create an instance of UserMe given an JSON string * * @param jsonString JSON string * @return An instance of UserMe * @throws IOException if the JSON string is invalid with respect to UserMe */ public static UserMe fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, UserMe.class); } /** * Convert an instance of UserMe to an JSON string * * @return JSON string */ public String toJson() { return JSON.getGson().toJson(this); } }
0
java-sources/ai/buildin/buildin-api-client/1.0.4/org/openapitools/client
java-sources/ai/buildin/buildin-api-client/1.0.4/org/openapitools/client/model/UserMePerson.java
/* * Buildin API * Buildin Developer API * * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ package org.openapitools.client.model; import java.util.Objects; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.google.gson.JsonArray; import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; import com.google.gson.JsonObject; import com.google.gson.JsonParseException; import com.google.gson.TypeAdapterFactory; import com.google.gson.reflect.TypeToken; import com.google.gson.TypeAdapter; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Set; import org.openapitools.client.JSON; /** * UserMePerson */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.14.0") public class UserMePerson { public static final String SERIALIZED_NAME_EMAIL = "email"; @SerializedName(SERIALIZED_NAME_EMAIL) @javax.annotation.Nullable private String email; public UserMePerson() { } public UserMePerson email(@javax.annotation.Nullable String email) { this.email = email; return this; } /** * 用户邮箱地址 * @return email */ @javax.annotation.Nullable public String getEmail() { return email; } public void setEmail(@javax.annotation.Nullable String email) { this.email = email; } @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } UserMePerson userMePerson = (UserMePerson) o; return Objects.equals(this.email, userMePerson.email); } @Override public int hashCode() { return Objects.hash(email); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class UserMePerson {\n"); sb.append(" email: ").append(toIndentedString(email)).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 String toIndentedString(Object o) { if (o == null) { return "null"; } return o.toString().replace("\n", "\n "); } public static HashSet<String> openapiFields; public static HashSet<String> openapiRequiredFields; static { // a set of all properties/fields (JSON key names) openapiFields = new HashSet<String>(Arrays.asList("email")); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet<String>(0); } /** * Validates the JSON Element and throws an exception if issues found * * @param jsonElement JSON Element * @throws IOException if the JSON Element is invalid with respect to UserMePerson */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!UserMePerson.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in UserMePerson is not found in the empty JSON string", UserMePerson.openapiRequiredFields.toString())); } } Set<Map.Entry<String, JsonElement>> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields for (Map.Entry<String, JsonElement> entry : entries) { if (!UserMePerson.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UserMePerson` properties. JSON: %s", entry.getKey(), jsonElement.toString())); } } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("email") != null && !jsonObj.get("email").isJsonNull()) && !jsonObj.get("email").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("email").toString())); } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { if (!UserMePerson.class.isAssignableFrom(type.getRawType())) { return null; // this class only serializes 'UserMePerson' and its subtypes } final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); final TypeAdapter<UserMePerson> thisAdapter = gson.getDelegateAdapter(this, TypeToken.get(UserMePerson.class)); return (TypeAdapter<T>) new TypeAdapter<UserMePerson>() { @Override public void write(JsonWriter out, UserMePerson value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); elementAdapter.write(out, obj); } @Override public UserMePerson read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } /** * Create an instance of UserMePerson given an JSON string * * @param jsonString JSON string * @return An instance of UserMePerson * @throws IOException if the JSON string is invalid with respect to UserMePerson */ public static UserMePerson fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, UserMePerson.class); } /** * Convert an instance of UserMePerson to an JSON string * * @return JSON string */ public String toJson() { return JSON.getGson().toJson(this); } }
0
java-sources/ai/buildin/buildin-api-client/1.0.4/org/openapitools/client
java-sources/ai/buildin/buildin-api-client/1.0.4/org/openapitools/client/model/V1SearchPageResult.java
/* * Buildin API * Buildin Developer API * * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ package org.openapitools.client.model; import java.util.Objects; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.time.OffsetDateTime; import java.util.Arrays; import java.util.UUID; import org.openapitools.client.model.V1SearchPageResultParent; import org.openapitools.client.model.V1SearchPageResultProperties; import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.google.gson.JsonArray; import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; import com.google.gson.JsonObject; import com.google.gson.JsonParseException; import com.google.gson.TypeAdapterFactory; import com.google.gson.reflect.TypeToken; import com.google.gson.TypeAdapter; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Set; import org.openapitools.client.JSON; /** * V1SearchPageResult */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.14.0") public class V1SearchPageResult { /** * Gets or Sets _object */ @JsonAdapter(ObjectEnum.Adapter.class) public enum ObjectEnum { PAGE("page"); private String value; ObjectEnum(String value) { this.value = value; } public String getValue() { return value; } @Override public String toString() { return String.valueOf(value); } public static ObjectEnum fromValue(String value) { for (ObjectEnum b : ObjectEnum.values()) { if (b.value.equals(value)) { return b; } } throw new IllegalArgumentException("Unexpected value '" + value + "'"); } public static class Adapter extends TypeAdapter<ObjectEnum> { @Override public void write(final JsonWriter jsonWriter, final ObjectEnum enumeration) throws IOException { jsonWriter.value(enumeration.getValue()); } @Override public ObjectEnum read(final JsonReader jsonReader) throws IOException { String value = jsonReader.nextString(); return ObjectEnum.fromValue(value); } } public static void validateJsonElement(JsonElement jsonElement) throws IOException { String value = jsonElement.getAsString(); ObjectEnum.fromValue(value); } } public static final String SERIALIZED_NAME_OBJECT = "object"; @SerializedName(SERIALIZED_NAME_OBJECT) @javax.annotation.Nullable private ObjectEnum _object; public static final String SERIALIZED_NAME_ID = "id"; @SerializedName(SERIALIZED_NAME_ID) @javax.annotation.Nullable private UUID id; public static final String SERIALIZED_NAME_CREATED_TIME = "created_time"; @SerializedName(SERIALIZED_NAME_CREATED_TIME) @javax.annotation.Nullable private OffsetDateTime createdTime; public static final String SERIALIZED_NAME_LAST_EDITED_TIME = "last_edited_time"; @SerializedName(SERIALIZED_NAME_LAST_EDITED_TIME) @javax.annotation.Nullable private OffsetDateTime lastEditedTime; public static final String SERIALIZED_NAME_PARENT = "parent"; @SerializedName(SERIALIZED_NAME_PARENT) @javax.annotation.Nullable private V1SearchPageResultParent parent; public static final String SERIALIZED_NAME_ARCHIVED = "archived"; @SerializedName(SERIALIZED_NAME_ARCHIVED) @javax.annotation.Nullable private Boolean archived; public static final String SERIALIZED_NAME_PROPERTIES = "properties"; @SerializedName(SERIALIZED_NAME_PROPERTIES) @javax.annotation.Nullable private V1SearchPageResultProperties properties; public V1SearchPageResult() { } public V1SearchPageResult _object(@javax.annotation.Nullable ObjectEnum _object) { this._object = _object; return this; } /** * Get _object * @return _object */ @javax.annotation.Nullable public ObjectEnum getObject() { return _object; } public void setObject(@javax.annotation.Nullable ObjectEnum _object) { this._object = _object; } public V1SearchPageResult id(@javax.annotation.Nullable UUID id) { this.id = id; return this; } /** * 页面的唯一标识符 * @return id */ @javax.annotation.Nullable public UUID getId() { return id; } public void setId(@javax.annotation.Nullable UUID id) { this.id = id; } public V1SearchPageResult createdTime(@javax.annotation.Nullable OffsetDateTime createdTime) { this.createdTime = createdTime; return this; } /** * 页面创建时间 * @return createdTime */ @javax.annotation.Nullable public OffsetDateTime getCreatedTime() { return createdTime; } public void setCreatedTime(@javax.annotation.Nullable OffsetDateTime createdTime) { this.createdTime = createdTime; } public V1SearchPageResult lastEditedTime(@javax.annotation.Nullable OffsetDateTime lastEditedTime) { this.lastEditedTime = lastEditedTime; return this; } /** * 页面最后编辑时间 * @return lastEditedTime */ @javax.annotation.Nullable public OffsetDateTime getLastEditedTime() { return lastEditedTime; } public void setLastEditedTime(@javax.annotation.Nullable OffsetDateTime lastEditedTime) { this.lastEditedTime = lastEditedTime; } public V1SearchPageResult parent(@javax.annotation.Nullable V1SearchPageResultParent parent) { this.parent = parent; return this; } /** * Get parent * @return parent */ @javax.annotation.Nullable public V1SearchPageResultParent getParent() { return parent; } public void setParent(@javax.annotation.Nullable V1SearchPageResultParent parent) { this.parent = parent; } public V1SearchPageResult archived(@javax.annotation.Nullable Boolean archived) { this.archived = archived; return this; } /** * 页面是否已归档 * @return archived */ @javax.annotation.Nullable public Boolean getArchived() { return archived; } public void setArchived(@javax.annotation.Nullable Boolean archived) { this.archived = archived; } public V1SearchPageResult properties(@javax.annotation.Nullable V1SearchPageResultProperties properties) { this.properties = properties; return this; } /** * Get properties * @return properties */ @javax.annotation.Nullable public V1SearchPageResultProperties getProperties() { return properties; } public void setProperties(@javax.annotation.Nullable V1SearchPageResultProperties properties) { this.properties = properties; } @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } V1SearchPageResult v1SearchPageResult = (V1SearchPageResult) o; return Objects.equals(this._object, v1SearchPageResult._object) && Objects.equals(this.id, v1SearchPageResult.id) && Objects.equals(this.createdTime, v1SearchPageResult.createdTime) && Objects.equals(this.lastEditedTime, v1SearchPageResult.lastEditedTime) && Objects.equals(this.parent, v1SearchPageResult.parent) && Objects.equals(this.archived, v1SearchPageResult.archived) && Objects.equals(this.properties, v1SearchPageResult.properties); } @Override public int hashCode() { return Objects.hash(_object, id, createdTime, lastEditedTime, parent, archived, properties); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class V1SearchPageResult {\n"); sb.append(" _object: ").append(toIndentedString(_object)).append("\n"); sb.append(" id: ").append(toIndentedString(id)).append("\n"); sb.append(" createdTime: ").append(toIndentedString(createdTime)).append("\n"); sb.append(" lastEditedTime: ").append(toIndentedString(lastEditedTime)).append("\n"); sb.append(" parent: ").append(toIndentedString(parent)).append("\n"); sb.append(" archived: ").append(toIndentedString(archived)).append("\n"); sb.append(" properties: ").append(toIndentedString(properties)).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 String toIndentedString(Object o) { if (o == null) { return "null"; } return o.toString().replace("\n", "\n "); } public static HashSet<String> openapiFields; public static HashSet<String> openapiRequiredFields; static { // a set of all properties/fields (JSON key names) openapiFields = new HashSet<String>(Arrays.asList("object", "id", "created_time", "last_edited_time", "parent", "archived", "properties")); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet<String>(0); } /** * Validates the JSON Element and throws an exception if issues found * * @param jsonElement JSON Element * @throws IOException if the JSON Element is invalid with respect to V1SearchPageResult */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!V1SearchPageResult.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in V1SearchPageResult is not found in the empty JSON string", V1SearchPageResult.openapiRequiredFields.toString())); } } Set<Map.Entry<String, JsonElement>> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields for (Map.Entry<String, JsonElement> entry : entries) { if (!V1SearchPageResult.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1SearchPageResult` properties. JSON: %s", entry.getKey(), jsonElement.toString())); } } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("object") != null && !jsonObj.get("object").isJsonNull()) && !jsonObj.get("object").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `object` to be a primitive type in the JSON string but got `%s`", jsonObj.get("object").toString())); } // validate the optional field `object` if (jsonObj.get("object") != null && !jsonObj.get("object").isJsonNull()) { ObjectEnum.validateJsonElement(jsonObj.get("object")); } if ((jsonObj.get("id") != null && !jsonObj.get("id").isJsonNull()) && !jsonObj.get("id").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); } // validate the optional field `parent` if (jsonObj.get("parent") != null && !jsonObj.get("parent").isJsonNull()) { V1SearchPageResultParent.validateJsonElement(jsonObj.get("parent")); } // validate the optional field `properties` if (jsonObj.get("properties") != null && !jsonObj.get("properties").isJsonNull()) { V1SearchPageResultProperties.validateJsonElement(jsonObj.get("properties")); } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { if (!V1SearchPageResult.class.isAssignableFrom(type.getRawType())) { return null; // this class only serializes 'V1SearchPageResult' and its subtypes } final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); final TypeAdapter<V1SearchPageResult> thisAdapter = gson.getDelegateAdapter(this, TypeToken.get(V1SearchPageResult.class)); return (TypeAdapter<T>) new TypeAdapter<V1SearchPageResult>() { @Override public void write(JsonWriter out, V1SearchPageResult value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); elementAdapter.write(out, obj); } @Override public V1SearchPageResult read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } /** * Create an instance of V1SearchPageResult given an JSON string * * @param jsonString JSON string * @return An instance of V1SearchPageResult * @throws IOException if the JSON string is invalid with respect to V1SearchPageResult */ public static V1SearchPageResult fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, V1SearchPageResult.class); } /** * Convert an instance of V1SearchPageResult to an JSON string * * @return JSON string */ public String toJson() { return JSON.getGson().toJson(this); } }
0
java-sources/ai/buildin/buildin-api-client/1.0.4/org/openapitools/client
java-sources/ai/buildin/buildin-api-client/1.0.4/org/openapitools/client/model/V1SearchPageResultParent.java
/* * Buildin API * Buildin Developer API * * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ package org.openapitools.client.model; import java.util.Objects; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; import java.util.UUID; import org.openapitools.client.model.ParentBlockId; import org.openapitools.client.model.ParentDatabaseId; import org.openapitools.client.model.ParentPageId; import org.openapitools.client.model.ParentSpaceId; import java.io.IOException; import java.lang.reflect.Type; import java.util.logging.Level; import java.util.logging.Logger; import java.util.ArrayList; import java.util.Collections; import java.util.HashSet; import java.util.HashMap; import java.util.List; import java.util.Map; import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.google.gson.JsonParseException; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; import com.google.gson.reflect.TypeToken; import com.google.gson.JsonPrimitive; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonDeserializer; import com.google.gson.JsonSerializationContext; import com.google.gson.JsonSerializer; import com.google.gson.JsonElement; import com.google.gson.JsonObject; import com.google.gson.JsonArray; import com.google.gson.JsonParseException; import org.openapitools.client.JSON; @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.14.0") public class V1SearchPageResultParent extends AbstractOpenApiSchema { private static final Logger log = Logger.getLogger(V1SearchPageResultParent.class.getName()); public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { if (!V1SearchPageResultParent.class.isAssignableFrom(type.getRawType())) { return null; // this class only serializes 'V1SearchPageResultParent' and its subtypes } final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); final TypeAdapter<ParentSpaceId> adapterParentSpaceId = gson.getDelegateAdapter(this, TypeToken.get(ParentSpaceId.class)); final TypeAdapter<ParentDatabaseId> adapterParentDatabaseId = gson.getDelegateAdapter(this, TypeToken.get(ParentDatabaseId.class)); final TypeAdapter<ParentPageId> adapterParentPageId = gson.getDelegateAdapter(this, TypeToken.get(ParentPageId.class)); final TypeAdapter<ParentBlockId> adapterParentBlockId = gson.getDelegateAdapter(this, TypeToken.get(ParentBlockId.class)); return (TypeAdapter<T>) new TypeAdapter<V1SearchPageResultParent>() { @Override public void write(JsonWriter out, V1SearchPageResultParent value) throws IOException { if (value == null || value.getActualInstance() == null) { elementAdapter.write(out, null); return; } // check if the actual instance is of the type `ParentSpaceId` if (value.getActualInstance() instanceof ParentSpaceId) { JsonElement element = adapterParentSpaceId.toJsonTree((ParentSpaceId)value.getActualInstance()); elementAdapter.write(out, element); return; } // check if the actual instance is of the type `ParentDatabaseId` if (value.getActualInstance() instanceof ParentDatabaseId) { JsonElement element = adapterParentDatabaseId.toJsonTree((ParentDatabaseId)value.getActualInstance()); elementAdapter.write(out, element); return; } // check if the actual instance is of the type `ParentPageId` if (value.getActualInstance() instanceof ParentPageId) { JsonElement element = adapterParentPageId.toJsonTree((ParentPageId)value.getActualInstance()); elementAdapter.write(out, element); return; } // check if the actual instance is of the type `ParentBlockId` if (value.getActualInstance() instanceof ParentBlockId) { JsonElement element = adapterParentBlockId.toJsonTree((ParentBlockId)value.getActualInstance()); elementAdapter.write(out, element); return; } throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: ParentBlockId, ParentDatabaseId, ParentPageId, ParentSpaceId"); } @Override public V1SearchPageResultParent read(JsonReader in) throws IOException { Object deserialized = null; JsonElement jsonElement = elementAdapter.read(in); int match = 0; ArrayList<String> errorMessages = new ArrayList<>(); TypeAdapter actualAdapter = elementAdapter; // deserialize ParentSpaceId try { // validate the JSON object to see if any exception is thrown ParentSpaceId.validateJsonElement(jsonElement); actualAdapter = adapterParentSpaceId; match++; log.log(Level.FINER, "Input data matches schema 'ParentSpaceId'"); } catch (Exception e) { // deserialization failed, continue errorMessages.add(String.format("Deserialization for ParentSpaceId failed with `%s`.", e.getMessage())); log.log(Level.FINER, "Input data does not match schema 'ParentSpaceId'", e); } // deserialize ParentDatabaseId try { // validate the JSON object to see if any exception is thrown ParentDatabaseId.validateJsonElement(jsonElement); actualAdapter = adapterParentDatabaseId; match++; log.log(Level.FINER, "Input data matches schema 'ParentDatabaseId'"); } catch (Exception e) { // deserialization failed, continue errorMessages.add(String.format("Deserialization for ParentDatabaseId failed with `%s`.", e.getMessage())); log.log(Level.FINER, "Input data does not match schema 'ParentDatabaseId'", e); } // deserialize ParentPageId try { // validate the JSON object to see if any exception is thrown ParentPageId.validateJsonElement(jsonElement); actualAdapter = adapterParentPageId; match++; log.log(Level.FINER, "Input data matches schema 'ParentPageId'"); } catch (Exception e) { // deserialization failed, continue errorMessages.add(String.format("Deserialization for ParentPageId failed with `%s`.", e.getMessage())); log.log(Level.FINER, "Input data does not match schema 'ParentPageId'", e); } // deserialize ParentBlockId try { // validate the JSON object to see if any exception is thrown ParentBlockId.validateJsonElement(jsonElement); actualAdapter = adapterParentBlockId; match++; log.log(Level.FINER, "Input data matches schema 'ParentBlockId'"); } catch (Exception e) { // deserialization failed, continue errorMessages.add(String.format("Deserialization for ParentBlockId failed with `%s`.", e.getMessage())); log.log(Level.FINER, "Input data does not match schema 'ParentBlockId'", e); } if (match == 1) { V1SearchPageResultParent ret = new V1SearchPageResultParent(); ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); return ret; } throw new IOException(String.format("Failed deserialization for V1SearchPageResultParent: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonElement.toString())); } }.nullSafe(); } } // store a list of schema names defined in oneOf public static final Map<String, Class<?>> schemas = new HashMap<String, Class<?>>(); public V1SearchPageResultParent() { super("oneOf", Boolean.FALSE); } public V1SearchPageResultParent(Object o) { super("oneOf", Boolean.FALSE); setActualInstance(o); } static { schemas.put("ParentSpaceId", ParentSpaceId.class); schemas.put("ParentDatabaseId", ParentDatabaseId.class); schemas.put("ParentPageId", ParentPageId.class); schemas.put("ParentBlockId", ParentBlockId.class); } @Override public Map<String, Class<?>> getSchemas() { return V1SearchPageResultParent.schemas; } /** * Set the instance that matches the oneOf child schema, check * the instance parameter is valid against the oneOf child schemas: * ParentBlockId, ParentDatabaseId, ParentPageId, ParentSpaceId * * It could be an instance of the 'oneOf' schemas. */ @Override public void setActualInstance(Object instance) { if (instance instanceof ParentSpaceId) { super.setActualInstance(instance); return; } if (instance instanceof ParentDatabaseId) { super.setActualInstance(instance); return; } if (instance instanceof ParentPageId) { super.setActualInstance(instance); return; } if (instance instanceof ParentBlockId) { super.setActualInstance(instance); return; } throw new RuntimeException("Invalid instance type. Must be ParentBlockId, ParentDatabaseId, ParentPageId, ParentSpaceId"); } /** * Get the actual instance, which can be the following: * ParentBlockId, ParentDatabaseId, ParentPageId, ParentSpaceId * * @return The actual instance (ParentBlockId, ParentDatabaseId, ParentPageId, ParentSpaceId) */ @SuppressWarnings("unchecked") @Override public Object getActualInstance() { return super.getActualInstance(); } /** * Get the actual instance of `ParentSpaceId`. If the actual instance is not `ParentSpaceId`, * the ClassCastException will be thrown. * * @return The actual instance of `ParentSpaceId` * @throws ClassCastException if the instance is not `ParentSpaceId` */ public ParentSpaceId getParentSpaceId() throws ClassCastException { return (ParentSpaceId)super.getActualInstance(); } /** * Get the actual instance of `ParentDatabaseId`. If the actual instance is not `ParentDatabaseId`, * the ClassCastException will be thrown. * * @return The actual instance of `ParentDatabaseId` * @throws ClassCastException if the instance is not `ParentDatabaseId` */ public ParentDatabaseId getParentDatabaseId() throws ClassCastException { return (ParentDatabaseId)super.getActualInstance(); } /** * Get the actual instance of `ParentPageId`. If the actual instance is not `ParentPageId`, * the ClassCastException will be thrown. * * @return The actual instance of `ParentPageId` * @throws ClassCastException if the instance is not `ParentPageId` */ public ParentPageId getParentPageId() throws ClassCastException { return (ParentPageId)super.getActualInstance(); } /** * Get the actual instance of `ParentBlockId`. If the actual instance is not `ParentBlockId`, * the ClassCastException will be thrown. * * @return The actual instance of `ParentBlockId` * @throws ClassCastException if the instance is not `ParentBlockId` */ public ParentBlockId getParentBlockId() throws ClassCastException { return (ParentBlockId)super.getActualInstance(); } /** * Validates the JSON Element and throws an exception if issues found * * @param jsonElement JSON Element * @throws IOException if the JSON Element is invalid with respect to V1SearchPageResultParent */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { // validate oneOf schemas one by one int validCount = 0; ArrayList<String> errorMessages = new ArrayList<>(); // validate the json string with ParentSpaceId try { ParentSpaceId.validateJsonElement(jsonElement); validCount++; } catch (Exception e) { errorMessages.add(String.format("Deserialization for ParentSpaceId failed with `%s`.", e.getMessage())); // continue to the next one } // validate the json string with ParentDatabaseId try { ParentDatabaseId.validateJsonElement(jsonElement); validCount++; } catch (Exception e) { errorMessages.add(String.format("Deserialization for ParentDatabaseId failed with `%s`.", e.getMessage())); // continue to the next one } // validate the json string with ParentPageId try { ParentPageId.validateJsonElement(jsonElement); validCount++; } catch (Exception e) { errorMessages.add(String.format("Deserialization for ParentPageId failed with `%s`.", e.getMessage())); // continue to the next one } // validate the json string with ParentBlockId try { ParentBlockId.validateJsonElement(jsonElement); validCount++; } catch (Exception e) { errorMessages.add(String.format("Deserialization for ParentBlockId failed with `%s`.", e.getMessage())); // continue to the next one } if (validCount != 1) { throw new IOException(String.format("The JSON string is invalid for V1SearchPageResultParent with oneOf schemas: ParentBlockId, ParentDatabaseId, ParentPageId, ParentSpaceId. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonElement.toString())); } } /** * Create an instance of V1SearchPageResultParent given an JSON string * * @param jsonString JSON string * @return An instance of V1SearchPageResultParent * @throws IOException if the JSON string is invalid with respect to V1SearchPageResultParent */ public static V1SearchPageResultParent fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, V1SearchPageResultParent.class); } /** * Convert an instance of V1SearchPageResultParent to an JSON string * * @return JSON string */ public String toJson() { return JSON.getGson().toJson(this); } }
0
java-sources/ai/buildin/buildin-api-client/1.0.4/org/openapitools/client
java-sources/ai/buildin/buildin-api-client/1.0.4/org/openapitools/client/model/V1SearchPageResultProperties.java
/* * Buildin API * Buildin Developer API * * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ package org.openapitools.client.model; import java.util.Objects; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; import org.openapitools.client.model.V1SearchPageResultPropertiesTitle; import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.google.gson.JsonArray; import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; import com.google.gson.JsonObject; import com.google.gson.JsonParseException; import com.google.gson.TypeAdapterFactory; import com.google.gson.reflect.TypeToken; import com.google.gson.TypeAdapter; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Set; import org.openapitools.client.JSON; /** * 页面属性 */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.14.0") public class V1SearchPageResultProperties { public static final String SERIALIZED_NAME_TITLE = "title"; @SerializedName(SERIALIZED_NAME_TITLE) @javax.annotation.Nullable private V1SearchPageResultPropertiesTitle title; public V1SearchPageResultProperties() { } public V1SearchPageResultProperties title(@javax.annotation.Nullable V1SearchPageResultPropertiesTitle title) { this.title = title; return this; } /** * Get title * @return title */ @javax.annotation.Nullable public V1SearchPageResultPropertiesTitle getTitle() { return title; } public void setTitle(@javax.annotation.Nullable V1SearchPageResultPropertiesTitle title) { this.title = title; } @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } V1SearchPageResultProperties v1SearchPageResultProperties = (V1SearchPageResultProperties) o; return Objects.equals(this.title, v1SearchPageResultProperties.title); } @Override public int hashCode() { return Objects.hash(title); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class V1SearchPageResultProperties {\n"); sb.append(" title: ").append(toIndentedString(title)).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 String toIndentedString(Object o) { if (o == null) { return "null"; } return o.toString().replace("\n", "\n "); } public static HashSet<String> openapiFields; public static HashSet<String> openapiRequiredFields; static { // a set of all properties/fields (JSON key names) openapiFields = new HashSet<String>(Arrays.asList("title")); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet<String>(0); } /** * Validates the JSON Element and throws an exception if issues found * * @param jsonElement JSON Element * @throws IOException if the JSON Element is invalid with respect to V1SearchPageResultProperties */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!V1SearchPageResultProperties.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in V1SearchPageResultProperties is not found in the empty JSON string", V1SearchPageResultProperties.openapiRequiredFields.toString())); } } Set<Map.Entry<String, JsonElement>> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields for (Map.Entry<String, JsonElement> entry : entries) { if (!V1SearchPageResultProperties.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1SearchPageResultProperties` properties. JSON: %s", entry.getKey(), jsonElement.toString())); } } JsonObject jsonObj = jsonElement.getAsJsonObject(); // validate the optional field `title` if (jsonObj.get("title") != null && !jsonObj.get("title").isJsonNull()) { V1SearchPageResultPropertiesTitle.validateJsonElement(jsonObj.get("title")); } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { if (!V1SearchPageResultProperties.class.isAssignableFrom(type.getRawType())) { return null; // this class only serializes 'V1SearchPageResultProperties' and its subtypes } final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); final TypeAdapter<V1SearchPageResultProperties> thisAdapter = gson.getDelegateAdapter(this, TypeToken.get(V1SearchPageResultProperties.class)); return (TypeAdapter<T>) new TypeAdapter<V1SearchPageResultProperties>() { @Override public void write(JsonWriter out, V1SearchPageResultProperties value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); elementAdapter.write(out, obj); } @Override public V1SearchPageResultProperties read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } /** * Create an instance of V1SearchPageResultProperties given an JSON string * * @param jsonString JSON string * @return An instance of V1SearchPageResultProperties * @throws IOException if the JSON string is invalid with respect to V1SearchPageResultProperties */ public static V1SearchPageResultProperties fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, V1SearchPageResultProperties.class); } /** * Convert an instance of V1SearchPageResultProperties to an JSON string * * @return JSON string */ public String toJson() { return JSON.getGson().toJson(this); } }
0
java-sources/ai/buildin/buildin-api-client/1.0.4/org/openapitools/client
java-sources/ai/buildin/buildin-api-client/1.0.4/org/openapitools/client/model/V1SearchPageResultPropertiesTitle.java
/* * Buildin API * Buildin Developer API * * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ package org.openapitools.client.model; import java.util.Objects; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.ArrayList; import java.util.Arrays; import java.util.List; import org.openapitools.client.model.RichTextItem; import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.google.gson.JsonArray; import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; import com.google.gson.JsonObject; import com.google.gson.JsonParseException; import com.google.gson.TypeAdapterFactory; import com.google.gson.reflect.TypeToken; import com.google.gson.TypeAdapter; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Set; import org.openapitools.client.JSON; /** * V1SearchPageResultPropertiesTitle */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.14.0") public class V1SearchPageResultPropertiesTitle { /** * Gets or Sets type */ @JsonAdapter(TypeEnum.Adapter.class) public enum TypeEnum { TITLE("title"); private String value; TypeEnum(String value) { this.value = value; } public String getValue() { return value; } @Override public String toString() { return String.valueOf(value); } public static TypeEnum fromValue(String value) { for (TypeEnum b : TypeEnum.values()) { if (b.value.equals(value)) { return b; } } throw new IllegalArgumentException("Unexpected value '" + value + "'"); } public static class Adapter extends TypeAdapter<TypeEnum> { @Override public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) throws IOException { jsonWriter.value(enumeration.getValue()); } @Override public TypeEnum read(final JsonReader jsonReader) throws IOException { String value = jsonReader.nextString(); return TypeEnum.fromValue(value); } } public static void validateJsonElement(JsonElement jsonElement) throws IOException { String value = jsonElement.getAsString(); TypeEnum.fromValue(value); } } public static final String SERIALIZED_NAME_TYPE = "type"; @SerializedName(SERIALIZED_NAME_TYPE) @javax.annotation.Nullable private TypeEnum type; public static final String SERIALIZED_NAME_TITLE = "title"; @SerializedName(SERIALIZED_NAME_TITLE) @javax.annotation.Nullable private List<RichTextItem> title = new ArrayList<>(); public V1SearchPageResultPropertiesTitle() { } public V1SearchPageResultPropertiesTitle type(@javax.annotation.Nullable TypeEnum type) { this.type = type; return this; } /** * Get type * @return type */ @javax.annotation.Nullable public TypeEnum getType() { return type; } public void setType(@javax.annotation.Nullable TypeEnum type) { this.type = type; } public V1SearchPageResultPropertiesTitle title(@javax.annotation.Nullable List<RichTextItem> title) { this.title = title; return this; } public V1SearchPageResultPropertiesTitle addTitleItem(RichTextItem titleItem) { if (this.title == null) { this.title = new ArrayList<>(); } this.title.add(titleItem); return this; } /** * Get title * @return title */ @javax.annotation.Nullable public List<RichTextItem> getTitle() { return title; } public void setTitle(@javax.annotation.Nullable List<RichTextItem> title) { this.title = title; } @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } V1SearchPageResultPropertiesTitle v1SearchPageResultPropertiesTitle = (V1SearchPageResultPropertiesTitle) o; return Objects.equals(this.type, v1SearchPageResultPropertiesTitle.type) && Objects.equals(this.title, v1SearchPageResultPropertiesTitle.title); } @Override public int hashCode() { return Objects.hash(type, title); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class V1SearchPageResultPropertiesTitle {\n"); sb.append(" type: ").append(toIndentedString(type)).append("\n"); sb.append(" title: ").append(toIndentedString(title)).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 String toIndentedString(Object o) { if (o == null) { return "null"; } return o.toString().replace("\n", "\n "); } public static HashSet<String> openapiFields; public static HashSet<String> openapiRequiredFields; static { // a set of all properties/fields (JSON key names) openapiFields = new HashSet<String>(Arrays.asList("type", "title")); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet<String>(0); } /** * Validates the JSON Element and throws an exception if issues found * * @param jsonElement JSON Element * @throws IOException if the JSON Element is invalid with respect to V1SearchPageResultPropertiesTitle */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!V1SearchPageResultPropertiesTitle.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in V1SearchPageResultPropertiesTitle is not found in the empty JSON string", V1SearchPageResultPropertiesTitle.openapiRequiredFields.toString())); } } Set<Map.Entry<String, JsonElement>> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields for (Map.Entry<String, JsonElement> entry : entries) { if (!V1SearchPageResultPropertiesTitle.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1SearchPageResultPropertiesTitle` properties. JSON: %s", entry.getKey(), jsonElement.toString())); } } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("type") != null && !jsonObj.get("type").isJsonNull()) && !jsonObj.get("type").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); } // validate the optional field `type` if (jsonObj.get("type") != null && !jsonObj.get("type").isJsonNull()) { TypeEnum.validateJsonElement(jsonObj.get("type")); } if (jsonObj.get("title") != null && !jsonObj.get("title").isJsonNull()) { JsonArray jsonArraytitle = jsonObj.getAsJsonArray("title"); if (jsonArraytitle != null) { // ensure the json data is an array if (!jsonObj.get("title").isJsonArray()) { throw new IllegalArgumentException(String.format("Expected the field `title` to be an array in the JSON string but got `%s`", jsonObj.get("title").toString())); } // validate the optional field `title` (array) for (int i = 0; i < jsonArraytitle.size(); i++) { RichTextItem.validateJsonElement(jsonArraytitle.get(i)); }; } } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { if (!V1SearchPageResultPropertiesTitle.class.isAssignableFrom(type.getRawType())) { return null; // this class only serializes 'V1SearchPageResultPropertiesTitle' and its subtypes } final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); final TypeAdapter<V1SearchPageResultPropertiesTitle> thisAdapter = gson.getDelegateAdapter(this, TypeToken.get(V1SearchPageResultPropertiesTitle.class)); return (TypeAdapter<T>) new TypeAdapter<V1SearchPageResultPropertiesTitle>() { @Override public void write(JsonWriter out, V1SearchPageResultPropertiesTitle value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); elementAdapter.write(out, obj); } @Override public V1SearchPageResultPropertiesTitle read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } /** * Create an instance of V1SearchPageResultPropertiesTitle given an JSON string * * @param jsonString JSON string * @return An instance of V1SearchPageResultPropertiesTitle * @throws IOException if the JSON string is invalid with respect to V1SearchPageResultPropertiesTitle */ public static V1SearchPageResultPropertiesTitle fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, V1SearchPageResultPropertiesTitle.class); } /** * Convert an instance of V1SearchPageResultPropertiesTitle to an JSON string * * @return JSON string */ public String toJson() { return JSON.getGson().toJson(this); } }
0
java-sources/ai/buildin/buildin-api-client/1.0.4/org/openapitools/client
java-sources/ai/buildin/buildin-api-client/1.0.4/org/openapitools/client/model/V1SearchRequest.java
/* * Buildin API * Buildin Developer API * * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ package org.openapitools.client.model; import java.util.Objects; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.google.gson.JsonArray; import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; import com.google.gson.JsonObject; import com.google.gson.JsonParseException; import com.google.gson.TypeAdapterFactory; import com.google.gson.reflect.TypeToken; import com.google.gson.TypeAdapter; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Set; import org.openapitools.client.JSON; /** * V1SearchRequest */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.14.0") public class V1SearchRequest { public static final String SERIALIZED_NAME_QUERY = "query"; @SerializedName(SERIALIZED_NAME_QUERY) @javax.annotation.Nullable private String query = ""; public static final String SERIALIZED_NAME_START_CURSOR = "start_cursor"; @SerializedName(SERIALIZED_NAME_START_CURSOR) @javax.annotation.Nullable private String startCursor; public static final String SERIALIZED_NAME_PAGE_SIZE = "page_size"; @SerializedName(SERIALIZED_NAME_PAGE_SIZE) @javax.annotation.Nullable private Integer pageSize = 10; public V1SearchRequest() { } public V1SearchRequest query(@javax.annotation.Nullable String query) { this.query = query; return this; } /** * 搜索关键词 * @return query */ @javax.annotation.Nullable public String getQuery() { return query; } public void setQuery(@javax.annotation.Nullable String query) { this.query = query; } public V1SearchRequest startCursor(@javax.annotation.Nullable String startCursor) { this.startCursor = startCursor; return this; } /** * 分页游标,用于获取下一页结果 * @return startCursor */ @javax.annotation.Nullable public String getStartCursor() { return startCursor; } public void setStartCursor(@javax.annotation.Nullable String startCursor) { this.startCursor = startCursor; } public V1SearchRequest pageSize(@javax.annotation.Nullable Integer pageSize) { this.pageSize = pageSize; return this; } /** * 每页返回的结果数量 * minimum: 1 * maximum: 100 * @return pageSize */ @javax.annotation.Nullable public Integer getPageSize() { return pageSize; } public void setPageSize(@javax.annotation.Nullable Integer pageSize) { this.pageSize = pageSize; } @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } V1SearchRequest v1SearchRequest = (V1SearchRequest) o; return Objects.equals(this.query, v1SearchRequest.query) && Objects.equals(this.startCursor, v1SearchRequest.startCursor) && Objects.equals(this.pageSize, v1SearchRequest.pageSize); } @Override public int hashCode() { return Objects.hash(query, startCursor, pageSize); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class V1SearchRequest {\n"); sb.append(" query: ").append(toIndentedString(query)).append("\n"); sb.append(" startCursor: ").append(toIndentedString(startCursor)).append("\n"); sb.append(" pageSize: ").append(toIndentedString(pageSize)).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 String toIndentedString(Object o) { if (o == null) { return "null"; } return o.toString().replace("\n", "\n "); } public static HashSet<String> openapiFields; public static HashSet<String> openapiRequiredFields; static { // a set of all properties/fields (JSON key names) openapiFields = new HashSet<String>(Arrays.asList("query", "start_cursor", "page_size")); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet<String>(0); } /** * Validates the JSON Element and throws an exception if issues found * * @param jsonElement JSON Element * @throws IOException if the JSON Element is invalid with respect to V1SearchRequest */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!V1SearchRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in V1SearchRequest is not found in the empty JSON string", V1SearchRequest.openapiRequiredFields.toString())); } } Set<Map.Entry<String, JsonElement>> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields for (Map.Entry<String, JsonElement> entry : entries) { if (!V1SearchRequest.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1SearchRequest` properties. JSON: %s", entry.getKey(), jsonElement.toString())); } } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("query") != null && !jsonObj.get("query").isJsonNull()) && !jsonObj.get("query").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `query` to be a primitive type in the JSON string but got `%s`", jsonObj.get("query").toString())); } if ((jsonObj.get("start_cursor") != null && !jsonObj.get("start_cursor").isJsonNull()) && !jsonObj.get("start_cursor").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `start_cursor` to be a primitive type in the JSON string but got `%s`", jsonObj.get("start_cursor").toString())); } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { if (!V1SearchRequest.class.isAssignableFrom(type.getRawType())) { return null; // this class only serializes 'V1SearchRequest' and its subtypes } final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); final TypeAdapter<V1SearchRequest> thisAdapter = gson.getDelegateAdapter(this, TypeToken.get(V1SearchRequest.class)); return (TypeAdapter<T>) new TypeAdapter<V1SearchRequest>() { @Override public void write(JsonWriter out, V1SearchRequest value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); elementAdapter.write(out, obj); } @Override public V1SearchRequest read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } /** * Create an instance of V1SearchRequest given an JSON string * * @param jsonString JSON string * @return An instance of V1SearchRequest * @throws IOException if the JSON string is invalid with respect to V1SearchRequest */ public static V1SearchRequest fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, V1SearchRequest.class); } /** * Convert an instance of V1SearchRequest to an JSON string * * @return JSON string */ public String toJson() { return JSON.getGson().toJson(this); } }
0
java-sources/ai/buildin/buildin-api-client/1.0.4/org/openapitools/client
java-sources/ai/buildin/buildin-api-client/1.0.4/org/openapitools/client/model/V1SearchResponse.java
/* * Buildin API * Buildin Developer API * * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ package org.openapitools.client.model; import java.util.Objects; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.ArrayList; import java.util.Arrays; import java.util.List; import org.openapitools.client.model.V1SearchPageResult; import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.google.gson.JsonArray; import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; import com.google.gson.JsonObject; import com.google.gson.JsonParseException; import com.google.gson.TypeAdapterFactory; import com.google.gson.reflect.TypeToken; import com.google.gson.TypeAdapter; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Set; import org.openapitools.client.JSON; /** * V1SearchResponse */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.14.0") public class V1SearchResponse { /** * Gets or Sets _object */ @JsonAdapter(ObjectEnum.Adapter.class) public enum ObjectEnum { LIST("list"); private String value; ObjectEnum(String value) { this.value = value; } public String getValue() { return value; } @Override public String toString() { return String.valueOf(value); } public static ObjectEnum fromValue(String value) { for (ObjectEnum b : ObjectEnum.values()) { if (b.value.equals(value)) { return b; } } throw new IllegalArgumentException("Unexpected value '" + value + "'"); } public static class Adapter extends TypeAdapter<ObjectEnum> { @Override public void write(final JsonWriter jsonWriter, final ObjectEnum enumeration) throws IOException { jsonWriter.value(enumeration.getValue()); } @Override public ObjectEnum read(final JsonReader jsonReader) throws IOException { String value = jsonReader.nextString(); return ObjectEnum.fromValue(value); } } public static void validateJsonElement(JsonElement jsonElement) throws IOException { String value = jsonElement.getAsString(); ObjectEnum.fromValue(value); } } public static final String SERIALIZED_NAME_OBJECT = "object"; @SerializedName(SERIALIZED_NAME_OBJECT) @javax.annotation.Nullable private ObjectEnum _object; public static final String SERIALIZED_NAME_RESULTS = "results"; @SerializedName(SERIALIZED_NAME_RESULTS) @javax.annotation.Nullable private List<V1SearchPageResult> results = new ArrayList<>(); public static final String SERIALIZED_NAME_NEXT_CURSOR = "next_cursor"; @SerializedName(SERIALIZED_NAME_NEXT_CURSOR) @javax.annotation.Nullable private String nextCursor; public static final String SERIALIZED_NAME_HAS_MORE = "has_more"; @SerializedName(SERIALIZED_NAME_HAS_MORE) @javax.annotation.Nullable private Boolean hasMore; public V1SearchResponse() { } public V1SearchResponse _object(@javax.annotation.Nullable ObjectEnum _object) { this._object = _object; return this; } /** * Get _object * @return _object */ @javax.annotation.Nullable public ObjectEnum getObject() { return _object; } public void setObject(@javax.annotation.Nullable ObjectEnum _object) { this._object = _object; } public V1SearchResponse results(@javax.annotation.Nullable List<V1SearchPageResult> results) { this.results = results; return this; } public V1SearchResponse addResultsItem(V1SearchPageResult resultsItem) { if (this.results == null) { this.results = new ArrayList<>(); } this.results.add(resultsItem); return this; } /** * 搜索结果页面数组 * @return results */ @javax.annotation.Nullable public List<V1SearchPageResult> getResults() { return results; } public void setResults(@javax.annotation.Nullable List<V1SearchPageResult> results) { this.results = results; } public V1SearchResponse nextCursor(@javax.annotation.Nullable String nextCursor) { this.nextCursor = nextCursor; return this; } /** * 下一页游标,为 null 表示没有更多结果 * @return nextCursor */ @javax.annotation.Nullable public String getNextCursor() { return nextCursor; } public void setNextCursor(@javax.annotation.Nullable String nextCursor) { this.nextCursor = nextCursor; } public V1SearchResponse hasMore(@javax.annotation.Nullable Boolean hasMore) { this.hasMore = hasMore; return this; } /** * 是否还有更多结果 * @return hasMore */ @javax.annotation.Nullable public Boolean getHasMore() { return hasMore; } public void setHasMore(@javax.annotation.Nullable Boolean hasMore) { this.hasMore = hasMore; } @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } V1SearchResponse v1SearchResponse = (V1SearchResponse) o; return Objects.equals(this._object, v1SearchResponse._object) && Objects.equals(this.results, v1SearchResponse.results) && Objects.equals(this.nextCursor, v1SearchResponse.nextCursor) && Objects.equals(this.hasMore, v1SearchResponse.hasMore); } @Override public int hashCode() { return Objects.hash(_object, results, nextCursor, hasMore); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class V1SearchResponse {\n"); sb.append(" _object: ").append(toIndentedString(_object)).append("\n"); sb.append(" results: ").append(toIndentedString(results)).append("\n"); sb.append(" nextCursor: ").append(toIndentedString(nextCursor)).append("\n"); sb.append(" hasMore: ").append(toIndentedString(hasMore)).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 String toIndentedString(Object o) { if (o == null) { return "null"; } return o.toString().replace("\n", "\n "); } public static HashSet<String> openapiFields; public static HashSet<String> openapiRequiredFields; static { // a set of all properties/fields (JSON key names) openapiFields = new HashSet<String>(Arrays.asList("object", "results", "next_cursor", "has_more")); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet<String>(0); } /** * Validates the JSON Element and throws an exception if issues found * * @param jsonElement JSON Element * @throws IOException if the JSON Element is invalid with respect to V1SearchResponse */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!V1SearchResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException(String.format("The required field(s) %s in V1SearchResponse is not found in the empty JSON string", V1SearchResponse.openapiRequiredFields.toString())); } } Set<Map.Entry<String, JsonElement>> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields for (Map.Entry<String, JsonElement> entry : entries) { if (!V1SearchResponse.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `V1SearchResponse` properties. JSON: %s", entry.getKey(), jsonElement.toString())); } } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("object") != null && !jsonObj.get("object").isJsonNull()) && !jsonObj.get("object").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `object` to be a primitive type in the JSON string but got `%s`", jsonObj.get("object").toString())); } // validate the optional field `object` if (jsonObj.get("object") != null && !jsonObj.get("object").isJsonNull()) { ObjectEnum.validateJsonElement(jsonObj.get("object")); } if (jsonObj.get("results") != null && !jsonObj.get("results").isJsonNull()) { JsonArray jsonArrayresults = jsonObj.getAsJsonArray("results"); if (jsonArrayresults != null) { // ensure the json data is an array if (!jsonObj.get("results").isJsonArray()) { throw new IllegalArgumentException(String.format("Expected the field `results` to be an array in the JSON string but got `%s`", jsonObj.get("results").toString())); } // validate the optional field `results` (array) for (int i = 0; i < jsonArrayresults.size(); i++) { V1SearchPageResult.validateJsonElement(jsonArrayresults.get(i)); }; } } if ((jsonObj.get("next_cursor") != null && !jsonObj.get("next_cursor").isJsonNull()) && !jsonObj.get("next_cursor").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `next_cursor` to be a primitive type in the JSON string but got `%s`", jsonObj.get("next_cursor").toString())); } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { if (!V1SearchResponse.class.isAssignableFrom(type.getRawType())) { return null; // this class only serializes 'V1SearchResponse' and its subtypes } final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); final TypeAdapter<V1SearchResponse> thisAdapter = gson.getDelegateAdapter(this, TypeToken.get(V1SearchResponse.class)); return (TypeAdapter<T>) new TypeAdapter<V1SearchResponse>() { @Override public void write(JsonWriter out, V1SearchResponse value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); elementAdapter.write(out, obj); } @Override public V1SearchResponse read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } } /** * Create an instance of V1SearchResponse given an JSON string * * @param jsonString JSON string * @return An instance of V1SearchResponse * @throws IOException if the JSON string is invalid with respect to V1SearchResponse */ public static V1SearchResponse fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, V1SearchResponse.class); } /** * Convert an instance of V1SearchResponse to an JSON string * * @return JSON string */ public String toJson() { return JSON.getGson().toJson(this); } }
0
java-sources/ai/catboost/catboost-common/1.2.8/ai
java-sources/ai/catboost/catboost-common/1.2.8/ai/catboost/CatBoostError.java
package ai.catboost; public class CatBoostError extends Exception { public CatBoostError(String message) { super(message); } }
0
java-sources/ai/catboost/catboost-common/1.2.8/ai/catboost
java-sources/ai/catboost/catboost-common/1.2.8/ai/catboost/common/IteratorUtils.java
package ai.catboost.common; import java.util.Iterator; import java.util.function.BiPredicate; public class IteratorUtils { public static <T, S> boolean elementsEqual( Iterator<T> lhs, Iterator<S> rhs, BiPredicate<T, S> equalFunction ) { while (lhs.hasNext() && rhs.hasNext()) { if (!equalFunction.test(lhs.next(), rhs.next())) { return false; } } return !lhs.hasNext() && !rhs.hasNext(); } }
0
java-sources/ai/catboost/catboost-common/1.2.8/ai/catboost
java-sources/ai/catboost/catboost-common/1.2.8/ai/catboost/common/NativeLib.java
package ai.catboost.common; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import javax.validation.constraints.NotNull; import java.io.*; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; import java.util.stream.Stream; public class NativeLib { private static final Logger logger = LoggerFactory.getLogger(NativeLib.class); private static final String LOCK_EXT = ".lck"; /** * Load libName, first will try try to load libName from default location then will try to load library from JAR. * * @param libName * @throws IOException */ public static synchronized void smartLoad(final @NotNull String libName) throws IOException { cleanup(libName); try { loadNativeLibraryFromJar(libName); } catch (IOException ioe) { logger.error("failed to load native library from both default location and JAR"); throw ioe; } } @NotNull private static String[] getCurrentMachineResourcesDirs() { // Returns list of '<osName>-<osArch>' subdirs (like 'linux-aarch64', 'win32-x86_64') // On macOS this function returns paths for both arch-specific and universal binaries paths: // ('darwin-<osArch>', 'darwin-universal2'). String osArch = System.getProperty("os.arch").toLowerCase(); // Java is inconsistent with Python, and returns `amd64` on my dev machine, while Python `platform.machine()` // returns `x86_64`, so we'll have to fix this if (osArch.equals("amd64")) { osArch = "x86_64"; } String osName = System.getProperty("os.name").toLowerCase(); // Java doesn't seem to have analog for python's `sys.platform` or `platform.platform`, so we have to do it by // hand. if (osName.contains("mac")) { osName = "darwin"; // For macOS they are the same if (osArch.equals("aarch64")) { osArch = "arm64"; } return new String[] {osName + "-" + osArch, osName + "-universal2"}; } else { if (osName.contains("win")) { osName = "win32"; } return new String[] {osName + "-" + osArch}; } } private static void loadNativeLibraryFromJar(final @NotNull String libName) throws IOException { for (String machineResourcesDir : getCurrentMachineResourcesDirs()) { final String pathWithinJar = "/" + machineResourcesDir + "/lib/" + System.mapLibraryName(libName); if (NativeLib.class.getResource(pathWithinJar) != null) { final String tempLibPath = createTemporaryFileFromJar(pathWithinJar); System.load(tempLibPath); return; } } throw new IOException("Native library '" + libName + "' not found"); } private static void copyFileFromJar(final @NotNull String pathWithinJar, final @NotNull String pathOnDisk) throws IOException { byte[] copyBuffer = new byte[4 * 1024]; int bytesRead; try(OutputStream out = new BufferedOutputStream(new FileOutputStream(pathOnDisk)); InputStream in = NativeLib.class.getResourceAsStream(pathWithinJar)) { if (in == null) { throw new FileNotFoundException("File " + pathWithinJar + " was not found inside JAR."); } while ((bytesRead = in.read(copyBuffer)) != -1) { out.write(copyBuffer, 0, bytesRead); } } } @NotNull private static String createTemporaryFileFromJar(final @NotNull String pathWithinJar) throws IOException, IllegalArgumentException { if (!pathWithinJar.startsWith("/")) { throw new IllegalArgumentException("Path must be absolute (start with '/')"); } if (pathWithinJar.endsWith("/")) { throw new IllegalArgumentException("Must be a path to file not directory (ends with '/')"); } String[] parts = pathWithinJar.split("/"); final String filename = parts[parts.length - 1]; parts = filename.split("\\.", 2); final String prefix = parts[0] + "-"; final String suffix = parts.length > 1 ? "." + parts[parts.length - 1] : null; final File libOnDisk = File.createTempFile(prefix, suffix); libOnDisk.deleteOnExit(); final File libOnDiskLck = new File(libOnDisk.getAbsolutePath() + LOCK_EXT); libOnDiskLck.createNewFile(); libOnDiskLck.deleteOnExit(); copyFileFromJar(pathWithinJar, libOnDisk.getPath()); return libOnDisk.getAbsolutePath(); } /** * Delete old native libraries */ private static void cleanup(final @NotNull String libName) { final String searchPattern = libName + "-"; try (Stream<Path> dirList = Files.list(new File(System.getProperty("java.io.tmpdir")).toPath())) { dirList.filter( path -> !path.getFileName().toString().endsWith(LOCK_EXT) && path.getFileName() .toString() .startsWith(searchPattern)) .forEach( nativeLib -> { Path lckFile = Paths.get(nativeLib + LOCK_EXT); if (Files.notExists(lckFile)) { try { Files.delete(nativeLib); } catch (Exception e) { logger.error("Failed to delete old native lib", e); } } }); } catch (IOException e) { logger.error("Failed to open directory", e); } } }
0
java-sources/ai/catboost/catboost-prediction/1.2.8/ai
java-sources/ai/catboost/catboost-prediction/1.2.8/ai/catboost/CatBoostJNI.java
package ai.catboost; import javax.annotation.Nullable; import javax.validation.constraints.NotNull; class CatBoostJNI { final void catBoostHashCatFeature( final @NotNull String catFeature, final @NotNull int[] hash) throws CatBoostError { CatBoostJNIImpl.checkCall(CatBoostJNIImpl.catBoostHashCatFeature(catFeature, hash)); } final void catBoostHashCatFeatures( final @NotNull String[] catFeatures, final @NotNull int[] hashes) throws CatBoostError { CatBoostJNIImpl.checkCall(CatBoostJNIImpl.catBoostHashCatFeatures(catFeatures, hashes)); } final void catBoostLoadModelFromFile( final @NotNull String fname, final @NotNull long[] handle, final @Nullable String formatName) throws CatBoostError { CatBoostJNIImpl.checkCall(CatBoostJNIImpl.catBoostLoadModelFromFile(fname, handle, formatName)); } final void catBoostLoadModelFromArray( final @NotNull byte[] data, final @NotNull long[] handle, final @Nullable String formatName) throws CatBoostError { CatBoostJNIImpl.checkCall(CatBoostJNIImpl.catBoostLoadModelFromArray(data, handle, formatName)); } final void catBoostFreeModel(final long handle) throws CatBoostError { CatBoostJNIImpl.checkCall(CatBoostJNIImpl.catBoostFreeModel(handle)); } final void catBoostModelGetSupportedEvaluatorTypes( final long handle, final @NotNull String[][] evaluatorTypes) throws CatBoostError { CatBoostJNIImpl.checkCall(CatBoostJNIImpl.catBoostModelGetSupportedEvaluatorTypes(handle, evaluatorTypes)); } final void catBoostModelSetEvaluatorType( final long handle, final @NotNull String evaluatorType) throws CatBoostError { CatBoostJNIImpl.checkCall(CatBoostJNIImpl.catBoostModelSetEvaluatorType(handle, evaluatorType)); } final void catBoostModelGetEvaluatorType( final long handle, final @NotNull String[] evaluatorType) throws CatBoostError { CatBoostJNIImpl.checkCall(CatBoostJNIImpl.catBoostModelGetEvaluatorType(handle, evaluatorType)); } final void catBoostModelGetPredictionDimension( final long handle, final @NotNull int[] classesCount) throws CatBoostError { CatBoostJNIImpl.checkCall(CatBoostJNIImpl.catBoostModelGetPredictionDimension(handle, classesCount)); } final void catBoostModelGetUsedNumericFeatureCount( final long handle, final @NotNull int[] numericFeatureCount) throws CatBoostError { CatBoostJNIImpl.checkCall(CatBoostJNIImpl.catBoostModelGetUsedNumericFeatureCount(handle, numericFeatureCount)); } final void catBoostModelGetUsedCategoricalFeatureCount( final long handle, final @NotNull int[] catFeatureCount) throws CatBoostError { CatBoostJNIImpl.checkCall(CatBoostJNIImpl.catBoostModelGetUsedCategoricalFeatureCount(handle, catFeatureCount)); } final void catBoostModelGetUsedTextFeatureCount( final long handle, final @NotNull int[] textFeatureCount) throws CatBoostError { CatBoostJNIImpl.checkCall(CatBoostJNIImpl.catBoostModelGetUsedTextFeatureCount(handle, textFeatureCount)); } final void catBoostModelGetUsedEmbeddingFeatureCount( final long handle, final @NotNull int[] embeddingFeatureCount) throws CatBoostError { CatBoostJNIImpl.checkCall(CatBoostJNIImpl.catBoostModelGetUsedEmbeddingFeatureCount(handle, embeddingFeatureCount)); } final void catBoostModelGetFlatFeatureVectorExpectedSize( final long handle, final @NotNull int[] featureVectorExpectedSize) throws CatBoostError { CatBoostJNIImpl.checkCall(CatBoostJNIImpl.catBoostModelGetFlatFeatureVectorExpectedSize(handle, featureVectorExpectedSize)); } final void catBoostModelGetMetadata( final long handle, final @NotNull String[][] keys, final @NotNull String[][] values) throws CatBoostError { CatBoostJNIImpl.checkCall(CatBoostJNIImpl.catBoostModelGetMetadata(handle, keys, values)); } final void catBoostModelGetFloatFeatures( final long handle, final @NotNull String[][] names, final @NotNull int[][] flat_feature_index, final @NotNull int[][] feature_index, final @NotNull int[][] has_nans, final @NotNull String[][] nan_value_treatment) throws CatBoostError { CatBoostJNIImpl.checkCall(CatBoostJNIImpl.catBoostModelGetFloatFeatures(handle, names, flat_feature_index, feature_index, has_nans, nan_value_treatment)); } final void catBoostModelGetCatFeatures( final long handle, final @NotNull String[][] names, final @NotNull int[][] flat_feature_index, final @NotNull int[][] feature_index) throws CatBoostError { CatBoostJNIImpl.checkCall(CatBoostJNIImpl.catBoostModelGetCatFeatures(handle, names, flat_feature_index, feature_index)); } final void catBoostModelGetTextFeatures( final long handle, final @NotNull String[][] names, final @NotNull int[][] flat_feature_index, final @NotNull int[][] feature_index) throws CatBoostError { CatBoostJNIImpl.checkCall(CatBoostJNIImpl.catBoostModelGetTextFeatures(handle, names, flat_feature_index, feature_index)); } final void catBoostModelGetEmbeddingFeatures( final long handle, final @NotNull String[][] names, final @NotNull int[][] flat_feature_index, final @NotNull int[][] feature_index) throws CatBoostError { CatBoostJNIImpl.checkCall(CatBoostJNIImpl.catBoostModelGetEmbeddingFeatures(handle, names, flat_feature_index, feature_index)); } final void catBoostModelGetUsedFeatureIndices( final long handle, final @NotNull int[][] featureIndices) throws CatBoostError { CatBoostJNIImpl.checkCall(CatBoostJNIImpl.catBoostModelGetUsedFeatureIndices(handle, featureIndices)); } final void catBoostModelGetTreeCount( final long handle, final @NotNull int[] treeCount) throws CatBoostError { CatBoostJNIImpl.checkCall(CatBoostJNIImpl.catBoostModelGetTreeCount(handle, treeCount)); } final void catBoostModelPredict( final long handle, final @Nullable float[] numericFeatures, final @Nullable String[] catFeatures, final @Nullable String[] textFeatures, final @Nullable float[][] embeddingFeatures, final @NotNull double[] predictions) throws CatBoostError { CatBoostJNIImpl.checkCall(CatBoostJNIImpl.catBoostModelPredict(handle, numericFeatures, catFeatures, textFeatures, embeddingFeatures, predictions)); } final void catBoostModelPredict( final long handle, final @Nullable float[] numericFeatures, final @Nullable int[] catFeatureHashes, final @Nullable String[] textFeatures, final @Nullable float[][] embeddingFeatures, final @NotNull double[] predictions) throws CatBoostError { CatBoostJNIImpl.checkCall(CatBoostJNIImpl.catBoostModelPredict(handle, numericFeatures, catFeatureHashes, textFeatures, embeddingFeatures, predictions)); } final void catBoostModelPredict( final long handle, final @Nullable float[][] numericFeatures, final @Nullable String[][] catFeatures, final @Nullable String[][] textFeatures, final @Nullable float[][][] embeddingFeatures, final @NotNull double[] predictions) throws CatBoostError { CatBoostJNIImpl.checkCall(CatBoostJNIImpl.catBoostModelPredict(handle, numericFeatures, catFeatures, textFeatures, embeddingFeatures, predictions)); } final void catBoostModelPredict( final long handle, final @Nullable float[][] numericFeatures, final @Nullable int[][] catFeatureHashes, final @Nullable String[][] textFeatures, final @Nullable float[][][] embeddingFeatures, final @NotNull double[] predictions) throws CatBoostError { CatBoostJNIImpl.checkCall(CatBoostJNIImpl.catBoostModelPredict(handle, numericFeatures, catFeatureHashes, textFeatures, embeddingFeatures, predictions)); } }
0
java-sources/ai/catboost/catboost-prediction/1.2.8/ai
java-sources/ai/catboost/catboost-prediction/1.2.8/ai/catboost/CatBoostJNIImpl.java
package ai.catboost; import javax.annotation.Nullable; import javax.validation.constraints.NotNull; class CatBoostJNIImpl { final static void checkCall(@Nullable String message) throws CatBoostError { if (message != null) { throw new CatBoostError(message); } } @Nullable final static native String catBoostHashCatFeature( @NotNull String catFeature, @NotNull int[] hash); @Nullable final static native String catBoostHashCatFeatures( @NotNull String[] catFeatures, @NotNull int[] hashes); @Nullable final static native String catBoostLoadModelFromFile( @NotNull String fname, @NotNull long[] handle, @Nullable String formatName); @Nullable final static native String catBoostLoadModelFromArray( @NotNull byte[] data, @NotNull long[] handle, @Nullable String formatName); @Nullable final static native String catBoostFreeModel(long handle); @Nullable final static native String catBoostModelGetSupportedEvaluatorTypes( long handle, @NotNull String[][] evaluatorTypes); @Nullable final static native String catBoostModelSetEvaluatorType( long handle, @NotNull String evaluatorType); @Nullable final static native String catBoostModelGetEvaluatorType( long handle, @NotNull String[] evaluatorType); @Nullable final static native String catBoostModelGetPredictionDimension( long handle, @NotNull int[] classesCount); @Nullable final static native String catBoostModelGetUsedNumericFeatureCount( long handle, @NotNull int[] numericFeatureCount); @Nullable final static native String catBoostModelGetUsedCategoricalFeatureCount( long handle, @NotNull int[] catFeatureCount); @Nullable final static native String catBoostModelGetUsedTextFeatureCount( long handle, @NotNull int[] textFeatureCount); @Nullable final static native String catBoostModelGetUsedEmbeddingFeatureCount( long handle, @NotNull int[] embeddingFeatureCount); @Nullable final static native String catBoostModelGetFlatFeatureVectorExpectedSize( long handle, @NotNull int[] featureVectorExpectedSize); @Nullable final static native String catBoostModelGetMetadata( long handle, @NotNull String[][] keys, @NotNull String[][] values); @Nullable final static native String catBoostModelGetFloatFeatures( long handle, @NotNull String[][] names, @NotNull int[][] flat_feature_index, @NotNull int[][] feature_index, @NotNull int[][] has_nans, @NotNull String[][] nan_value_treatment); @Nullable final static native String catBoostModelGetCatFeatures( long handle, @NotNull String[][] names, @NotNull int[][] flat_feature_index, @NotNull int[][] feature_index); @Nullable final static native String catBoostModelGetTextFeatures( long handle, @NotNull String[][] names, @NotNull int[][] flat_feature_index, @NotNull int[][] feature_index); @Nullable final static native String catBoostModelGetEmbeddingFeatures( long handle, @NotNull String[][] names, @NotNull int[][] flat_feature_index, @NotNull int[][] feature_index); @Nullable final static native String catBoostModelGetUsedFeatureIndices( long handle, @NotNull int[][] featureIndices); @Nullable final static native String catBoostModelGetTreeCount( long handle, @NotNull int[] treeCount); @Nullable final static native String catBoostModelPredict( long handle, @Nullable float[] numericFeatures, @Nullable String[] catFeatures, @Nullable String[] textFeatures, @Nullable float[][] embeddingFeatures, @NotNull double[] predictions); @Nullable final static native String catBoostModelPredict( long handle, @Nullable float[] numericFeatures, @Nullable int[] catFeatureHashes, @Nullable String[] textFeatures, @Nullable float[][] embeddingFeatures, @NotNull double[] predictions); @Nullable final static native String catBoostModelPredict( long handle, @Nullable float[][] numericFeatures, @Nullable String[][] catFeatures, @Nullable String[][] textFeatures, @Nullable float[][][] embeddingFeatures, @NotNull double[] predictions); @Nullable final static native String catBoostModelPredict( long handle, @Nullable float[][] numericFeatures, @Nullable int[][] catFeatureHashes, @Nullable String[][] textFeatures, @Nullable float[][][] embeddingFeatures, @NotNull double[] predictions); }
0
java-sources/ai/catboost/catboost-prediction/1.2.8/ai
java-sources/ai/catboost/catboost-prediction/1.2.8/ai/catboost/CatBoostModel.java
package ai.catboost; import javax.annotation.Nullable; import javax.validation.constraints.NotNull; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.InputStream; import java.util.ArrayList; import java.util.Collections; import java.util.Comparator; import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.HashMap; import ai.catboost.common.NativeLib; /** * CatBoost model, supports basic model application. */ public class CatBoostModel implements AutoCloseable { // handle to native C++ model private long handle = 0; private int predictionDimension = 0; private int treeCount = 0; private int usedNumericFeatureCount = 0; private int usedCategoricFeatureCount = 0; private int usedTextFeatureCount = 0; private int usedEmbeddingFeatureCount = 0; private String[] featureNames; private Map<String, String> metadata = new HashMap<String, String>(); private List<Feature> features = new ArrayList<Feature>(); private static CatBoostJNI implLibrary = null; public enum FormulaEvaluatorType { CPU, GPU } public static abstract class Feature { private String name; private int featureIndex; private int flatFeatureIndex; private boolean usedInModel; protected Feature(String name, int featureIndex, int flatFeatureIndex, boolean usedInModel) { this.name = name; this.featureIndex = featureIndex; this.flatFeatureIndex = flatFeatureIndex; this.usedInModel = usedInModel; } public String getName() { return name; } public int getFeatureIndex() { return featureIndex; } public int getFlatFeatureIndex() { return flatFeatureIndex; } public boolean isUsedInModel() { return usedInModel; } } public static final class TextFeature extends Feature { protected TextFeature(String name, int featureIndex, int flatFeatureIndex, boolean usedInModel) { super(name, featureIndex, flatFeatureIndex, usedInModel); } } public static final class FloatFeature extends Feature { public enum NanValueTreatment { AsIs, AsTrue, AsFalse, } private NanValueTreatment nanValueTreatment; private boolean hasNans; protected FloatFeature(String name, int featureIndex, int flatFeatureIndex, boolean usedInModel, int hasNans, String nanValueTreatment) { super(name, featureIndex, flatFeatureIndex, usedInModel); this.hasNans = hasNans > 0; this.nanValueTreatment = NanValueTreatment.valueOf(nanValueTreatment); } public boolean hasNans() { return hasNans; } public NanValueTreatment getNanValueTreatment() { return nanValueTreatment; } } public static final class CatFeature extends Feature { protected CatFeature(String name, int featureIndex, int flatFeatureIndex, boolean usedInModel) { super(name, featureIndex, flatFeatureIndex, usedInModel); } } public static final class EmbeddingFeature extends Feature { protected EmbeddingFeature(String name, int featureIndex, int flatFeatureIndex, boolean usedInModel) { super(name, featureIndex, flatFeatureIndex, usedInModel); } } static { try { NativeLib.smartLoad("catboost4j-prediction"); } catch (Exception ex) { throw new RuntimeException("Failed to load catboost4j-prediction native library", ex); } implLibrary = new CatBoostJNI(); } private CatBoostModel(long handle) throws CatBoostError { this.handle = handle; final int[] predictionDimension = new int[1]; final int[] treeCount = new int[1]; final int[] usedNumericFeatureCount = new int[1]; final int[] usedCatFeatureCount = new int[1]; final int[] usedTextFeatureCount = new int[1]; final int[] usedEmbeddingFeatureCount = new int[1]; final int[] featureVectorExpectedSize = new int[1]; final String[][] modelMetadataKeys = new String[1][]; final String[][] modelMetadataValues = new String[1][]; final String[][] floatFeatureNames = new String[1][]; final int[][] floatFlatFeatureIndex = new int[1][]; final int[][] floatFeatureIndex = new int[1][]; final int[][] floatHasNans = new int[1][]; final String[][] floatNanValueTreatment = new String[1][]; final String[][] catFeatureNames = new String[1][]; final int[][] catFlatFeatureIndex = new int[1][]; final int[][] catFeatureIndex = new int[1][]; final String[][] textFeatureNames = new String[1][]; final int[][] textFlatFeatureIndex = new int[1][]; final int[][] textFeatureIndex = new int[1][]; final String[][] embeddingFeatureNames = new String[1][]; final int[][] embeddingFlatFeatureIndex = new int[1][]; final int[][] embeddingFeatureIndex = new int[1][]; final int[][] usedFeatureIndicesArr = new int[1][]; try { implLibrary.catBoostModelGetPredictionDimension(handle, predictionDimension); implLibrary.catBoostModelGetTreeCount(handle, treeCount); implLibrary.catBoostModelGetUsedNumericFeatureCount(handle, usedNumericFeatureCount); implLibrary.catBoostModelGetUsedCategoricalFeatureCount(handle, usedCatFeatureCount); implLibrary.catBoostModelGetUsedTextFeatureCount(handle, usedTextFeatureCount); implLibrary.catBoostModelGetUsedEmbeddingFeatureCount(handle, usedEmbeddingFeatureCount); implLibrary.catBoostModelGetFlatFeatureVectorExpectedSize(handle, featureVectorExpectedSize); implLibrary.catBoostModelGetMetadata(handle, modelMetadataKeys, modelMetadataValues); implLibrary.catBoostModelGetFloatFeatures(handle, floatFeatureNames, floatFlatFeatureIndex, floatFeatureIndex, floatHasNans, floatNanValueTreatment); implLibrary.catBoostModelGetCatFeatures(handle, catFeatureNames, catFlatFeatureIndex, catFeatureIndex); implLibrary.catBoostModelGetTextFeatures(handle, textFeatureNames, textFlatFeatureIndex, textFeatureIndex); implLibrary.catBoostModelGetEmbeddingFeatures(handle, embeddingFeatureNames, embeddingFlatFeatureIndex, embeddingFeatureIndex); implLibrary.catBoostModelGetUsedFeatureIndices(handle, usedFeatureIndicesArr); } catch (CatBoostError e) { this.close(); throw e; } final HashSet<Integer> usedFeatureIndices = new HashSet<>(); for (int i = 0; i < usedFeatureIndicesArr[0].length; i++) { usedFeatureIndices.add(usedFeatureIndicesArr[0][i]); } this.predictionDimension = predictionDimension[0]; this.treeCount = treeCount[0]; this.usedNumericFeatureCount = usedNumericFeatureCount[0]; this.usedCategoricFeatureCount = usedCatFeatureCount[0]; this.usedTextFeatureCount = usedTextFeatureCount[0]; this.usedEmbeddingFeatureCount = usedEmbeddingFeatureCount[0]; for (int i = 0; i < modelMetadataKeys[0].length; i++) { this.metadata.put(modelMetadataKeys[0][i], modelMetadataValues[0][i]); } for (int i = 0; i < floatFeatureNames[0].length; i++) { this.features.add(new FloatFeature(floatFeatureNames[0][i], floatFeatureIndex[0][i], floatFlatFeatureIndex[0][i], usedFeatureIndices.contains(floatFlatFeatureIndex[0][i]), floatHasNans[0][i], floatNanValueTreatment[0][i])); } for (int i = 0; i < catFeatureNames[0].length; i++) { this.features.add(new CatFeature(catFeatureNames[0][i], catFeatureIndex[0][i], catFlatFeatureIndex[0][i], usedFeatureIndices.contains(catFlatFeatureIndex[0][i]))); } for (int i = 0; i < textFeatureNames[0].length; i++) { this.features.add(new TextFeature(textFeatureNames[0][i], textFeatureIndex[0][i], textFlatFeatureIndex[0][i], usedFeatureIndices.contains(textFlatFeatureIndex[0][i]))); } for (int i = 0; i < embeddingFeatureNames[0].length; i++) { this.features.add(new EmbeddingFeature(embeddingFeatureNames[0][i], embeddingFeatureIndex[0][i], embeddingFlatFeatureIndex[0][i], usedFeatureIndices.contains(embeddingFlatFeatureIndex[0][i]))); } Collections.sort(this.features, new Comparator<Feature>() { public int compare(Feature v1, Feature v2) { return v1.getFlatFeatureIndex() - v2.getFlatFeatureIndex(); } }); this.featureNames = new String[this.features.size()]; for (Feature f : this.features) { this.featureNames[f.getFlatFeatureIndex()] = f.getName(); } } /** * Load CatBoost model from file modelPath. * * @param modelPath Path to the model. * @return CatBoost model. * @throws CatBoostError When failed to load model. */ @NotNull public static CatBoostModel loadModel(final @NotNull String modelPath) throws CatBoostError { return loadModel(modelPath, "bin"); } /** * Load CatBoost model from file modelPath. * * @param modelPath Path to the model. * @param modelFormat Model file format (bin or json) * @return CatBoost model. * @throws CatBoostError When failed to load model. */ @NotNull public static CatBoostModel loadModel(final @NotNull String modelPath, @NotNull String modelFormat) throws CatBoostError { final long[] handles = new long[1]; implLibrary.catBoostLoadModelFromFile(modelPath, handles, modelFormat); return new CatBoostModel(handles[0]); } /** * Load CatBoost model serialized in an array. * * @param serializedModel Byte array containing model. * @return CatBoost model. * @throws CatBoostError When failed to load model. */ @NotNull public static CatBoostModel loadModel(final @NotNull byte[] serializedModel) throws CatBoostError { return loadModel(serializedModel, "bin"); } /** * Load CatBoost model serialized in an array. * * @param serializedModel Byte array containing model. * @param modelFormat Model file format (bin or json) * @return CatBoost model. * @throws CatBoostError When failed to load model. */ @NotNull public static CatBoostModel loadModel(final @NotNull byte[] serializedModel, @NotNull String modelFormat) throws CatBoostError { final long[] handles = new long[1]; implLibrary.catBoostLoadModelFromArray(serializedModel, handles, modelFormat); return new CatBoostModel(handles[0]); } /** * Load CatBoost model from stream. * * @param in Input stream containing model. * @return CatBoost model. * @throws CatBoostError When failed to load model. * @throws IOException When failed to read model from file. */ @NotNull public static CatBoostModel loadModel(final InputStream in) throws CatBoostError, IOException { return loadModel(in, "bin"); } /** * Load CatBoost model from stream. * * @param in Input stream containing model. * @param modelFormat Model file format (bin or json) * @return CatBoost model. * @throws CatBoostError When failed to load model. * @throws IOException When failed to read model from file. */ @NotNull public static CatBoostModel loadModel(final InputStream in, @NotNull String modelFormat) throws CatBoostError, IOException { final byte[] copyBuffer = new byte[4 * 1024]; int bytesRead; final ByteArrayOutputStream out = new ByteArrayOutputStream(); while ((bytesRead = in.read(copyBuffer)) != -1) { out.write(copyBuffer, 0, bytesRead); } return loadModel(out.toByteArray(), modelFormat); } /** * Hash categorical feature. * * @param catFeature String representation of categorical feature. * @return Hash for categorical feature. * @throws CatBoostError In case of error within native library. */ public static int hashCategoricalFeature(final @NotNull String catFeature) throws CatBoostError { int hash[] = new int[1]; implLibrary.catBoostHashCatFeature(catFeature, hash); return hash[0]; } /** * Hash array of categorical features. * * May be cheaper to call this function once instead of calling {@link #hashCategoricalFeature(String)} for each * categorical feature in array. * * @param catFeatures Array of categorical features. * @param hashes Array of hashes of categorical features. * @throws CatBoostError In case of error within native library. */ public static void hashCategoricalFeatures( final @NotNull String[] catFeatures, final @NotNull int[] hashes) throws CatBoostError { implLibrary.catBoostHashCatFeatures(catFeatures, hashes); } /** * Hash array of categorical features. * * @param catFeatures Array of categorical features. * @return Array of hashes of categorical features. * @throws CatBoostError In case of error within native library. */ @NotNull public static int[] hashCategoricalFeatures(final @NotNull String[] catFeatures) throws CatBoostError { final int[] hashes = new int[catFeatures.length]; hashCategoricalFeatures(catFeatures, hashes); return hashes; } public FormulaEvaluatorType[] getSupportedEvaluatorTypes() throws CatBoostError { final String[][] evaluatorTypesAsStrings = new String[1][]; implLibrary.catBoostModelGetSupportedEvaluatorTypes(handle, evaluatorTypesAsStrings); int evaluatorTypesSize = evaluatorTypesAsStrings[0].length; final FormulaEvaluatorType[] evaluatorTypes = new FormulaEvaluatorType[evaluatorTypesSize]; for (int i = 0; i < evaluatorTypesSize; ++i) { evaluatorTypes[i] = FormulaEvaluatorType.valueOf(evaluatorTypesAsStrings[0][i]); } return evaluatorTypes; } public void setEvaluatorType(FormulaEvaluatorType evaluatorType) throws CatBoostError { implLibrary.catBoostModelSetEvaluatorType(handle, evaluatorType.toString()); } public FormulaEvaluatorType getEvaluatorType() throws CatBoostError, IllegalArgumentException { final String[] evaluatorTypeAsString = new String[1]; implLibrary.catBoostModelGetEvaluatorType(handle, evaluatorTypeAsString); return FormulaEvaluatorType.valueOf(evaluatorTypeAsString[0]); } /** * @return Dimension of model prediction. */ public int getPredictionDimension() { return predictionDimension; } /** * @return Number of trees in model. */ public int getTreeCount() { return treeCount; } /** * @return Number of numeric features used by the model. */ public int getUsedNumericFeatureCount() { return usedNumericFeatureCount; } /** * @return Number of categorical features used by the model. */ public int getUsedCategoricFeatureCount() { return usedCategoricFeatureCount; } /** * @return Number of text features used by the model. */ public int getUsedTextFeatureCount() { return usedTextFeatureCount; } /** * @return Number of embedding features used by the model. */ public int getUsedEmbeddingFeatureCount() { return usedEmbeddingFeatureCount; } /** * @return Names of features used by the model. */ public String[] getFeatureNames() { return featureNames; } /** * @return A map of metadata */ public Map<String, String> getMetadata() { return metadata; } /** * @return A list of feature metadata, sorted by flat index. */ public List<Feature> getFeatures() { return features; } /** * Apply model to object defined by features. * * @param numericFeatures Numeric features. * @param catFeatures Categoric features. * @param prediction Model predictions. * @throws CatBoostError In case of error within native library. */ public void predict( final @Nullable float[] numericFeatures, final @Nullable String[] catFeatures, final @NotNull CatBoostPredictions prediction) throws CatBoostError { implLibrary.catBoostModelPredict( handle, numericFeatures, catFeatures, /*textFeatures*/ null, /*embeddingFeatures*/ null, prediction.getRawData()); } /** * Apply model to object defined by features. * * @param numericFeatures Numeric features. * @param catFeatures Categoric features. * @param textFeatures Text features. * @param embeddingFeatures Embedding features. * @param prediction Model predictions. * @throws CatBoostError In case of error within native library. */ public void predict( final @Nullable float[] numericFeatures, final @Nullable String[] catFeatures, final @Nullable String[] textFeatures, final @Nullable float[][] embeddingFeatures, final @NotNull CatBoostPredictions prediction) throws CatBoostError { implLibrary.catBoostModelPredict( handle, numericFeatures, catFeatures, textFeatures, embeddingFeatures, prediction.getRawData()); } /** * Same as {@link #predict(float[], String[], CatBoostPredictions)}, but returns prediction instead of taking it * as the last parameter. * * @param numericFeatures Numeric features. * @param catFeatures Categoric features. * @return Model predictions. * @throws CatBoostError In case of error within native library. */ @NotNull public CatBoostPredictions predict( final @Nullable float[] numericFeatures, final @Nullable String[] catFeatures) throws CatBoostError { final CatBoostPredictions prediction = new CatBoostPredictions(1, getPredictionDimension()); predict(numericFeatures, catFeatures, prediction); return prediction; } /** * Same as {@link #predict(float[], String[], String[], float[][], CatBoostPredictions)}, but returns prediction instead of taking it * as the last parameter. * * @param numericFeatures Numeric features. * @param catFeatures Categoric features. * @param textFeatures Text features. * @param embeddingFeatures Embedding features. * @return Model predictions. * @throws CatBoostError In case of error within native library. */ @NotNull public CatBoostPredictions predict( final @Nullable float[] numericFeatures, final @Nullable String[] catFeatures, final @Nullable String[] textFeatures, final @Nullable float[][] embeddingFeatures) throws CatBoostError { final CatBoostPredictions prediction = new CatBoostPredictions(1, getPredictionDimension()); predict(numericFeatures, catFeatures, textFeatures, embeddingFeatures, prediction); return prediction; } /** * Same as {@link #predict(float[], String[], CatBoostPredictions)}, but accept categoric features as hashes * computed by {@link #hashCategoricalFeature(String)}. * * @param numericFeatures Numeric features. * @param catFeatureHashes Categoric feature hashes. * @param prediction Model predictions. * @throws CatBoostError In case of error within native library. */ public void predict( final @Nullable float[] numericFeatures, final @Nullable int[] catFeatureHashes, final @NotNull CatBoostPredictions prediction) throws CatBoostError { implLibrary.catBoostModelPredict( handle, numericFeatures, catFeatureHashes, /*textFeatures*/ null, /*embeddingFeatures*/ null, prediction.getRawData()); } /** * Same as {@link #predict(float[], String[], String[], float[][], CatBoostPredictions)}, but accept categoric features as hashes * computed by {@link #hashCategoricalFeature(String)}. * * @param numericFeatures Numeric features. * @param catFeatureHashes Categoric feature hashes. * @param textFeatures Text features. * @param embeddingFeatures Embedding features. * @param prediction Model predictions. * @throws CatBoostError In case of error within native library. */ public void predict( final @Nullable float[] numericFeatures, final @Nullable int[] catFeatureHashes, final @Nullable String[] textFeatures, final @Nullable float[][] embeddingFeatures, final @NotNull CatBoostPredictions prediction) throws CatBoostError { implLibrary.catBoostModelPredict( handle, numericFeatures, catFeatureHashes, textFeatures, embeddingFeatures, prediction.getRawData()); } /** * Same as {@link #predict(float[], int[], CatBoostPredictions)}, but returns prediction instead of taking it as * third parameter. * * @param numericFeatures Numeric features. * @param catFeatureHashes Categoric feature hashes. * @return Model predictions. * @throws CatBoostError In case of error within native library. */ @NotNull public CatBoostPredictions predict( final @Nullable float[] numericFeatures, final @Nullable int[] catFeatureHashes) throws CatBoostError { final CatBoostPredictions prediction = new CatBoostPredictions(1, getPredictionDimension()); predict(numericFeatures, catFeatureHashes, prediction); return prediction; } /** * Same as {@link #predict(float[], int[], String[], float[][], CatBoostPredictions)}, but returns prediction instead of taking it as * third parameter. * * @param numericFeatures Numeric features. * @param catFeatureHashes Categoric feature hashes. * @param textFeatures Text features. * @param embeddingFeatures Embedding features. * @return Model predictions. * @throws CatBoostError In case of error within native library. */ @NotNull public CatBoostPredictions predict( final @Nullable float[] numericFeatures, final @Nullable int[] catFeatureHashes, final @Nullable String[] textFeatures, final @Nullable float[][] embeddingFeatures) throws CatBoostError { final CatBoostPredictions prediction = new CatBoostPredictions(1, getPredictionDimension()); predict(numericFeatures, catFeatureHashes, textFeatures, embeddingFeatures, prediction); return prediction; } /** * Apply model to a batch of objects. * * @param numericFeatures Numeric features matrix. * @param catFeatures Categoric features matrix. * @param prediction Model predictions. * @throws CatBoostError In case of error within native library. */ public void predict( final @Nullable float[][] numericFeatures, final @Nullable String[][] catFeatures, final @NotNull CatBoostPredictions prediction) throws CatBoostError { implLibrary.catBoostModelPredict( handle, numericFeatures, catFeatures, /*textFeatures*/ null, /*embeddingFeatures*/ null, prediction.getRawData()); } /** * Apply model to a batch of objects. * * @param numericFeatures Numeric features matrix. * @param catFeatures Categoric features matrix. * @param textFeatures Text features matrix. * @param embeddingFeatures Embedding features matrix. * @param prediction Model predictions. * @throws CatBoostError In case of error within native library. */ public void predict( final @Nullable float[][] numericFeatures, final @Nullable String[][] catFeatures, final @Nullable String[][] textFeatures, final @Nullable float[][][] embeddingFeatures, final @NotNull CatBoostPredictions prediction) throws CatBoostError { implLibrary.catBoostModelPredict( handle, numericFeatures, catFeatures, textFeatures, embeddingFeatures, prediction.getRawData()); } /** * Same as {@link #predict(float[][], String[][], CatBoostPredictions)}, but returns prediction instead of taking * it as the last parameter. * * @param numericFeatures Numeric features. * @param catFeatures Categoric features. * @return Model predictions. * @throws CatBoostError In case of error within native library. */ @NotNull public CatBoostPredictions predict( final @Nullable float[][] numericFeatures, final @Nullable String[][] catFeatures) throws CatBoostError { return predict(numericFeatures, catFeatures, /*textFeatures*/ null, /*embeddingFeatures*/ null); } /** * Same as {@link #predict(float[][], String[][], String[][], float[][][], CatBoostPredictions)}, but returns prediction instead of taking * it as the last parameter. * * @param numericFeatures Numeric features. * @param catFeatures Categoric features. * @param textFeatures Text features. * @param embeddingFeatures Embedding features. * @return Model predictions. * @throws CatBoostError In case of error within native library. */ @NotNull public CatBoostPredictions predict( final @Nullable float[][] numericFeatures, final @Nullable String[][] catFeatures, final @Nullable String[][] textFeatures, final @Nullable float[][][] embeddingFeatures) throws CatBoostError { int resultSize = 0; if (numericFeatures != null) { resultSize = numericFeatures.length; } else if (catFeatures != null) { resultSize = catFeatures.length; } else if (textFeatures != null) { resultSize = textFeatures.length; } else if (embeddingFeatures != null) { resultSize = embeddingFeatures.length; } else { throw new CatBoostError("all arguments are null"); } final CatBoostPredictions prediction = new CatBoostPredictions(resultSize, getPredictionDimension()); predict(numericFeatures, catFeatures, textFeatures, embeddingFeatures, prediction); return prediction; } /** * Same as {@link #predict(float[][], String[][], CatBoostPredictions)}, but accept categoric features as hashes * computed by {@link #hashCategoricalFeature(String)}. * * @param numericFeatures Numeric features. * @param catFeatureHashes Categoric feature hashes. * @param prediction Model predictions. * @throws CatBoostError In case of error within native library. */ public void predict( final @Nullable float[][] numericFeatures, final @Nullable int[][] catFeatureHashes, final @NotNull CatBoostPredictions prediction) throws CatBoostError { implLibrary.catBoostModelPredict( handle, numericFeatures, catFeatureHashes, /*textFeatures*/ null, /*embeddingFeatures*/ null, prediction.getRawData()); } /** * Same as {@link #predict(float[][], String[][], String[][], float[][][], CatBoostPredictions)}, but accept categoric features as hashes * computed by {@link #hashCategoricalFeature(String)}. * * @param numericFeatures Numeric features. * @param catFeatureHashes Categoric feature hashes. * @param textFeatures Text features. * @param embeddingFeatures Embedding features. * @param prediction Model predictions. * @throws CatBoostError In case of error within native library. */ public void predict( final @Nullable float[][] numericFeatures, final @Nullable int[][] catFeatureHashes, final @Nullable String[][] textFeatures, final @Nullable float[][][] embeddingFeatures, final @NotNull CatBoostPredictions prediction) throws CatBoostError { implLibrary.catBoostModelPredict( handle, numericFeatures, catFeatureHashes, textFeatures, embeddingFeatures, prediction.getRawData()); } /** * Same as {@link #predict(float[][], String[][], CatBoostPredictions)}, but returns predictions instead of taking * it as the last parameter. * * @param numericFeatures Numeric features. * @param catFeatureHashes Categoric feature hashes. * @return Model predictions. * @throws CatBoostError In case of error within native library. */ @NotNull public CatBoostPredictions predict( final @Nullable float[][] numericFeatures, final @Nullable int[][] catFeatureHashes) throws CatBoostError { if (numericFeatures == null && catFeatureHashes == null) { throw new CatBoostError("both arguments are null"); } final CatBoostPredictions prediction = new CatBoostPredictions( numericFeatures == null ? catFeatureHashes.length : numericFeatures.length, getPredictionDimension()); predict(numericFeatures, catFeatureHashes, prediction); return prediction; } /** * Same as {@link #predict(float[][], String[][], String[][], float[][][], CatBoostPredictions)}, but returns predictions instead of taking * it as the last parameter. * * @param numericFeatures Numeric features. * @param catFeatureHashes Categoric feature hashes. * @param textFeatures Text features. * @param embeddingFeatures Embedding features. * @return Model predictions. * @throws CatBoostError In case of error within native library. */ @NotNull public CatBoostPredictions predict( final @Nullable float[][] numericFeatures, final @Nullable int[][] catFeatureHashes, final @Nullable String[][] textFeatures, final @Nullable float[][][] embeddingFeatures) throws CatBoostError { int resultSize = 0; if (numericFeatures != null) { resultSize = numericFeatures.length; } else if (catFeatureHashes != null) { resultSize = catFeatureHashes.length; } else if (textFeatures != null) { resultSize = textFeatures.length; } else if (embeddingFeatures != null) { resultSize = embeddingFeatures.length; } else { throw new CatBoostError("all arguments are null"); } final CatBoostPredictions prediction = new CatBoostPredictions(resultSize, getPredictionDimension()); predict(numericFeatures, catFeatureHashes, textFeatures, embeddingFeatures, prediction); return prediction; } @Override protected void finalize() throws Throwable { try { dispose(); } finally { super.finalize(); } } private synchronized void dispose() throws CatBoostError { if (handle != 0) { implLibrary.catBoostFreeModel(handle); handle = 0; } } @Override public void close() throws CatBoostError { dispose(); } }
0
java-sources/ai/catboost/catboost-prediction/1.2.8/ai
java-sources/ai/catboost/catboost-prediction/1.2.8/ai/catboost/CatBoostPredictions.java
package ai.catboost; import javax.validation.constraints.NotNull; // TODO(yazevnul): add CatBoostClassificationPrediction /** * CatBoost model prediction. */ public class CatBoostPredictions { @NotNull final private double[] data; final private int objectCount; final private int predictionDimension; /** * Constructs CatBoost model prediction from preallocated array. * * @param objectCount Number of objects * @param predictionDimension CatBoost model prediction dimension. * @param data Array containing flattened prediction matrix. */ CatBoostPredictions(final int objectCount, final int predictionDimension, final @NotNull double[] data) { if (data.length != objectCount * predictionDimension) { final String message = "data size is incorrect, must be objectCount * predictionDimension = " + String.valueOf(objectCount * predictionDimension) + "(objectCount=" + String.valueOf(objectCount) + ", " + " predictionDimension=" + String.valueOf(predictionDimension) + ")" + " but got " + String.valueOf(data.length); throw new IllegalArgumentException(message); } this.objectCount = objectCount; this.predictionDimension = predictionDimension; this.data = data; } /** * Construct CatBoost model prediction based on number of objects and model prediction dimension. * * @param objectCount Object count. * @param predictionDimension CatBoost model prediction dimension. */ public CatBoostPredictions(final int objectCount, final int predictionDimension) { this.objectCount = objectCount; this.predictionDimension = predictionDimension; this.data = new double[objectCount * predictionDimension]; } /** * @return Number of objects in prediction. */ public int getObjectCount() { return objectCount; } /** * @return Model prediction dimension. */ public int getPredictionDimension() { return predictionDimension; } /** * Get model prediction for particular object and particular dimension. * * @param objectIndex Object index. * @param predictionIndex Prediction dimension index. * @return Model prediction value. */ public double get(final int objectIndex, final int predictionIndex) { return data[objectIndex * getPredictionDimension() + predictionIndex]; } /** * Copy object prediction to a specified array. * * @param objectIndex Object index. * @param predictions Array to copy predictions to. */ public void copyObjectPredictions(final int objectIndex, final @NotNull double[] predictions) { if (predictions.length < getPredictionDimension()) { throw new IllegalArgumentException("`predictions` size is insufficient, got " + String.valueOf(predictions.length) + "but must be at least " + String.valueOf(getPredictionDimension())); } System.arraycopy(data, objectIndex * getPredictionDimension(), predictions, 0, getPredictionDimension()); } /** * Copy object prediction to a separate array. * * @see #copyObjectPredictions(int, double[]) * * @param objectIndex Object index. * @return Array with object predictions. */ @NotNull public double[] copyObjectPredictions(final int objectIndex) { final double[] predictions = new double[getPredictionDimension()]; copyObjectPredictions(objectIndex, predictions); return predictions; } /** * Return row-major copy of prediction matrix. Prediction for object with index `i` in dimension `j` will be at * `i*getPredictionDimension() + j`. * * @return Row-major copy of prediction matrix. */ @NotNull public double[] copyRowMajorPredictions() { return data; } @NotNull double[] getRawData() { return data; } }
0
java-sources/ai/catboost/catboost-spark_2.11/0.25-rc3/ru/yandex/catboost/spark/catboost4j_spark/core/src
java-sources/ai/catboost/catboost-spark_2.11/0.25-rc3/ru/yandex/catboost/spark/catboost4j_spark/core/src/native_impl/EAucType.java
/* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ package ru.yandex.catboost.spark.catboost4j_spark.core.src.native_impl; public enum EAucType { Classic, Ranking, Mu, OneVsAll; public final int swigValue() { return swigValue; } public static EAucType swigToEnum(int swigValue) { EAucType[] swigValues = EAucType.class.getEnumConstants(); if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) return swigValues[swigValue]; for (EAucType swigEnum : swigValues) if (swigEnum.swigValue == swigValue) return swigEnum; throw new IllegalArgumentException("No enum " + EAucType.class + " with value " + swigValue); } @SuppressWarnings("unused") private EAucType() { this.swigValue = SwigNext.next++; } @SuppressWarnings("unused") private EAucType(int swigValue) { this.swigValue = swigValue; SwigNext.next = swigValue+1; } @SuppressWarnings("unused") private EAucType(EAucType swigEnum) { this.swigValue = swigEnum.swigValue; SwigNext.next = this.swigValue+1; } private final int swigValue; private static class SwigNext { private static int next = 0; } }
0
java-sources/ai/catboost/catboost-spark_2.11/0.25-rc3/ru/yandex/catboost/spark/catboost4j_spark/core/src
java-sources/ai/catboost/catboost-spark_2.11/0.25-rc3/ru/yandex/catboost/spark/catboost4j_spark/core/src/native_impl/EAutoClassWeightsType.java
/* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ package ru.yandex.catboost.spark.catboost4j_spark.core.src.native_impl; public enum EAutoClassWeightsType { Balanced, SqrtBalanced, None; public final int swigValue() { return swigValue; } public static EAutoClassWeightsType swigToEnum(int swigValue) { EAutoClassWeightsType[] swigValues = EAutoClassWeightsType.class.getEnumConstants(); if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) return swigValues[swigValue]; for (EAutoClassWeightsType swigEnum : swigValues) if (swigEnum.swigValue == swigValue) return swigEnum; throw new IllegalArgumentException("No enum " + EAutoClassWeightsType.class + " with value " + swigValue); } @SuppressWarnings("unused") private EAutoClassWeightsType() { this.swigValue = SwigNext.next++; } @SuppressWarnings("unused") private EAutoClassWeightsType(int swigValue) { this.swigValue = swigValue; SwigNext.next = swigValue+1; } @SuppressWarnings("unused") private EAutoClassWeightsType(EAutoClassWeightsType swigEnum) { this.swigValue = swigEnum.swigValue; SwigNext.next = this.swigValue+1; } private final int swigValue; private static class SwigNext { private static int next = 0; } }
0
java-sources/ai/catboost/catboost-spark_2.11/0.25-rc3/ru/yandex/catboost/spark/catboost4j_spark/core/src
java-sources/ai/catboost/catboost-spark_2.11/0.25-rc3/ru/yandex/catboost/spark/catboost4j_spark/core/src/native_impl/EBoostingType.java
/* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ package ru.yandex.catboost.spark.catboost4j_spark.core.src.native_impl; public enum EBoostingType { Ordered, Plain; public final int swigValue() { return swigValue; } public static EBoostingType swigToEnum(int swigValue) { EBoostingType[] swigValues = EBoostingType.class.getEnumConstants(); if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) return swigValues[swigValue]; for (EBoostingType swigEnum : swigValues) if (swigEnum.swigValue == swigValue) return swigEnum; throw new IllegalArgumentException("No enum " + EBoostingType.class + " with value " + swigValue); } @SuppressWarnings("unused") private EBoostingType() { this.swigValue = SwigNext.next++; } @SuppressWarnings("unused") private EBoostingType(int swigValue) { this.swigValue = swigValue; SwigNext.next = swigValue+1; } @SuppressWarnings("unused") private EBoostingType(EBoostingType swigEnum) { this.swigValue = swigEnum.swigValue; SwigNext.next = this.swigValue+1; } private final int swigValue; private static class SwigNext { private static int next = 0; } }
0
java-sources/ai/catboost/catboost-spark_2.11/0.25-rc3/ru/yandex/catboost/spark/catboost4j_spark/core/src
java-sources/ai/catboost/catboost-spark_2.11/0.25-rc3/ru/yandex/catboost/spark/catboost4j_spark/core/src/native_impl/EBootstrapType.java
/* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ package ru.yandex.catboost.spark.catboost4j_spark.core.src.native_impl; public enum EBootstrapType { Poisson, Bayesian, Bernoulli, MVS, No; public final int swigValue() { return swigValue; } public static EBootstrapType swigToEnum(int swigValue) { EBootstrapType[] swigValues = EBootstrapType.class.getEnumConstants(); if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) return swigValues[swigValue]; for (EBootstrapType swigEnum : swigValues) if (swigEnum.swigValue == swigValue) return swigEnum; throw new IllegalArgumentException("No enum " + EBootstrapType.class + " with value " + swigValue); } @SuppressWarnings("unused") private EBootstrapType() { this.swigValue = SwigNext.next++; } @SuppressWarnings("unused") private EBootstrapType(int swigValue) { this.swigValue = swigValue; SwigNext.next = swigValue+1; } @SuppressWarnings("unused") private EBootstrapType(EBootstrapType swigEnum) { this.swigValue = swigEnum.swigValue; SwigNext.next = this.swigValue+1; } private final int swigValue; private static class SwigNext { private static int next = 0; } }
0
java-sources/ai/catboost/catboost-spark_2.11/0.25-rc3/ru/yandex/catboost/spark/catboost4j_spark/core/src
java-sources/ai/catboost/catboost-spark_2.11/0.25-rc3/ru/yandex/catboost/spark/catboost4j_spark/core/src/native_impl/EBorderSelectionType.java
/* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ package ru.yandex.catboost.spark.catboost4j_spark.core.src.native_impl; public enum EBorderSelectionType { Median(1), GreedyLogSum(2), UniformAndQuantiles(3), MinEntropy(4), MaxLogSum(5), Uniform(6), GreedyMinEntropy(7); public final int swigValue() { return swigValue; } public static EBorderSelectionType swigToEnum(int swigValue) { EBorderSelectionType[] swigValues = EBorderSelectionType.class.getEnumConstants(); if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) return swigValues[swigValue]; for (EBorderSelectionType swigEnum : swigValues) if (swigEnum.swigValue == swigValue) return swigEnum; throw new IllegalArgumentException("No enum " + EBorderSelectionType.class + " with value " + swigValue); } @SuppressWarnings("unused") private EBorderSelectionType() { this.swigValue = SwigNext.next++; } @SuppressWarnings("unused") private EBorderSelectionType(int swigValue) { this.swigValue = swigValue; SwigNext.next = swigValue+1; } @SuppressWarnings("unused") private EBorderSelectionType(EBorderSelectionType swigEnum) { this.swigValue = swigEnum.swigValue; SwigNext.next = this.swigValue+1; } private final int swigValue; private static class SwigNext { private static int next = 0; } }
0
java-sources/ai/catboost/catboost-spark_2.11/0.25-rc3/ru/yandex/catboost/spark/catboost4j_spark/core/src
java-sources/ai/catboost/catboost-spark_2.11/0.25-rc3/ru/yandex/catboost/spark/catboost4j_spark/core/src/native_impl/ECalcTypeShapValues.java
/* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ package ru.yandex.catboost.spark.catboost4j_spark.core.src.native_impl; public enum ECalcTypeShapValues { Approximate, Regular, Exact, Independent; public final int swigValue() { return swigValue; } public static ECalcTypeShapValues swigToEnum(int swigValue) { ECalcTypeShapValues[] swigValues = ECalcTypeShapValues.class.getEnumConstants(); if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) return swigValues[swigValue]; for (ECalcTypeShapValues swigEnum : swigValues) if (swigEnum.swigValue == swigValue) return swigEnum; throw new IllegalArgumentException("No enum " + ECalcTypeShapValues.class + " with value " + swigValue); } @SuppressWarnings("unused") private ECalcTypeShapValues() { this.swigValue = SwigNext.next++; } @SuppressWarnings("unused") private ECalcTypeShapValues(int swigValue) { this.swigValue = swigValue; SwigNext.next = swigValue+1; } @SuppressWarnings("unused") private ECalcTypeShapValues(ECalcTypeShapValues swigEnum) { this.swigValue = swigEnum.swigValue; SwigNext.next = this.swigValue+1; } private final int swigValue; private static class SwigNext { private static int next = 0; } }
0
java-sources/ai/catboost/catboost-spark_2.11/0.25-rc3/ru/yandex/catboost/spark/catboost4j_spark/core/src
java-sources/ai/catboost/catboost-spark_2.11/0.25-rc3/ru/yandex/catboost/spark/catboost4j_spark/core/src/native_impl/EColumn.java
/* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ package ru.yandex.catboost.spark.catboost4j_spark.core.src.native_impl; public enum EColumn { Num, Categ, Label, Auxiliary, Baseline, Weight, SampleId, GroupId, GroupWeight, SubgroupId, Timestamp, Sparse, Prediction, Text, NumVector; public final int swigValue() { return swigValue; } public static EColumn swigToEnum(int swigValue) { EColumn[] swigValues = EColumn.class.getEnumConstants(); if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) return swigValues[swigValue]; for (EColumn swigEnum : swigValues) if (swigEnum.swigValue == swigValue) return swigEnum; throw new IllegalArgumentException("No enum " + EColumn.class + " with value " + swigValue); } @SuppressWarnings("unused") private EColumn() { this.swigValue = SwigNext.next++; } @SuppressWarnings("unused") private EColumn(int swigValue) { this.swigValue = swigValue; SwigNext.next = swigValue+1; } @SuppressWarnings("unused") private EColumn(EColumn swigEnum) { this.swigValue = swigEnum.swigValue; SwigNext.next = this.swigValue+1; } private final int swigValue; private static class SwigNext { private static int next = 0; } }
0
java-sources/ai/catboost/catboost-spark_2.11/0.25-rc3/ru/yandex/catboost/spark/catboost4j_spark/core/src
java-sources/ai/catboost/catboost-spark_2.11/0.25-rc3/ru/yandex/catboost/spark/catboost4j_spark/core/src/native_impl/ECounterCalc.java
/* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ package ru.yandex.catboost.spark.catboost4j_spark.core.src.native_impl; public enum ECounterCalc { Full, SkipTest; public final int swigValue() { return swigValue; } public static ECounterCalc swigToEnum(int swigValue) { ECounterCalc[] swigValues = ECounterCalc.class.getEnumConstants(); if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) return swigValues[swigValue]; for (ECounterCalc swigEnum : swigValues) if (swigEnum.swigValue == swigValue) return swigEnum; throw new IllegalArgumentException("No enum " + ECounterCalc.class + " with value " + swigValue); } @SuppressWarnings("unused") private ECounterCalc() { this.swigValue = SwigNext.next++; } @SuppressWarnings("unused") private ECounterCalc(int swigValue) { this.swigValue = swigValue; SwigNext.next = swigValue+1; } @SuppressWarnings("unused") private ECounterCalc(ECounterCalc swigEnum) { this.swigValue = swigEnum.swigValue; SwigNext.next = this.swigValue+1; } private final int swigValue; private static class SwigNext { private static int next = 0; } }
0
java-sources/ai/catboost/catboost-spark_2.11/0.25-rc3/ru/yandex/catboost/spark/catboost4j_spark/core/src
java-sources/ai/catboost/catboost-spark_2.11/0.25-rc3/ru/yandex/catboost/spark/catboost4j_spark/core/src/native_impl/ECrossValidation.java
/* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ package ru.yandex.catboost.spark.catboost4j_spark.core.src.native_impl; public enum ECrossValidation { Classical, Inverted, TimeSeries; public final int swigValue() { return swigValue; } public static ECrossValidation swigToEnum(int swigValue) { ECrossValidation[] swigValues = ECrossValidation.class.getEnumConstants(); if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) return swigValues[swigValue]; for (ECrossValidation swigEnum : swigValues) if (swigEnum.swigValue == swigValue) return swigEnum; throw new IllegalArgumentException("No enum " + ECrossValidation.class + " with value " + swigValue); } @SuppressWarnings("unused") private ECrossValidation() { this.swigValue = SwigNext.next++; } @SuppressWarnings("unused") private ECrossValidation(int swigValue) { this.swigValue = swigValue; SwigNext.next = swigValue+1; } @SuppressWarnings("unused") private ECrossValidation(ECrossValidation swigEnum) { this.swigValue = swigEnum.swigValue; SwigNext.next = this.swigValue+1; } private final int swigValue; private static class SwigNext { private static int next = 0; } }
0
java-sources/ai/catboost/catboost-spark_2.11/0.25-rc3/ru/yandex/catboost/spark/catboost4j_spark/core/src
java-sources/ai/catboost/catboost-spark_2.11/0.25-rc3/ru/yandex/catboost/spark/catboost4j_spark/core/src/native_impl/EDataPartitionType.java
/* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ package ru.yandex.catboost.spark.catboost4j_spark.core.src.native_impl; public enum EDataPartitionType { FeatureParallel, DocParallel; public final int swigValue() { return swigValue; } public static EDataPartitionType swigToEnum(int swigValue) { EDataPartitionType[] swigValues = EDataPartitionType.class.getEnumConstants(); if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) return swigValues[swigValue]; for (EDataPartitionType swigEnum : swigValues) if (swigEnum.swigValue == swigValue) return swigEnum; throw new IllegalArgumentException("No enum " + EDataPartitionType.class + " with value " + swigValue); } @SuppressWarnings("unused") private EDataPartitionType() { this.swigValue = SwigNext.next++; } @SuppressWarnings("unused") private EDataPartitionType(int swigValue) { this.swigValue = swigValue; SwigNext.next = swigValue+1; } @SuppressWarnings("unused") private EDataPartitionType(EDataPartitionType swigEnum) { this.swigValue = swigEnum.swigValue; SwigNext.next = this.swigValue+1; } private final int swigValue; private static class SwigNext { private static int next = 0; } }
0
java-sources/ai/catboost/catboost-spark_2.11/0.25-rc3/ru/yandex/catboost/spark/catboost4j_spark/core/src
java-sources/ai/catboost/catboost-spark_2.11/0.25-rc3/ru/yandex/catboost/spark/catboost4j_spark/core/src/native_impl/EDatasetVisitorType.java
/* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ package ru.yandex.catboost.spark.catboost4j_spark.core.src.native_impl; public enum EDatasetVisitorType { RawObjectsOrder, RawFeaturesOrder, QuantizedFeatures; public final int swigValue() { return swigValue; } public static EDatasetVisitorType swigToEnum(int swigValue) { EDatasetVisitorType[] swigValues = EDatasetVisitorType.class.getEnumConstants(); if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) return swigValues[swigValue]; for (EDatasetVisitorType swigEnum : swigValues) if (swigEnum.swigValue == swigValue) return swigEnum; throw new IllegalArgumentException("No enum " + EDatasetVisitorType.class + " with value " + swigValue); } @SuppressWarnings("unused") private EDatasetVisitorType() { this.swigValue = SwigNext.next++; } @SuppressWarnings("unused") private EDatasetVisitorType(int swigValue) { this.swigValue = swigValue; SwigNext.next = swigValue+1; } @SuppressWarnings("unused") private EDatasetVisitorType(EDatasetVisitorType swigEnum) { this.swigValue = swigEnum.swigValue; SwigNext.next = this.swigValue+1; } private final int swigValue; private static class SwigNext { private static int next = 0; } }
0
java-sources/ai/catboost/catboost-spark_2.11/0.25-rc3/ru/yandex/catboost/spark/catboost4j_spark/core/src
java-sources/ai/catboost/catboost-spark_2.11/0.25-rc3/ru/yandex/catboost/spark/catboost4j_spark/core/src/native_impl/EErrorType.java
/* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ package ru.yandex.catboost.spark.catboost4j_spark.core.src.native_impl; public enum EErrorType { PerObjectError, PairwiseError, QuerywiseError; public final int swigValue() { return swigValue; } public static EErrorType swigToEnum(int swigValue) { EErrorType[] swigValues = EErrorType.class.getEnumConstants(); if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) return swigValues[swigValue]; for (EErrorType swigEnum : swigValues) if (swigEnum.swigValue == swigValue) return swigEnum; throw new IllegalArgumentException("No enum " + EErrorType.class + " with value " + swigValue); } @SuppressWarnings("unused") private EErrorType() { this.swigValue = SwigNext.next++; } @SuppressWarnings("unused") private EErrorType(int swigValue) { this.swigValue = swigValue; SwigNext.next = swigValue+1; } @SuppressWarnings("unused") private EErrorType(EErrorType swigEnum) { this.swigValue = swigEnum.swigValue; SwigNext.next = this.swigValue+1; } private final int swigValue; private static class SwigNext { private static int next = 0; } }
0
java-sources/ai/catboost/catboost-spark_2.11/0.25-rc3/ru/yandex/catboost/spark/catboost4j_spark/core/src
java-sources/ai/catboost/catboost-spark_2.11/0.25-rc3/ru/yandex/catboost/spark/catboost4j_spark/core/src/native_impl/EEstimatedSourceFeatureType.java
/* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ package ru.yandex.catboost.spark.catboost4j_spark.core.src.native_impl; public enum EEstimatedSourceFeatureType { Text, Embedding; public final int swigValue() { return swigValue; } public static EEstimatedSourceFeatureType swigToEnum(int swigValue) { EEstimatedSourceFeatureType[] swigValues = EEstimatedSourceFeatureType.class.getEnumConstants(); if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) return swigValues[swigValue]; for (EEstimatedSourceFeatureType swigEnum : swigValues) if (swigEnum.swigValue == swigValue) return swigEnum; throw new IllegalArgumentException("No enum " + EEstimatedSourceFeatureType.class + " with value " + swigValue); } @SuppressWarnings("unused") private EEstimatedSourceFeatureType() { this.swigValue = SwigNext.next++; } @SuppressWarnings("unused") private EEstimatedSourceFeatureType(int swigValue) { this.swigValue = swigValue; SwigNext.next = swigValue+1; } @SuppressWarnings("unused") private EEstimatedSourceFeatureType(EEstimatedSourceFeatureType swigEnum) { this.swigValue = swigEnum.swigValue; SwigNext.next = this.swigValue+1; } private final int swigValue; private static class SwigNext { private static int next = 0; } }
0
java-sources/ai/catboost/catboost-spark_2.11/0.25-rc3/ru/yandex/catboost/spark/catboost4j_spark/core/src
java-sources/ai/catboost/catboost-spark_2.11/0.25-rc3/ru/yandex/catboost/spark/catboost4j_spark/core/src/native_impl/EExplainableModelOutput.java
/* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ package ru.yandex.catboost.spark.catboost4j_spark.core.src.native_impl; public enum EExplainableModelOutput { Raw, Probability, LossFunction; public final int swigValue() { return swigValue; } public static EExplainableModelOutput swigToEnum(int swigValue) { EExplainableModelOutput[] swigValues = EExplainableModelOutput.class.getEnumConstants(); if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) return swigValues[swigValue]; for (EExplainableModelOutput swigEnum : swigValues) if (swigEnum.swigValue == swigValue) return swigEnum; throw new IllegalArgumentException("No enum " + EExplainableModelOutput.class + " with value " + swigValue); } @SuppressWarnings("unused") private EExplainableModelOutput() { this.swigValue = SwigNext.next++; } @SuppressWarnings("unused") private EExplainableModelOutput(int swigValue) { this.swigValue = swigValue; SwigNext.next = swigValue+1; } @SuppressWarnings("unused") private EExplainableModelOutput(EExplainableModelOutput swigEnum) { this.swigValue = swigEnum.swigValue; SwigNext.next = this.swigValue+1; } private final int swigValue; private static class SwigNext { private static int next = 0; } }
0
java-sources/ai/catboost/catboost-spark_2.11/0.25-rc3/ru/yandex/catboost/spark/catboost4j_spark/core/src
java-sources/ai/catboost/catboost-spark_2.11/0.25-rc3/ru/yandex/catboost/spark/catboost4j_spark/core/src/native_impl/EF1AverageType.java
/* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ package ru.yandex.catboost.spark.catboost4j_spark.core.src.native_impl; public enum EF1AverageType { Micro, Macro, Weighted; public final int swigValue() { return swigValue; } public static EF1AverageType swigToEnum(int swigValue) { EF1AverageType[] swigValues = EF1AverageType.class.getEnumConstants(); if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) return swigValues[swigValue]; for (EF1AverageType swigEnum : swigValues) if (swigEnum.swigValue == swigValue) return swigEnum; throw new IllegalArgumentException("No enum " + EF1AverageType.class + " with value " + swigValue); } @SuppressWarnings("unused") private EF1AverageType() { this.swigValue = SwigNext.next++; } @SuppressWarnings("unused") private EF1AverageType(int swigValue) { this.swigValue = swigValue; SwigNext.next = swigValue+1; } @SuppressWarnings("unused") private EF1AverageType(EF1AverageType swigEnum) { this.swigValue = swigEnum.swigValue; SwigNext.next = this.swigValue+1; } private final int swigValue; private static class SwigNext { private static int next = 0; } }
0
java-sources/ai/catboost/catboost-spark_2.11/0.25-rc3/ru/yandex/catboost/spark/catboost4j_spark/core/src
java-sources/ai/catboost/catboost-spark_2.11/0.25-rc3/ru/yandex/catboost/spark/catboost4j_spark/core/src/native_impl/EFeatureCalcerType.java
/* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ package ru.yandex.catboost.spark.catboost4j_spark.core.src.native_impl; public enum EFeatureCalcerType { BoW, NaiveBayes, BM25, LDA, KNN; public final int swigValue() { return swigValue; } public static EFeatureCalcerType swigToEnum(int swigValue) { EFeatureCalcerType[] swigValues = EFeatureCalcerType.class.getEnumConstants(); if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) return swigValues[swigValue]; for (EFeatureCalcerType swigEnum : swigValues) if (swigEnum.swigValue == swigValue) return swigEnum; throw new IllegalArgumentException("No enum " + EFeatureCalcerType.class + " with value " + swigValue); } @SuppressWarnings("unused") private EFeatureCalcerType() { this.swigValue = SwigNext.next++; } @SuppressWarnings("unused") private EFeatureCalcerType(int swigValue) { this.swigValue = swigValue; SwigNext.next = swigValue+1; } @SuppressWarnings("unused") private EFeatureCalcerType(EFeatureCalcerType swigEnum) { this.swigValue = swigEnum.swigValue; SwigNext.next = this.swigValue+1; } private final int swigValue; private static class SwigNext { private static int next = 0; } }
0
java-sources/ai/catboost/catboost-spark_2.11/0.25-rc3/ru/yandex/catboost/spark/catboost4j_spark/core/src
java-sources/ai/catboost/catboost-spark_2.11/0.25-rc3/ru/yandex/catboost/spark/catboost4j_spark/core/src/native_impl/EFeatureEvalMode.java
/* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ package ru.yandex.catboost.spark.catboost4j_spark.core.src.native_impl; public enum EFeatureEvalMode { OneVsNone, OneVsOthers, OneVsAll, OthersVsAll; public final int swigValue() { return swigValue; } public static EFeatureEvalMode swigToEnum(int swigValue) { EFeatureEvalMode[] swigValues = EFeatureEvalMode.class.getEnumConstants(); if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) return swigValues[swigValue]; for (EFeatureEvalMode swigEnum : swigValues) if (swigEnum.swigValue == swigValue) return swigEnum; throw new IllegalArgumentException("No enum " + EFeatureEvalMode.class + " with value " + swigValue); } @SuppressWarnings("unused") private EFeatureEvalMode() { this.swigValue = SwigNext.next++; } @SuppressWarnings("unused") private EFeatureEvalMode(int swigValue) { this.swigValue = swigValue; SwigNext.next = swigValue+1; } @SuppressWarnings("unused") private EFeatureEvalMode(EFeatureEvalMode swigEnum) { this.swigValue = swigEnum.swigValue; SwigNext.next = this.swigValue+1; } private final int swigValue; private static class SwigNext { private static int next = 0; } }
0
java-sources/ai/catboost/catboost-spark_2.11/0.25-rc3/ru/yandex/catboost/spark/catboost4j_spark/core/src
java-sources/ai/catboost/catboost-spark_2.11/0.25-rc3/ru/yandex/catboost/spark/catboost4j_spark/core/src/native_impl/EFeatureType.java
/* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ package ru.yandex.catboost.spark.catboost4j_spark.core.src.native_impl; public enum EFeatureType { Float, Categorical, Text, Embedding; public final int swigValue() { return swigValue; } public static EFeatureType swigToEnum(int swigValue) { EFeatureType[] swigValues = EFeatureType.class.getEnumConstants(); if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) return swigValues[swigValue]; for (EFeatureType swigEnum : swigValues) if (swigEnum.swigValue == swigValue) return swigEnum; throw new IllegalArgumentException("No enum " + EFeatureType.class + " with value " + swigValue); } @SuppressWarnings("unused") private EFeatureType() { this.swigValue = SwigNext.next++; } @SuppressWarnings("unused") private EFeatureType(int swigValue) { this.swigValue = swigValue; SwigNext.next = swigValue+1; } @SuppressWarnings("unused") private EFeatureType(EFeatureType swigEnum) { this.swigValue = swigEnum.swigValue; SwigNext.next = this.swigValue+1; } private final int swigValue; private static class SwigNext { private static int next = 0; } }
0
java-sources/ai/catboost/catboost-spark_2.11/0.25-rc3/ru/yandex/catboost/spark/catboost4j_spark/core/src
java-sources/ai/catboost/catboost-spark_2.11/0.25-rc3/ru/yandex/catboost/spark/catboost4j_spark/core/src/native_impl/EFeaturesSelectionAlgorithm.java
/* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ package ru.yandex.catboost.spark.catboost4j_spark.core.src.native_impl; public enum EFeaturesSelectionAlgorithm { RecursiveByPredictionValuesChange, RecursiveByLossFunctionChange, RecursiveByShapValues; public final int swigValue() { return swigValue; } public static EFeaturesSelectionAlgorithm swigToEnum(int swigValue) { EFeaturesSelectionAlgorithm[] swigValues = EFeaturesSelectionAlgorithm.class.getEnumConstants(); if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) return swigValues[swigValue]; for (EFeaturesSelectionAlgorithm swigEnum : swigValues) if (swigEnum.swigValue == swigValue) return swigEnum; throw new IllegalArgumentException("No enum " + EFeaturesSelectionAlgorithm.class + " with value " + swigValue); } @SuppressWarnings("unused") private EFeaturesSelectionAlgorithm() { this.swigValue = SwigNext.next++; } @SuppressWarnings("unused") private EFeaturesSelectionAlgorithm(int swigValue) { this.swigValue = swigValue; SwigNext.next = swigValue+1; } @SuppressWarnings("unused") private EFeaturesSelectionAlgorithm(EFeaturesSelectionAlgorithm swigEnum) { this.swigValue = swigEnum.swigValue; SwigNext.next = this.swigValue+1; } private final int swigValue; private static class SwigNext { private static int next = 0; } }
0
java-sources/ai/catboost/catboost-spark_2.11/0.25-rc3/ru/yandex/catboost/spark/catboost4j_spark/core/src
java-sources/ai/catboost/catboost-spark_2.11/0.25-rc3/ru/yandex/catboost/spark/catboost4j_spark/core/src/native_impl/EFinalCtrComputationMode.java
/* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ package ru.yandex.catboost.spark.catboost4j_spark.core.src.native_impl; public enum EFinalCtrComputationMode { Skip, Default; public final int swigValue() { return swigValue; } public static EFinalCtrComputationMode swigToEnum(int swigValue) { EFinalCtrComputationMode[] swigValues = EFinalCtrComputationMode.class.getEnumConstants(); if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) return swigValues[swigValue]; for (EFinalCtrComputationMode swigEnum : swigValues) if (swigEnum.swigValue == swigValue) return swigEnum; throw new IllegalArgumentException("No enum " + EFinalCtrComputationMode.class + " with value " + swigValue); } @SuppressWarnings("unused") private EFinalCtrComputationMode() { this.swigValue = SwigNext.next++; } @SuppressWarnings("unused") private EFinalCtrComputationMode(int swigValue) { this.swigValue = swigValue; SwigNext.next = swigValue+1; } @SuppressWarnings("unused") private EFinalCtrComputationMode(EFinalCtrComputationMode swigEnum) { this.swigValue = swigEnum.swigValue; SwigNext.next = this.swigValue+1; } private final int swigValue; private static class SwigNext { private static int next = 0; } }
0
java-sources/ai/catboost/catboost-spark_2.11/0.25-rc3/ru/yandex/catboost/spark/catboost4j_spark/core/src
java-sources/ai/catboost/catboost-spark_2.11/0.25-rc3/ru/yandex/catboost/spark/catboost4j_spark/core/src/native_impl/EFinalFeatureCalcersComputationMode.java
/* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ package ru.yandex.catboost.spark.catboost4j_spark.core.src.native_impl; public enum EFinalFeatureCalcersComputationMode { Skip, Default; public final int swigValue() { return swigValue; } public static EFinalFeatureCalcersComputationMode swigToEnum(int swigValue) { EFinalFeatureCalcersComputationMode[] swigValues = EFinalFeatureCalcersComputationMode.class.getEnumConstants(); if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) return swigValues[swigValue]; for (EFinalFeatureCalcersComputationMode swigEnum : swigValues) if (swigEnum.swigValue == swigValue) return swigEnum; throw new IllegalArgumentException("No enum " + EFinalFeatureCalcersComputationMode.class + " with value " + swigValue); } @SuppressWarnings("unused") private EFinalFeatureCalcersComputationMode() { this.swigValue = SwigNext.next++; } @SuppressWarnings("unused") private EFinalFeatureCalcersComputationMode(int swigValue) { this.swigValue = swigValue; SwigNext.next = swigValue+1; } @SuppressWarnings("unused") private EFinalFeatureCalcersComputationMode(EFinalFeatureCalcersComputationMode swigEnum) { this.swigValue = swigEnum.swigValue; SwigNext.next = this.swigValue+1; } private final int swigValue; private static class SwigNext { private static int next = 0; } }
0
java-sources/ai/catboost/catboost-spark_2.11/0.25-rc3/ru/yandex/catboost/spark/catboost4j_spark/core/src
java-sources/ai/catboost/catboost-spark_2.11/0.25-rc3/ru/yandex/catboost/spark/catboost4j_spark/core/src/native_impl/EFstrCalculatedInFitType.java
/* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ package ru.yandex.catboost.spark.catboost4j_spark.core.src.native_impl; public enum EFstrCalculatedInFitType { PredictionValuesChange, LossFunctionChange, FeatureImportance; public final int swigValue() { return swigValue; } public static EFstrCalculatedInFitType swigToEnum(int swigValue) { EFstrCalculatedInFitType[] swigValues = EFstrCalculatedInFitType.class.getEnumConstants(); if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) return swigValues[swigValue]; for (EFstrCalculatedInFitType swigEnum : swigValues) if (swigEnum.swigValue == swigValue) return swigEnum; throw new IllegalArgumentException("No enum " + EFstrCalculatedInFitType.class + " with value " + swigValue); } @SuppressWarnings("unused") private EFstrCalculatedInFitType() { this.swigValue = SwigNext.next++; } @SuppressWarnings("unused") private EFstrCalculatedInFitType(int swigValue) { this.swigValue = swigValue; SwigNext.next = swigValue+1; } @SuppressWarnings("unused") private EFstrCalculatedInFitType(EFstrCalculatedInFitType swigEnum) { this.swigValue = swigEnum.swigValue; SwigNext.next = this.swigValue+1; } private final int swigValue; private static class SwigNext { private static int next = 0; } }
0
java-sources/ai/catboost/catboost-spark_2.11/0.25-rc3/ru/yandex/catboost/spark/catboost4j_spark/core/src
java-sources/ai/catboost/catboost-spark_2.11/0.25-rc3/ru/yandex/catboost/spark/catboost4j_spark/core/src/native_impl/EFstrType.java
/* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ package ru.yandex.catboost.spark.catboost4j_spark.core.src.native_impl; public enum EFstrType { PredictionValuesChange, LossFunctionChange, FeatureImportance, InternalFeatureImportance, Interaction, InternalInteraction, ShapValues, PredictionDiff, ShapInteractionValues; public final int swigValue() { return swigValue; } public static EFstrType swigToEnum(int swigValue) { EFstrType[] swigValues = EFstrType.class.getEnumConstants(); if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) return swigValues[swigValue]; for (EFstrType swigEnum : swigValues) if (swigEnum.swigValue == swigValue) return swigEnum; throw new IllegalArgumentException("No enum " + EFstrType.class + " with value " + swigValue); } @SuppressWarnings("unused") private EFstrType() { this.swigValue = SwigNext.next++; } @SuppressWarnings("unused") private EFstrType(int swigValue) { this.swigValue = swigValue; SwigNext.next = swigValue+1; } @SuppressWarnings("unused") private EFstrType(EFstrType swigEnum) { this.swigValue = swigEnum.swigValue; SwigNext.next = this.swigValue+1; } private final int swigValue; private static class SwigNext { private static int next = 0; } }
0
java-sources/ai/catboost/catboost-spark_2.11/0.25-rc3/ru/yandex/catboost/spark/catboost4j_spark/core/src
java-sources/ai/catboost/catboost-spark_2.11/0.25-rc3/ru/yandex/catboost/spark/catboost4j_spark/core/src/native_impl/EGpuCatFeaturesStorage.java
/* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ package ru.yandex.catboost.spark.catboost4j_spark.core.src.native_impl; public enum EGpuCatFeaturesStorage { CpuPinnedMemory, GpuRam; public final int swigValue() { return swigValue; } public static EGpuCatFeaturesStorage swigToEnum(int swigValue) { EGpuCatFeaturesStorage[] swigValues = EGpuCatFeaturesStorage.class.getEnumConstants(); if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) return swigValues[swigValue]; for (EGpuCatFeaturesStorage swigEnum : swigValues) if (swigEnum.swigValue == swigValue) return swigEnum; throw new IllegalArgumentException("No enum " + EGpuCatFeaturesStorage.class + " with value " + swigValue); } @SuppressWarnings("unused") private EGpuCatFeaturesStorage() { this.swigValue = SwigNext.next++; } @SuppressWarnings("unused") private EGpuCatFeaturesStorage(int swigValue) { this.swigValue = swigValue; SwigNext.next = swigValue+1; } @SuppressWarnings("unused") private EGpuCatFeaturesStorage(EGpuCatFeaturesStorage swigEnum) { this.swigValue = swigEnum.swigValue; SwigNext.next = this.swigValue+1; } private final int swigValue; private static class SwigNext { private static int next = 0; } }
0
java-sources/ai/catboost/catboost-spark_2.11/0.25-rc3/ru/yandex/catboost/spark/catboost4j_spark/core/src
java-sources/ai/catboost/catboost-spark_2.11/0.25-rc3/ru/yandex/catboost/spark/catboost4j_spark/core/src/native_impl/EGrowPolicy.java
/* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ package ru.yandex.catboost.spark.catboost4j_spark.core.src.native_impl; public enum EGrowPolicy { SymmetricTree, Lossguide, Depthwise, Region; public final int swigValue() { return swigValue; } public static EGrowPolicy swigToEnum(int swigValue) { EGrowPolicy[] swigValues = EGrowPolicy.class.getEnumConstants(); if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) return swigValues[swigValue]; for (EGrowPolicy swigEnum : swigValues) if (swigEnum.swigValue == swigValue) return swigEnum; throw new IllegalArgumentException("No enum " + EGrowPolicy.class + " with value " + swigValue); } @SuppressWarnings("unused") private EGrowPolicy() { this.swigValue = SwigNext.next++; } @SuppressWarnings("unused") private EGrowPolicy(int swigValue) { this.swigValue = swigValue; SwigNext.next = swigValue+1; } @SuppressWarnings("unused") private EGrowPolicy(EGrowPolicy swigEnum) { this.swigValue = swigEnum.swigValue; SwigNext.next = this.swigValue+1; } private final int swigValue; private static class SwigNext { private static int next = 0; } }
0
java-sources/ai/catboost/catboost-spark_2.11/0.25-rc3/ru/yandex/catboost/spark/catboost4j_spark/core/src
java-sources/ai/catboost/catboost-spark_2.11/0.25-rc3/ru/yandex/catboost/spark/catboost4j_spark/core/src/native_impl/EHessianType.java
/* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ package ru.yandex.catboost.spark.catboost4j_spark.core.src.native_impl; public enum EHessianType { Symmetric, Diagonal; public final int swigValue() { return swigValue; } public static EHessianType swigToEnum(int swigValue) { EHessianType[] swigValues = EHessianType.class.getEnumConstants(); if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) return swigValues[swigValue]; for (EHessianType swigEnum : swigValues) if (swigEnum.swigValue == swigValue) return swigEnum; throw new IllegalArgumentException("No enum " + EHessianType.class + " with value " + swigValue); } @SuppressWarnings("unused") private EHessianType() { this.swigValue = SwigNext.next++; } @SuppressWarnings("unused") private EHessianType(int swigValue) { this.swigValue = swigValue; SwigNext.next = swigValue+1; } @SuppressWarnings("unused") private EHessianType(EHessianType swigEnum) { this.swigValue = swigEnum.swigValue; SwigNext.next = this.swigValue+1; } private final int swigValue; private static class SwigNext { private static int next = 0; } }
0
java-sources/ai/catboost/catboost-spark_2.11/0.25-rc3/ru/yandex/catboost/spark/catboost4j_spark/core/src
java-sources/ai/catboost/catboost-spark_2.11/0.25-rc3/ru/yandex/catboost/spark/catboost4j_spark/core/src/native_impl/EKappaMetricType.java
/* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ package ru.yandex.catboost.spark.catboost4j_spark.core.src.native_impl; public enum EKappaMetricType { Cohen, Weighted; public final int swigValue() { return swigValue; } public static EKappaMetricType swigToEnum(int swigValue) { EKappaMetricType[] swigValues = EKappaMetricType.class.getEnumConstants(); if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) return swigValues[swigValue]; for (EKappaMetricType swigEnum : swigValues) if (swigEnum.swigValue == swigValue) return swigEnum; throw new IllegalArgumentException("No enum " + EKappaMetricType.class + " with value " + swigValue); } @SuppressWarnings("unused") private EKappaMetricType() { this.swigValue = SwigNext.next++; } @SuppressWarnings("unused") private EKappaMetricType(int swigValue) { this.swigValue = swigValue; SwigNext.next = swigValue+1; } @SuppressWarnings("unused") private EKappaMetricType(EKappaMetricType swigEnum) { this.swigValue = swigEnum.swigValue; SwigNext.next = this.swigValue+1; } private final int swigValue; private static class SwigNext { private static int next = 0; } }
0
java-sources/ai/catboost/catboost-spark_2.11/0.25-rc3/ru/yandex/catboost/spark/catboost4j_spark/core/src
java-sources/ai/catboost/catboost-spark_2.11/0.25-rc3/ru/yandex/catboost/spark/catboost4j_spark/core/src/native_impl/ELaunchMode.java
/* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ package ru.yandex.catboost.spark.catboost4j_spark.core.src.native_impl; public enum ELaunchMode { Train, Eval, CV; public final int swigValue() { return swigValue; } public static ELaunchMode swigToEnum(int swigValue) { ELaunchMode[] swigValues = ELaunchMode.class.getEnumConstants(); if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) return swigValues[swigValue]; for (ELaunchMode swigEnum : swigValues) if (swigEnum.swigValue == swigValue) return swigEnum; throw new IllegalArgumentException("No enum " + ELaunchMode.class + " with value " + swigValue); } @SuppressWarnings("unused") private ELaunchMode() { this.swigValue = SwigNext.next++; } @SuppressWarnings("unused") private ELaunchMode(int swigValue) { this.swigValue = swigValue; SwigNext.next = swigValue+1; } @SuppressWarnings("unused") private ELaunchMode(ELaunchMode swigEnum) { this.swigValue = swigEnum.swigValue; SwigNext.next = this.swigValue+1; } private final int swigValue; private static class SwigNext { private static int next = 0; } }
0
java-sources/ai/catboost/catboost-spark_2.11/0.25-rc3/ru/yandex/catboost/spark/catboost4j_spark/core/src
java-sources/ai/catboost/catboost-spark_2.11/0.25-rc3/ru/yandex/catboost/spark/catboost4j_spark/core/src/native_impl/ELeavesEstimation.java
/* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ package ru.yandex.catboost.spark.catboost4j_spark.core.src.native_impl; public enum ELeavesEstimation { Gradient, Newton, Exact, Simple; public final int swigValue() { return swigValue; } public static ELeavesEstimation swigToEnum(int swigValue) { ELeavesEstimation[] swigValues = ELeavesEstimation.class.getEnumConstants(); if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) return swigValues[swigValue]; for (ELeavesEstimation swigEnum : swigValues) if (swigEnum.swigValue == swigValue) return swigEnum; throw new IllegalArgumentException("No enum " + ELeavesEstimation.class + " with value " + swigValue); } @SuppressWarnings("unused") private ELeavesEstimation() { this.swigValue = SwigNext.next++; } @SuppressWarnings("unused") private ELeavesEstimation(int swigValue) { this.swigValue = swigValue; SwigNext.next = swigValue+1; } @SuppressWarnings("unused") private ELeavesEstimation(ELeavesEstimation swigEnum) { this.swigValue = swigEnum.swigValue; SwigNext.next = this.swigValue+1; } private final int swigValue; private static class SwigNext { private static int next = 0; } }
0
java-sources/ai/catboost/catboost-spark_2.11/0.25-rc3/ru/yandex/catboost/spark/catboost4j_spark/core/src
java-sources/ai/catboost/catboost-spark_2.11/0.25-rc3/ru/yandex/catboost/spark/catboost4j_spark/core/src/native_impl/ELeavesEstimationStepBacktracking.java
/* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ package ru.yandex.catboost.spark.catboost4j_spark.core.src.native_impl; public enum ELeavesEstimationStepBacktracking { No, AnyImprovement, Armijo; public final int swigValue() { return swigValue; } public static ELeavesEstimationStepBacktracking swigToEnum(int swigValue) { ELeavesEstimationStepBacktracking[] swigValues = ELeavesEstimationStepBacktracking.class.getEnumConstants(); if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) return swigValues[swigValue]; for (ELeavesEstimationStepBacktracking swigEnum : swigValues) if (swigEnum.swigValue == swigValue) return swigEnum; throw new IllegalArgumentException("No enum " + ELeavesEstimationStepBacktracking.class + " with value " + swigValue); } @SuppressWarnings("unused") private ELeavesEstimationStepBacktracking() { this.swigValue = SwigNext.next++; } @SuppressWarnings("unused") private ELeavesEstimationStepBacktracking(int swigValue) { this.swigValue = swigValue; SwigNext.next = swigValue+1; } @SuppressWarnings("unused") private ELeavesEstimationStepBacktracking(ELeavesEstimationStepBacktracking swigEnum) { this.swigValue = swigEnum.swigValue; SwigNext.next = this.swigValue+1; } private final int swigValue; private static class SwigNext { private static int next = 0; } }
0
java-sources/ai/catboost/catboost-spark_2.11/0.25-rc3/ru/yandex/catboost/spark/catboost4j_spark/core/src
java-sources/ai/catboost/catboost-spark_2.11/0.25-rc3/ru/yandex/catboost/spark/catboost4j_spark/core/src/native_impl/ELoadUnimplementedPolicy.java
/* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ package ru.yandex.catboost.spark.catboost4j_spark.core.src.native_impl; public enum ELoadUnimplementedPolicy { SkipWithWarning, Exception, ExceptionOnChange; public final int swigValue() { return swigValue; } public static ELoadUnimplementedPolicy swigToEnum(int swigValue) { ELoadUnimplementedPolicy[] swigValues = ELoadUnimplementedPolicy.class.getEnumConstants(); if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) return swigValues[swigValue]; for (ELoadUnimplementedPolicy swigEnum : swigValues) if (swigEnum.swigValue == swigValue) return swigEnum; throw new IllegalArgumentException("No enum " + ELoadUnimplementedPolicy.class + " with value " + swigValue); } @SuppressWarnings("unused") private ELoadUnimplementedPolicy() { this.swigValue = SwigNext.next++; } @SuppressWarnings("unused") private ELoadUnimplementedPolicy(int swigValue) { this.swigValue = swigValue; SwigNext.next = swigValue+1; } @SuppressWarnings("unused") private ELoadUnimplementedPolicy(ELoadUnimplementedPolicy swigEnum) { this.swigValue = swigEnum.swigValue; SwigNext.next = this.swigValue+1; } private final int swigValue; private static class SwigNext { private static int next = 0; } }
0
java-sources/ai/catboost/catboost-spark_2.11/0.25-rc3/ru/yandex/catboost/spark/catboost4j_spark/core/src
java-sources/ai/catboost/catboost-spark_2.11/0.25-rc3/ru/yandex/catboost/spark/catboost4j_spark/core/src/native_impl/ELoggingLevel.java
/* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ package ru.yandex.catboost.spark.catboost4j_spark.core.src.native_impl; public enum ELoggingLevel { Silent, Verbose, Info, Debug; public final int swigValue() { return swigValue; } public static ELoggingLevel swigToEnum(int swigValue) { ELoggingLevel[] swigValues = ELoggingLevel.class.getEnumConstants(); if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) return swigValues[swigValue]; for (ELoggingLevel swigEnum : swigValues) if (swigEnum.swigValue == swigValue) return swigEnum; throw new IllegalArgumentException("No enum " + ELoggingLevel.class + " with value " + swigValue); } @SuppressWarnings("unused") private ELoggingLevel() { this.swigValue = SwigNext.next++; } @SuppressWarnings("unused") private ELoggingLevel(int swigValue) { this.swigValue = swigValue; SwigNext.next = swigValue+1; } @SuppressWarnings("unused") private ELoggingLevel(ELoggingLevel swigEnum) { this.swigValue = swigEnum.swigValue; SwigNext.next = this.swigValue+1; } private final int swigValue; private static class SwigNext { private static int next = 0; } }
0
java-sources/ai/catboost/catboost-spark_2.11/0.25-rc3/ru/yandex/catboost/spark/catboost4j_spark/core/src
java-sources/ai/catboost/catboost-spark_2.11/0.25-rc3/ru/yandex/catboost/spark/catboost4j_spark/core/src/native_impl/ELossFunction.java
/* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ package ru.yandex.catboost.spark.catboost4j_spark.core.src.native_impl; public enum ELossFunction { Logloss, CrossEntropy, CtrFactor, RMSE, Lq, MAE, Quantile, Expectile, LogLinQuantile, MAPE, Poisson, MSLE, MedianAbsoluteError, SMAPE, Huber, Tweedie, RMSEWithUncertainty, MultiClass, MultiClassOneVsAll, PairLogit, PairLogitPairwise, YetiRank, YetiRankPairwise, QueryRMSE, QuerySoftMax, QueryCrossEntropy, StochasticFilter, StochasticRank, PythonUserDefinedPerObject, PythonUserDefinedMultiRegression, UserPerObjMetric, UserQuerywiseMetric, R2, NumErrors, FairLoss, AUC, Accuracy, BalancedAccuracy, BalancedErrorRate, BrierScore, Precision, Recall, F1, TotalF1, MCC, ZeroOneLoss, HammingLoss, HingeLoss, Kappa, WKappa, LogLikelihoodOfPrediction, NormalizedGini, PRAUC, PairAccuracy, AverageGain, QueryAverage, PFound, PrecisionAt, RecallAt, MAP, NDCG, DCG, FilteredDCG, MultiRMSE, Combination; public final int swigValue() { return swigValue; } public static ELossFunction swigToEnum(int swigValue) { ELossFunction[] swigValues = ELossFunction.class.getEnumConstants(); if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) return swigValues[swigValue]; for (ELossFunction swigEnum : swigValues) if (swigEnum.swigValue == swigValue) return swigEnum; throw new IllegalArgumentException("No enum " + ELossFunction.class + " with value " + swigValue); } @SuppressWarnings("unused") private ELossFunction() { this.swigValue = SwigNext.next++; } @SuppressWarnings("unused") private ELossFunction(int swigValue) { this.swigValue = swigValue; SwigNext.next = swigValue+1; } @SuppressWarnings("unused") private ELossFunction(ELossFunction swigEnum) { this.swigValue = swigEnum.swigValue; SwigNext.next = this.swigValue+1; } private final int swigValue; private static class SwigNext { private static int next = 0; } }
0
java-sources/ai/catboost/catboost-spark_2.11/0.25-rc3/ru/yandex/catboost/spark/catboost4j_spark/core/src
java-sources/ai/catboost/catboost-spark_2.11/0.25-rc3/ru/yandex/catboost/spark/catboost4j_spark/core/src/native_impl/EMetricBestValue.java
/* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ package ru.yandex.catboost.spark.catboost4j_spark.core.src.native_impl; public enum EMetricBestValue { Max, Min, FixedValue, Undefined; public final int swigValue() { return swigValue; } public static EMetricBestValue swigToEnum(int swigValue) { EMetricBestValue[] swigValues = EMetricBestValue.class.getEnumConstants(); if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) return swigValues[swigValue]; for (EMetricBestValue swigEnum : swigValues) if (swigEnum.swigValue == swigValue) return swigEnum; throw new IllegalArgumentException("No enum " + EMetricBestValue.class + " with value " + swigValue); } @SuppressWarnings("unused") private EMetricBestValue() { this.swigValue = SwigNext.next++; } @SuppressWarnings("unused") private EMetricBestValue(int swigValue) { this.swigValue = swigValue; SwigNext.next = swigValue+1; } @SuppressWarnings("unused") private EMetricBestValue(EMetricBestValue swigEnum) { this.swigValue = swigEnum.swigValue; SwigNext.next = this.swigValue+1; } private final int swigValue; private static class SwigNext { private static int next = 0; } }
0
java-sources/ai/catboost/catboost-spark_2.11/0.25-rc3/ru/yandex/catboost/spark/catboost4j_spark/core/src
java-sources/ai/catboost/catboost-spark_2.11/0.25-rc3/ru/yandex/catboost/spark/catboost4j_spark/core/src/native_impl/EModelShrinkMode.java
/* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ package ru.yandex.catboost.spark.catboost4j_spark.core.src.native_impl; public enum EModelShrinkMode { Constant, Decreasing; public final int swigValue() { return swigValue; } public static EModelShrinkMode swigToEnum(int swigValue) { EModelShrinkMode[] swigValues = EModelShrinkMode.class.getEnumConstants(); if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) return swigValues[swigValue]; for (EModelShrinkMode swigEnum : swigValues) if (swigEnum.swigValue == swigValue) return swigEnum; throw new IllegalArgumentException("No enum " + EModelShrinkMode.class + " with value " + swigValue); } @SuppressWarnings("unused") private EModelShrinkMode() { this.swigValue = SwigNext.next++; } @SuppressWarnings("unused") private EModelShrinkMode(int swigValue) { this.swigValue = swigValue; SwigNext.next = swigValue+1; } @SuppressWarnings("unused") private EModelShrinkMode(EModelShrinkMode swigEnum) { this.swigValue = swigEnum.swigValue; SwigNext.next = this.swigValue+1; } private final int swigValue; private static class SwigNext { private static int next = 0; } }
0
java-sources/ai/catboost/catboost-spark_2.11/0.25-rc3/ru/yandex/catboost/spark/catboost4j_spark/core/src
java-sources/ai/catboost/catboost-spark_2.11/0.25-rc3/ru/yandex/catboost/spark/catboost4j_spark/core/src/native_impl/EModelType.java
/* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ package ru.yandex.catboost.spark.catboost4j_spark.core.src.native_impl; public enum EModelType { CatboostBinary(0), AppleCoreML(1), Cpp(2), Python(3), Json(4), Onnx(5), Pmml(6), CPUSnapshot(7); public final int swigValue() { return swigValue; } public static EModelType swigToEnum(int swigValue) { EModelType[] swigValues = EModelType.class.getEnumConstants(); if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) return swigValues[swigValue]; for (EModelType swigEnum : swigValues) if (swigEnum.swigValue == swigValue) return swigEnum; throw new IllegalArgumentException("No enum " + EModelType.class + " with value " + swigValue); } @SuppressWarnings("unused") private EModelType() { this.swigValue = SwigNext.next++; } @SuppressWarnings("unused") private EModelType(int swigValue) { this.swigValue = swigValue; SwigNext.next = swigValue+1; } @SuppressWarnings("unused") private EModelType(EModelType swigEnum) { this.swigValue = swigEnum.swigValue; SwigNext.next = this.swigValue+1; } private final int swigValue; private static class SwigNext { private static int next = 0; } }
0
java-sources/ai/catboost/catboost-spark_2.11/0.25-rc3/ru/yandex/catboost/spark/catboost4j_spark/core/src
java-sources/ai/catboost/catboost-spark_2.11/0.25-rc3/ru/yandex/catboost/spark/catboost4j_spark/core/src/native_impl/ENanMode.java
/* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ package ru.yandex.catboost.spark.catboost4j_spark.core.src.native_impl; public enum ENanMode { Min, Max, Forbidden; public final int swigValue() { return swigValue; } public static ENanMode swigToEnum(int swigValue) { ENanMode[] swigValues = ENanMode.class.getEnumConstants(); if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) return swigValues[swigValue]; for (ENanMode swigEnum : swigValues) if (swigEnum.swigValue == swigValue) return swigEnum; throw new IllegalArgumentException("No enum " + ENanMode.class + " with value " + swigValue); } @SuppressWarnings("unused") private ENanMode() { this.swigValue = SwigNext.next++; } @SuppressWarnings("unused") private ENanMode(int swigValue) { this.swigValue = swigValue; SwigNext.next = swigValue+1; } @SuppressWarnings("unused") private ENanMode(ENanMode swigEnum) { this.swigValue = swigEnum.swigValue; SwigNext.next = this.swigValue+1; } private final int swigValue; private static class SwigNext { private static int next = 0; } }
0
java-sources/ai/catboost/catboost-spark_2.11/0.25-rc3/ru/yandex/catboost/spark/catboost4j_spark/core/src
java-sources/ai/catboost/catboost-spark_2.11/0.25-rc3/ru/yandex/catboost/spark/catboost4j_spark/core/src/native_impl/ENdcgDenominatorType.java
/* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ package ru.yandex.catboost.spark.catboost4j_spark.core.src.native_impl; public enum ENdcgDenominatorType { LogPosition, Position; public final int swigValue() { return swigValue; } public static ENdcgDenominatorType swigToEnum(int swigValue) { ENdcgDenominatorType[] swigValues = ENdcgDenominatorType.class.getEnumConstants(); if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) return swigValues[swigValue]; for (ENdcgDenominatorType swigEnum : swigValues) if (swigEnum.swigValue == swigValue) return swigEnum; throw new IllegalArgumentException("No enum " + ENdcgDenominatorType.class + " with value " + swigValue); } @SuppressWarnings("unused") private ENdcgDenominatorType() { this.swigValue = SwigNext.next++; } @SuppressWarnings("unused") private ENdcgDenominatorType(int swigValue) { this.swigValue = swigValue; SwigNext.next = swigValue+1; } @SuppressWarnings("unused") private ENdcgDenominatorType(ENdcgDenominatorType swigEnum) { this.swigValue = swigEnum.swigValue; SwigNext.next = this.swigValue+1; } private final int swigValue; private static class SwigNext { private static int next = 0; } }
0
java-sources/ai/catboost/catboost-spark_2.11/0.25-rc3/ru/yandex/catboost/spark/catboost4j_spark/core/src
java-sources/ai/catboost/catboost-spark_2.11/0.25-rc3/ru/yandex/catboost/spark/catboost4j_spark/core/src/native_impl/ENdcgMetricType.java
/* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ package ru.yandex.catboost.spark.catboost4j_spark.core.src.native_impl; public enum ENdcgMetricType { Base, Exp; public final int swigValue() { return swigValue; } public static ENdcgMetricType swigToEnum(int swigValue) { ENdcgMetricType[] swigValues = ENdcgMetricType.class.getEnumConstants(); if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) return swigValues[swigValue]; for (ENdcgMetricType swigEnum : swigValues) if (swigEnum.swigValue == swigValue) return swigEnum; throw new IllegalArgumentException("No enum " + ENdcgMetricType.class + " with value " + swigValue); } @SuppressWarnings("unused") private ENdcgMetricType() { this.swigValue = SwigNext.next++; } @SuppressWarnings("unused") private ENdcgMetricType(int swigValue) { this.swigValue = swigValue; SwigNext.next = swigValue+1; } @SuppressWarnings("unused") private ENdcgMetricType(ENdcgMetricType swigEnum) { this.swigValue = swigEnum.swigValue; SwigNext.next = this.swigValue+1; } private final int swigValue; private static class SwigNext { private static int next = 0; } }
0
java-sources/ai/catboost/catboost-spark_2.11/0.25-rc3/ru/yandex/catboost/spark/catboost4j_spark/core/src
java-sources/ai/catboost/catboost-spark_2.11/0.25-rc3/ru/yandex/catboost/spark/catboost4j_spark/core/src/native_impl/ENodeType.java
/* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ package ru.yandex.catboost.spark.catboost4j_spark.core.src.native_impl; public enum ENodeType { Master, SingleHost; public final int swigValue() { return swigValue; } public static ENodeType swigToEnum(int swigValue) { ENodeType[] swigValues = ENodeType.class.getEnumConstants(); if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) return swigValues[swigValue]; for (ENodeType swigEnum : swigValues) if (swigEnum.swigValue == swigValue) return swigEnum; throw new IllegalArgumentException("No enum " + ENodeType.class + " with value " + swigValue); } @SuppressWarnings("unused") private ENodeType() { this.swigValue = SwigNext.next++; } @SuppressWarnings("unused") private ENodeType(int swigValue) { this.swigValue = swigValue; SwigNext.next = swigValue+1; } @SuppressWarnings("unused") private ENodeType(ENodeType swigEnum) { this.swigValue = swigEnum.swigValue; SwigNext.next = this.swigValue+1; } private final int swigValue; private static class SwigNext { private static int next = 0; } }
0
java-sources/ai/catboost/catboost-spark_2.11/0.25-rc3/ru/yandex/catboost/spark/catboost4j_spark/core/src
java-sources/ai/catboost/catboost-spark_2.11/0.25-rc3/ru/yandex/catboost/spark/catboost4j_spark/core/src/native_impl/EObservationsToBootstrap.java
/* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ package ru.yandex.catboost.spark.catboost4j_spark.core.src.native_impl; public enum EObservationsToBootstrap { LearnAndTest, TestOnly; public final int swigValue() { return swigValue; } public static EObservationsToBootstrap swigToEnum(int swigValue) { EObservationsToBootstrap[] swigValues = EObservationsToBootstrap.class.getEnumConstants(); if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) return swigValues[swigValue]; for (EObservationsToBootstrap swigEnum : swigValues) if (swigEnum.swigValue == swigValue) return swigEnum; throw new IllegalArgumentException("No enum " + EObservationsToBootstrap.class + " with value " + swigValue); } @SuppressWarnings("unused") private EObservationsToBootstrap() { this.swigValue = SwigNext.next++; } @SuppressWarnings("unused") private EObservationsToBootstrap(int swigValue) { this.swigValue = swigValue; SwigNext.next = swigValue+1; } @SuppressWarnings("unused") private EObservationsToBootstrap(EObservationsToBootstrap swigEnum) { this.swigValue = swigEnum.swigValue; SwigNext.next = this.swigValue+1; } private final int swigValue; private static class SwigNext { private static int next = 0; } }
0
java-sources/ai/catboost/catboost-spark_2.11/0.25-rc3/ru/yandex/catboost/spark/catboost4j_spark/core/src
java-sources/ai/catboost/catboost-spark_2.11/0.25-rc3/ru/yandex/catboost/spark/catboost4j_spark/core/src/native_impl/EOverfittingDetectorType.java
/* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ package ru.yandex.catboost.spark.catboost4j_spark.core.src.native_impl; public enum EOverfittingDetectorType { None, Wilcoxon, IncToDec, Iter; public final int swigValue() { return swigValue; } public static EOverfittingDetectorType swigToEnum(int swigValue) { EOverfittingDetectorType[] swigValues = EOverfittingDetectorType.class.getEnumConstants(); if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) return swigValues[swigValue]; for (EOverfittingDetectorType swigEnum : swigValues) if (swigEnum.swigValue == swigValue) return swigEnum; throw new IllegalArgumentException("No enum " + EOverfittingDetectorType.class + " with value " + swigValue); } @SuppressWarnings("unused") private EOverfittingDetectorType() { this.swigValue = SwigNext.next++; } @SuppressWarnings("unused") private EOverfittingDetectorType(int swigValue) { this.swigValue = swigValue; SwigNext.next = swigValue+1; } @SuppressWarnings("unused") private EOverfittingDetectorType(EOverfittingDetectorType swigEnum) { this.swigValue = swigEnum.swigValue; SwigNext.next = this.swigValue+1; } private final int swigValue; private static class SwigNext { private static int next = 0; } }
0
java-sources/ai/catboost/catboost-spark_2.11/0.25-rc3/ru/yandex/catboost/spark/catboost4j_spark/core/src
java-sources/ai/catboost/catboost-spark_2.11/0.25-rc3/ru/yandex/catboost/spark/catboost4j_spark/core/src/native_impl/EPreCalcShapValues.java
/* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ package ru.yandex.catboost.spark.catboost4j_spark.core.src.native_impl; public enum EPreCalcShapValues { Auto, UsePreCalc, NoPreCalc; public final int swigValue() { return swigValue; } public static EPreCalcShapValues swigToEnum(int swigValue) { EPreCalcShapValues[] swigValues = EPreCalcShapValues.class.getEnumConstants(); if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) return swigValues[swigValue]; for (EPreCalcShapValues swigEnum : swigValues) if (swigEnum.swigValue == swigValue) return swigEnum; throw new IllegalArgumentException("No enum " + EPreCalcShapValues.class + " with value " + swigValue); } @SuppressWarnings("unused") private EPreCalcShapValues() { this.swigValue = SwigNext.next++; } @SuppressWarnings("unused") private EPreCalcShapValues(int swigValue) { this.swigValue = swigValue; SwigNext.next = swigValue+1; } @SuppressWarnings("unused") private EPreCalcShapValues(EPreCalcShapValues swigEnum) { this.swigValue = swigEnum.swigValue; SwigNext.next = this.swigValue+1; } private final int swigValue; private static class SwigNext { private static int next = 0; } }
0
java-sources/ai/catboost/catboost-spark_2.11/0.25-rc3/ru/yandex/catboost/spark/catboost4j_spark/core/src
java-sources/ai/catboost/catboost-spark_2.11/0.25-rc3/ru/yandex/catboost/spark/catboost4j_spark/core/src/native_impl/EPredictionType.java
/* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ package ru.yandex.catboost.spark.catboost4j_spark.core.src.native_impl; public enum EPredictionType { Probability, LogProbability, Class, RawFormulaVal, Exponent, RMSEWithUncertainty, InternalRawFormulaVal, VirtEnsembles, TotalUncertainty; public final int swigValue() { return swigValue; } public static EPredictionType swigToEnum(int swigValue) { EPredictionType[] swigValues = EPredictionType.class.getEnumConstants(); if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) return swigValues[swigValue]; for (EPredictionType swigEnum : swigValues) if (swigEnum.swigValue == swigValue) return swigEnum; throw new IllegalArgumentException("No enum " + EPredictionType.class + " with value " + swigValue); } @SuppressWarnings("unused") private EPredictionType() { this.swigValue = SwigNext.next++; } @SuppressWarnings("unused") private EPredictionType(int swigValue) { this.swigValue = swigValue; SwigNext.next = swigValue+1; } @SuppressWarnings("unused") private EPredictionType(EPredictionType swigEnum) { this.swigValue = swigEnum.swigValue; SwigNext.next = this.swigValue+1; } private final int swigValue; private static class SwigNext { private static int next = 0; } }
0
java-sources/ai/catboost/catboost-spark_2.11/0.25-rc3/ru/yandex/catboost/spark/catboost4j_spark/core/src
java-sources/ai/catboost/catboost-spark_2.11/0.25-rc3/ru/yandex/catboost/spark/catboost4j_spark/core/src/native_impl/EPriorEstimation.java
/* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ package ru.yandex.catboost.spark.catboost4j_spark.core.src.native_impl; public enum EPriorEstimation { No, BetaPrior; public final int swigValue() { return swigValue; } public static EPriorEstimation swigToEnum(int swigValue) { EPriorEstimation[] swigValues = EPriorEstimation.class.getEnumConstants(); if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) return swigValues[swigValue]; for (EPriorEstimation swigEnum : swigValues) if (swigEnum.swigValue == swigValue) return swigEnum; throw new IllegalArgumentException("No enum " + EPriorEstimation.class + " with value " + swigValue); } @SuppressWarnings("unused") private EPriorEstimation() { this.swigValue = SwigNext.next++; } @SuppressWarnings("unused") private EPriorEstimation(int swigValue) { this.swigValue = swigValue; SwigNext.next = swigValue+1; } @SuppressWarnings("unused") private EPriorEstimation(EPriorEstimation swigEnum) { this.swigValue = swigEnum.swigValue; SwigNext.next = this.swigValue+1; } private final int swigValue; private static class SwigNext { private static int next = 0; } }
0
java-sources/ai/catboost/catboost-spark_2.11/0.25-rc3/ru/yandex/catboost/spark/catboost4j_spark/core/src
java-sources/ai/catboost/catboost-spark_2.11/0.25-rc3/ru/yandex/catboost/spark/catboost4j_spark/core/src/native_impl/EProjectionType.java
/* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ package ru.yandex.catboost.spark.catboost4j_spark.core.src.native_impl; public enum EProjectionType { TreeCtr, SimpleCtr; public final int swigValue() { return swigValue; } public static EProjectionType swigToEnum(int swigValue) { EProjectionType[] swigValues = EProjectionType.class.getEnumConstants(); if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) return swigValues[swigValue]; for (EProjectionType swigEnum : swigValues) if (swigEnum.swigValue == swigValue) return swigEnum; throw new IllegalArgumentException("No enum " + EProjectionType.class + " with value " + swigValue); } @SuppressWarnings("unused") private EProjectionType() { this.swigValue = SwigNext.next++; } @SuppressWarnings("unused") private EProjectionType(int swigValue) { this.swigValue = swigValue; SwigNext.next = swigValue+1; } @SuppressWarnings("unused") private EProjectionType(EProjectionType swigEnum) { this.swigValue = swigEnum.swigValue; SwigNext.next = this.swigValue+1; } private final int swigValue; private static class SwigNext { private static int next = 0; } }
0
java-sources/ai/catboost/catboost-spark_2.11/0.25-rc3/ru/yandex/catboost/spark/catboost4j_spark/core/src
java-sources/ai/catboost/catboost-spark_2.11/0.25-rc3/ru/yandex/catboost/spark/catboost4j_spark/core/src/native_impl/ERankingType.java
/* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ package ru.yandex.catboost.spark.catboost4j_spark.core.src.native_impl; public enum ERankingType { CrossEntropy, AbsoluteValue, Order; public final int swigValue() { return swigValue; } public static ERankingType swigToEnum(int swigValue) { ERankingType[] swigValues = ERankingType.class.getEnumConstants(); if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) return swigValues[swigValue]; for (ERankingType swigEnum : swigValues) if (swigEnum.swigValue == swigValue) return swigEnum; throw new IllegalArgumentException("No enum " + ERankingType.class + " with value " + swigValue); } @SuppressWarnings("unused") private ERankingType() { this.swigValue = SwigNext.next++; } @SuppressWarnings("unused") private ERankingType(int swigValue) { this.swigValue = swigValue; SwigNext.next = swigValue+1; } @SuppressWarnings("unused") private ERankingType(ERankingType swigEnum) { this.swigValue = swigEnum.swigValue; SwigNext.next = this.swigValue+1; } private final int swigValue; private static class SwigNext { private static int next = 0; } }
0
java-sources/ai/catboost/catboost-spark_2.11/0.25-rc3/ru/yandex/catboost/spark/catboost4j_spark/core/src
java-sources/ai/catboost/catboost-spark_2.11/0.25-rc3/ru/yandex/catboost/spark/catboost4j_spark/core/src/native_impl/ERawTargetType.java
/* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ package ru.yandex.catboost.spark.catboost4j_spark.core.src.native_impl; public enum ERawTargetType { Integer, Float, String, None; public final int swigValue() { return swigValue; } public static ERawTargetType swigToEnum(int swigValue) { ERawTargetType[] swigValues = ERawTargetType.class.getEnumConstants(); if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) return swigValues[swigValue]; for (ERawTargetType swigEnum : swigValues) if (swigEnum.swigValue == swigValue) return swigEnum; throw new IllegalArgumentException("No enum " + ERawTargetType.class + " with value " + swigValue); } @SuppressWarnings("unused") private ERawTargetType() { this.swigValue = SwigNext.next++; } @SuppressWarnings("unused") private ERawTargetType(int swigValue) { this.swigValue = swigValue; SwigNext.next = swigValue+1; } @SuppressWarnings("unused") private ERawTargetType(ERawTargetType swigEnum) { this.swigValue = swigEnum.swigValue; SwigNext.next = this.swigValue+1; } private final int swigValue; private static class SwigNext { private static int next = 0; } }
0
java-sources/ai/catboost/catboost-spark_2.11/0.25-rc3/ru/yandex/catboost/spark/catboost4j_spark/core/src
java-sources/ai/catboost/catboost-spark_2.11/0.25-rc3/ru/yandex/catboost/spark/catboost4j_spark/core/src/native_impl/ESamplingFrequency.java
/* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ package ru.yandex.catboost.spark.catboost4j_spark.core.src.native_impl; public enum ESamplingFrequency { PerTree, PerTreeLevel; public final int swigValue() { return swigValue; } public static ESamplingFrequency swigToEnum(int swigValue) { ESamplingFrequency[] swigValues = ESamplingFrequency.class.getEnumConstants(); if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) return swigValues[swigValue]; for (ESamplingFrequency swigEnum : swigValues) if (swigEnum.swigValue == swigValue) return swigEnum; throw new IllegalArgumentException("No enum " + ESamplingFrequency.class + " with value " + swigValue); } @SuppressWarnings("unused") private ESamplingFrequency() { this.swigValue = SwigNext.next++; } @SuppressWarnings("unused") private ESamplingFrequency(int swigValue) { this.swigValue = swigValue; SwigNext.next = swigValue+1; } @SuppressWarnings("unused") private ESamplingFrequency(ESamplingFrequency swigEnum) { this.swigValue = swigEnum.swigValue; SwigNext.next = this.swigValue+1; } private final int swigValue; private static class SwigNext { private static int next = 0; } }
0
java-sources/ai/catboost/catboost-spark_2.11/0.25-rc3/ru/yandex/catboost/spark/catboost4j_spark/core/src
java-sources/ai/catboost/catboost-spark_2.11/0.25-rc3/ru/yandex/catboost/spark/catboost4j_spark/core/src/native_impl/ESamplingUnit.java
/* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ package ru.yandex.catboost.spark.catboost4j_spark.core.src.native_impl; public enum ESamplingUnit { Object, Group; public final int swigValue() { return swigValue; } public static ESamplingUnit swigToEnum(int swigValue) { ESamplingUnit[] swigValues = ESamplingUnit.class.getEnumConstants(); if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) return swigValues[swigValue]; for (ESamplingUnit swigEnum : swigValues) if (swigEnum.swigValue == swigValue) return swigEnum; throw new IllegalArgumentException("No enum " + ESamplingUnit.class + " with value " + swigValue); } @SuppressWarnings("unused") private ESamplingUnit() { this.swigValue = SwigNext.next++; } @SuppressWarnings("unused") private ESamplingUnit(int swigValue) { this.swigValue = swigValue; SwigNext.next = swigValue+1; } @SuppressWarnings("unused") private ESamplingUnit(ESamplingUnit swigEnum) { this.swigValue = swigEnum.swigValue; SwigNext.next = this.swigValue+1; } private final int swigValue; private static class SwigNext { private static int next = 0; } }
0
java-sources/ai/catboost/catboost-spark_2.11/0.25-rc3/ru/yandex/catboost/spark/catboost4j_spark/core/src
java-sources/ai/catboost/catboost-spark_2.11/0.25-rc3/ru/yandex/catboost/spark/catboost4j_spark/core/src/native_impl/EScoreFunction.java
/* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ package ru.yandex.catboost.spark.catboost4j_spark.core.src.native_impl; public enum EScoreFunction { SolarL2, Cosine, NewtonL2, NewtonCosine, LOOL2, SatL2, L2; public final int swigValue() { return swigValue; } public static EScoreFunction swigToEnum(int swigValue) { EScoreFunction[] swigValues = EScoreFunction.class.getEnumConstants(); if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) return swigValues[swigValue]; for (EScoreFunction swigEnum : swigValues) if (swigEnum.swigValue == swigValue) return swigEnum; throw new IllegalArgumentException("No enum " + EScoreFunction.class + " with value " + swigValue); } @SuppressWarnings("unused") private EScoreFunction() { this.swigValue = SwigNext.next++; } @SuppressWarnings("unused") private EScoreFunction(int swigValue) { this.swigValue = swigValue; SwigNext.next = swigValue+1; } @SuppressWarnings("unused") private EScoreFunction(EScoreFunction swigEnum) { this.swigValue = swigEnum.swigValue; SwigNext.next = this.swigValue+1; } private final int swigValue; private static class SwigNext { private static int next = 0; } }
0
java-sources/ai/catboost/catboost-spark_2.11/0.25-rc3/ru/yandex/catboost/spark/catboost4j_spark/core/src
java-sources/ai/catboost/catboost-spark_2.11/0.25-rc3/ru/yandex/catboost/spark/catboost4j_spark/core/src/native_impl/ETaskType.java
/* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ package ru.yandex.catboost.spark.catboost4j_spark.core.src.native_impl; public enum ETaskType { GPU, CPU; public final int swigValue() { return swigValue; } public static ETaskType swigToEnum(int swigValue) { ETaskType[] swigValues = ETaskType.class.getEnumConstants(); if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) return swigValues[swigValue]; for (ETaskType swigEnum : swigValues) if (swigEnum.swigValue == swigValue) return swigEnum; throw new IllegalArgumentException("No enum " + ETaskType.class + " with value " + swigValue); } @SuppressWarnings("unused") private ETaskType() { this.swigValue = SwigNext.next++; } @SuppressWarnings("unused") private ETaskType(int swigValue) { this.swigValue = swigValue; SwigNext.next = swigValue+1; } @SuppressWarnings("unused") private ETaskType(ETaskType swigEnum) { this.swigValue = swigEnum.swigValue; SwigNext.next = this.swigValue+1; } private final int swigValue; private static class SwigNext { private static int next = 0; } }
0
java-sources/ai/catboost/catboost-spark_2.11/0.25-rc3/ru/yandex/catboost/spark/catboost4j_spark/core/src
java-sources/ai/catboost/catboost-spark_2.11/0.25-rc3/ru/yandex/catboost/spark/catboost4j_spark/core/src/native_impl/IJVMLineDataReader.java
/* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ package ru.yandex.catboost.spark.catboost4j_spark.core.src.native_impl; public class IJVMLineDataReader extends ILineDataReader { private transient long swigCPtr; protected IJVMLineDataReader(long cPtr, boolean cMemoryOwn) { super(native_implJNI.IJVMLineDataReader_SWIGUpcast(cPtr), cMemoryOwn); swigCPtr = cPtr; } protected static long getCPtr(IJVMLineDataReader obj) { return (obj == null) ? 0 : obj.swigCPtr; } @SuppressWarnings("deprecation") protected void finalize() { delete(); } public synchronized void delete() { if (swigCPtr != 0) { if (swigCMemOwn) { swigCMemOwn = false; native_implJNI.delete_IJVMLineDataReader(swigCPtr); } swigCPtr = 0; } super.delete(); } protected void swigDirectorDisconnect() { swigCMemOwn = false; delete(); } public void swigReleaseOwnership() { swigCMemOwn = false; native_implJNI.IJVMLineDataReader_change_ownership(this, swigCPtr, false); } public void swigTakeOwnership() { swigCMemOwn = true; native_implJNI.IJVMLineDataReader_change_ownership(this, swigCPtr, true); } public boolean ReadLine(SWIGTYPE_p_TString line) { return (getClass() == IJVMLineDataReader.class) ? native_implJNI.IJVMLineDataReader_ReadLine__SWIG_0(swigCPtr, this, SWIGTYPE_p_TString.getCPtr(line)) : native_implJNI.IJVMLineDataReader_ReadLineSwigExplicitIJVMLineDataReader__SWIG_0(swigCPtr, this, SWIGTYPE_p_TString.getCPtr(line)); } public boolean ReadLine(SWIGTYPE_p_TString arg0, SWIGTYPE_p_TString arg1) { return (getClass() == IJVMLineDataReader.class) ? native_implJNI.IJVMLineDataReader_ReadLine__SWIG_1(swigCPtr, this, SWIGTYPE_p_TString.getCPtr(arg0), SWIGTYPE_p_TString.getCPtr(arg1)) : native_implJNI.IJVMLineDataReader_ReadLineSwigExplicitIJVMLineDataReader__SWIG_1(swigCPtr, this, SWIGTYPE_p_TString.getCPtr(arg0), SWIGTYPE_p_TString.getCPtr(arg1)); } public boolean ReadLineJVM(TStringOutWrapper line) { return native_implJNI.IJVMLineDataReader_ReadLineJVM(swigCPtr, this, TStringOutWrapper.getCPtr(line), line); } public IJVMLineDataReader() { this(native_implJNI.new_IJVMLineDataReader(), true); native_implJNI.IJVMLineDataReader_director_connect(this, swigCPtr, true, true); } }
0
java-sources/ai/catboost/catboost-spark_2.11/0.25-rc3/ru/yandex/catboost/spark/catboost4j_spark/core/src
java-sources/ai/catboost/catboost-spark_2.11/0.25-rc3/ru/yandex/catboost/spark/catboost4j_spark/core/src/native_impl/ILineDataReader.java
/* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ package ru.yandex.catboost.spark.catboost4j_spark.core.src.native_impl; public class ILineDataReader { private transient long swigCPtr; protected transient boolean swigCMemOwn; protected ILineDataReader(long cPtr, boolean cMemoryOwn) { swigCMemOwn = cMemoryOwn; swigCPtr = cPtr; } protected static long getCPtr(ILineDataReader obj) { return (obj == null) ? 0 : obj.swigCPtr; } @SuppressWarnings("deprecation") protected void finalize() { delete(); } public synchronized void delete() { if (swigCPtr != 0) { if (swigCMemOwn) { swigCMemOwn = false; native_implJNI.delete_ILineDataReader(swigCPtr); } swigCPtr = 0; } } protected void swigDirectorDisconnect() { swigCMemOwn = false; delete(); } public void swigReleaseOwnership() { swigCMemOwn = false; native_implJNI.ILineDataReader_change_ownership(this, swigCPtr, false); } public void swigTakeOwnership() { swigCMemOwn = true; native_implJNI.ILineDataReader_change_ownership(this, swigCPtr, true); } public java.math.BigInteger GetDataLineCount() { return native_implJNI.ILineDataReader_GetDataLineCount(swigCPtr, this); } public TMaybe_TString GetHeader() { return new TMaybe_TString(native_implJNI.ILineDataReader_GetHeader(swigCPtr, this), true); } public boolean ReadLine(SWIGTYPE_p_TString line) { return native_implJNI.ILineDataReader_ReadLine__SWIG_0(swigCPtr, this, SWIGTYPE_p_TString.getCPtr(line)); } public boolean ReadLine(SWIGTYPE_p_TString arg0, SWIGTYPE_p_TString arg1) { return native_implJNI.ILineDataReader_ReadLine__SWIG_1(swigCPtr, this, SWIGTYPE_p_TString.getCPtr(arg0), SWIGTYPE_p_TString.getCPtr(arg1)); } public ILineDataReader() { this(native_implJNI.new_ILineDataReader(), true); native_implJNI.ILineDataReader_director_connect(this, swigCPtr, true, true); } }
0
java-sources/ai/catboost/catboost-spark_2.11/0.25-rc3/ru/yandex/catboost/spark/catboost4j_spark/core/src
java-sources/ai/catboost/catboost-spark_2.11/0.25-rc3/ru/yandex/catboost/spark/catboost4j_spark/core/src/native_impl/IQuantizedFeaturesDataVisitor.java
/* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ package ru.yandex.catboost.spark.catboost4j_spark.core.src.native_impl; public class IQuantizedFeaturesDataVisitor { private transient long swigCPtr; protected transient boolean swigCMemOwn; protected IQuantizedFeaturesDataVisitor(long cPtr, boolean cMemoryOwn) { swigCMemOwn = cMemoryOwn; swigCPtr = cPtr; } protected static long getCPtr(IQuantizedFeaturesDataVisitor obj) { return (obj == null) ? 0 : obj.swigCPtr; } @SuppressWarnings("deprecation") protected void finalize() { delete(); } public synchronized void delete() { if (swigCPtr != 0) { if (swigCMemOwn) { swigCMemOwn = false; native_implJNI.delete_IQuantizedFeaturesDataVisitor(swigCPtr); } swigCPtr = 0; } } public void Start(TDataMetaInfo metaInfo, int objectCount, TQuantizedFeaturesInfo quantizedFeaturesInfo) throws Exception { native_implJNI.IQuantizedFeaturesDataVisitor_Start(swigCPtr, this, TDataMetaInfo.getCPtr(metaInfo), metaInfo, objectCount, TQuantizedFeaturesInfo.getCPtr(quantizedFeaturesInfo), quantizedFeaturesInfo); } public void AddGroupId(long[] groupIdData) throws Exception { native_implJNI.IQuantizedFeaturesDataVisitor_AddGroupId(swigCPtr, this, groupIdData); } public void AddSubgroupId(int[] subgroupIdData) throws Exception { native_implJNI.IQuantizedFeaturesDataVisitor_AddSubgroupId(swigCPtr, this, subgroupIdData); } public void AddTimestamp(long[] timestampData) throws Exception { native_implJNI.IQuantizedFeaturesDataVisitor_AddTimestamp(swigCPtr, this, timestampData); } public void AddFeature(TFeaturesLayout featuresLayout, int flatFeatureIdx, int objectCount, byte bitsPerDocumentFeature, TVector_i64 featureDataBuffer) throws Exception { native_implJNI.IQuantizedFeaturesDataVisitor_AddFeature(swigCPtr, this, TFeaturesLayout.getCPtr(featuresLayout), featuresLayout, flatFeatureIdx, objectCount, bitsPerDocumentFeature, TVector_i64.getCPtr(featureDataBuffer), featureDataBuffer); } public void AddTarget(float[] targetData) throws Exception { native_implJNI.IQuantizedFeaturesDataVisitor_AddTarget__SWIG_0(swigCPtr, this, targetData); } public void AddTarget(TVector_TString targetData) throws Exception { native_implJNI.IQuantizedFeaturesDataVisitor_AddTarget__SWIG_1(swigCPtr, this, TVector_TString.getCPtr(targetData), targetData); } public void AddBaseline(int baselineIdx, float[] baselineData) throws Exception { native_implJNI.IQuantizedFeaturesDataVisitor_AddBaseline(swigCPtr, this, baselineIdx, baselineData); } public void AddWeight(float[] weightData) throws Exception { native_implJNI.IQuantizedFeaturesDataVisitor_AddWeight(swigCPtr, this, weightData); } public void AddGroupWeight(float[] groupWeightData) throws Exception { native_implJNI.IQuantizedFeaturesDataVisitor_AddGroupWeight(swigCPtr, this, groupWeightData); } public void Finish() { native_implJNI.IQuantizedFeaturesDataVisitor_Finish(swigCPtr, this); } }
0
java-sources/ai/catboost/catboost-spark_2.11/0.25-rc3/ru/yandex/catboost/spark/catboost4j_spark/core/src
java-sources/ai/catboost/catboost-spark_2.11/0.25-rc3/ru/yandex/catboost/spark/catboost4j_spark/core/src/native_impl/QuantizedFeaturesInfoPtr.java
/* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ package ru.yandex.catboost.spark.catboost4j_spark.core.src.native_impl; import java.io.*; public class QuantizedFeaturesInfoPtr implements Serializable { private transient long swigCPtr; protected transient boolean swigCMemOwn; protected QuantizedFeaturesInfoPtr(long cPtr, boolean cMemoryOwn) { swigCMemOwn = cMemoryOwn; swigCPtr = cPtr; } protected static long getCPtr(QuantizedFeaturesInfoPtr obj) { return (obj == null) ? 0 : obj.swigCPtr; } @SuppressWarnings("deprecation") protected void finalize() { delete(); } public synchronized void delete() { if (swigCPtr != 0) { if (swigCMemOwn) { swigCMemOwn = false; native_implJNI.delete_QuantizedFeaturesInfoPtr(swigCPtr); } swigCPtr = 0; } } public TQuantizedFeaturesInfo __deref__() { long cPtr = native_implJNI.QuantizedFeaturesInfoPtr___deref__(swigCPtr, this); return (cPtr == 0) ? null : new TQuantizedFeaturesInfo(cPtr, false); } public TQuantizedFeaturesInfo Get() { long cPtr = native_implJNI.QuantizedFeaturesInfoPtr_Get(swigCPtr, this); return (cPtr == 0) ? null : new TQuantizedFeaturesInfo(cPtr, false); } public void Set(TQuantizedFeaturesInfo t) { native_implJNI.QuantizedFeaturesInfoPtr_Set(swigCPtr, this, TQuantizedFeaturesInfo.getCPtr(t), t); } public QuantizedFeaturesInfoPtr(TQuantizedFeaturesInfo pointee) { this(); if (pointee != null) { pointee.releaseMem(); this.Set(pointee); } } private void writeObject(ObjectOutputStream out) throws IOException { out.writeObject(this.Get()); } private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException { this.swigCPtr = native_implJNI.new_QuantizedFeaturesInfoPtr(); this.swigCMemOwn = true; TQuantizedFeaturesInfo pointee = (TQuantizedFeaturesInfo)in.readObject(); if (pointee != null) { pointee.releaseMem(); this.Set(pointee); } } public boolean equals(Object obj) { if (obj instanceof QuantizedFeaturesInfoPtr) { boolean ptrEqual = (((QuantizedFeaturesInfoPtr)obj).swigCPtr == this.swigCPtr); if (ptrEqual) { return true; } else { return this.equalsImpl(((QuantizedFeaturesInfoPtr)obj).Get()); } } else { return false; } } public QuantizedFeaturesInfoPtr() { this(native_implJNI.new_QuantizedFeaturesInfoPtr(), true); } public TFeaturesLayoutPtr GetFeaturesLayout() { return new TFeaturesLayoutPtr(native_implJNI.QuantizedFeaturesInfoPtr_GetFeaturesLayout(swigCPtr, this), true); } public void Init(TFeaturesLayout featuresLayout) { native_implJNI.QuantizedFeaturesInfoPtr_Init(swigCPtr, this, TFeaturesLayout.getCPtr(featuresLayout), featuresLayout); } public boolean EqualWithoutOptionsTo(TQuantizedFeaturesInfo rhs, boolean ignoreSparsity) { return native_implJNI.QuantizedFeaturesInfoPtr_EqualWithoutOptionsTo__SWIG_0(swigCPtr, this, TQuantizedFeaturesInfo.getCPtr(rhs), rhs, ignoreSparsity); } public boolean EqualWithoutOptionsTo(TQuantizedFeaturesInfo rhs) { return native_implJNI.QuantizedFeaturesInfoPtr_EqualWithoutOptionsTo__SWIG_1(swigCPtr, this, TQuantizedFeaturesInfo.getCPtr(rhs), rhs); } public ENanMode GetNanMode(int floatFeatureIdx) throws Exception { return ENanMode.swigToEnum(native_implJNI.QuantizedFeaturesInfoPtr_GetNanMode(swigCPtr, this, floatFeatureIdx)); } public void SetNanMode(int floatFeatureIdx, ENanMode nanMode) throws Exception { native_implJNI.QuantizedFeaturesInfoPtr_SetNanMode(swigCPtr, this, floatFeatureIdx, nanMode.swigValue()); } public void GetQuantization(int floatFeatureIdx, TVector_float borders, SWIGTYPE_p_bool hasDefaultQuantizedBin, TDefaultQuantizedBin defaultQuantizedBin) throws Exception { native_implJNI.QuantizedFeaturesInfoPtr_GetQuantization(swigCPtr, this, floatFeatureIdx, TVector_float.getCPtr(borders), borders, SWIGTYPE_p_bool.getCPtr(hasDefaultQuantizedBin), TDefaultQuantizedBin.getCPtr(defaultQuantizedBin), defaultQuantizedBin); } public void SetQuantization(int floatFeatureIdx, TVector_float borders, TDefaultQuantizedBin defaultQuantizedBin) throws Exception { native_implJNI.QuantizedFeaturesInfoPtr_SetQuantization__SWIG_0(swigCPtr, this, floatFeatureIdx, TVector_float.getCPtr(borders), borders, TDefaultQuantizedBin.getCPtr(defaultQuantizedBin), defaultQuantizedBin); } public void SetQuantization(int floatFeatureIdx, TVector_float borders) throws Exception { native_implJNI.QuantizedFeaturesInfoPtr_SetQuantization__SWIG_1(swigCPtr, this, floatFeatureIdx, TVector_float.getCPtr(borders), borders); } public boolean equalsImpl(TQuantizedFeaturesInfo rhs) { return native_implJNI.QuantizedFeaturesInfoPtr_equalsImpl(swigCPtr, this, TQuantizedFeaturesInfo.getCPtr(rhs), rhs); } }
0
java-sources/ai/catboost/catboost-spark_2.11/0.25-rc3/ru/yandex/catboost/spark/catboost4j_spark/core/src
java-sources/ai/catboost/catboost-spark_2.11/0.25-rc3/ru/yandex/catboost/spark/catboost4j_spark/core/src/native_impl/SWIGTYPE_p_NCB__TGroupedPairsInfo.java
/* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ package ru.yandex.catboost.spark.catboost4j_spark.core.src.native_impl; public class SWIGTYPE_p_NCB__TGroupedPairsInfo { private transient long swigCPtr; protected SWIGTYPE_p_NCB__TGroupedPairsInfo(long cPtr, @SuppressWarnings("unused") boolean futureUse) { swigCPtr = cPtr; } protected SWIGTYPE_p_NCB__TGroupedPairsInfo() { swigCPtr = 0; } protected static long getCPtr(SWIGTYPE_p_NCB__TGroupedPairsInfo obj) { return (obj == null) ? 0 : obj.swigCPtr; } }
0
java-sources/ai/catboost/catboost-spark_2.11/0.25-rc3/ru/yandex/catboost/spark/catboost4j_spark/core/src
java-sources/ai/catboost/catboost-spark_2.11/0.25-rc3/ru/yandex/catboost/spark/catboost4j_spark/core/src/native_impl/SWIGTYPE_p_NCB__TRawObjectsDataProviderPtr.java
/* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ package ru.yandex.catboost.spark.catboost4j_spark.core.src.native_impl; public class SWIGTYPE_p_NCB__TRawObjectsDataProviderPtr { private transient long swigCPtr; protected SWIGTYPE_p_NCB__TRawObjectsDataProviderPtr(long cPtr, @SuppressWarnings("unused") boolean futureUse) { swigCPtr = cPtr; } protected SWIGTYPE_p_NCB__TRawObjectsDataProviderPtr() { swigCPtr = 0; } protected static long getCPtr(SWIGTYPE_p_NCB__TRawObjectsDataProviderPtr obj) { return (obj == null) ? 0 : obj.swigCPtr; } }
0
java-sources/ai/catboost/catboost-spark_2.11/0.25-rc3/ru/yandex/catboost/spark/catboost4j_spark/core/src
java-sources/ai/catboost/catboost-spark_2.11/0.25-rc3/ru/yandex/catboost/spark/catboost4j_spark/core/src/native_impl/SWIGTYPE_p_TCtrHelper.java
/* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ package ru.yandex.catboost.spark.catboost4j_spark.core.src.native_impl; public class SWIGTYPE_p_TCtrHelper { private transient long swigCPtr; protected SWIGTYPE_p_TCtrHelper(long cPtr, @SuppressWarnings("unused") boolean futureUse) { swigCPtr = cPtr; } protected SWIGTYPE_p_TCtrHelper() { swigCPtr = 0; } protected static long getCPtr(SWIGTYPE_p_TCtrHelper obj) { return (obj == null) ? 0 : obj.swigCPtr; } }
0
java-sources/ai/catboost/catboost-spark_2.11/0.25-rc3/ru/yandex/catboost/spark/catboost4j_spark/core/src
java-sources/ai/catboost/catboost-spark_2.11/0.25-rc3/ru/yandex/catboost/spark/catboost4j_spark/core/src/native_impl/SWIGTYPE_p_TString.java
/* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ package ru.yandex.catboost.spark.catboost4j_spark.core.src.native_impl; public class SWIGTYPE_p_TString { private transient long swigCPtr; protected SWIGTYPE_p_TString(long cPtr, @SuppressWarnings("unused") boolean futureUse) { swigCPtr = cPtr; } protected SWIGTYPE_p_TString() { swigCPtr = 0; } protected static long getCPtr(SWIGTYPE_p_TString obj) { return (obj == null) ? 0 : obj.swigCPtr; } }
0
java-sources/ai/catboost/catboost-spark_2.11/0.25-rc3/ru/yandex/catboost/spark/catboost4j_spark/core/src
java-sources/ai/catboost/catboost-spark_2.11/0.25-rc3/ru/yandex/catboost/spark/catboost4j_spark/core/src/native_impl/SWIGTYPE_p_TVectorT_TVectorT_int_t_t.java
/* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ package ru.yandex.catboost.spark.catboost4j_spark.core.src.native_impl; public class SWIGTYPE_p_TVectorT_TVectorT_int_t_t { private transient long swigCPtr; protected SWIGTYPE_p_TVectorT_TVectorT_int_t_t(long cPtr, @SuppressWarnings("unused") boolean futureUse) { swigCPtr = cPtr; } protected SWIGTYPE_p_TVectorT_TVectorT_int_t_t() { swigCPtr = 0; } protected static long getCPtr(SWIGTYPE_p_TVectorT_TVectorT_int_t_t obj) { return (obj == null) ? 0 : obj.swigCPtr; } }
0
java-sources/ai/catboost/catboost-spark_2.11/0.25-rc3/ru/yandex/catboost/spark/catboost4j_spark/core/src
java-sources/ai/catboost/catboost-spark_2.11/0.25-rc3/ru/yandex/catboost/spark/catboost4j_spark/core/src/native_impl/SWIGTYPE_p_TVectorT_int_t.java
/* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ package ru.yandex.catboost.spark.catboost4j_spark.core.src.native_impl; public class SWIGTYPE_p_TVectorT_int_t { private transient long swigCPtr; protected SWIGTYPE_p_TVectorT_int_t(long cPtr, @SuppressWarnings("unused") boolean futureUse) { swigCPtr = cPtr; } protected SWIGTYPE_p_TVectorT_int_t() { swigCPtr = 0; } protected static long getCPtr(SWIGTYPE_p_TVectorT_int_t obj) { return (obj == null) ? 0 : obj.swigCPtr; } }
0
java-sources/ai/catboost/catboost-spark_2.11/0.25-rc3/ru/yandex/catboost/spark/catboost4j_spark/core/src
java-sources/ai/catboost/catboost-spark_2.11/0.25-rc3/ru/yandex/catboost/spark/catboost4j_spark/core/src/native_impl/SWIGTYPE_p_bool.java
/* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). * Version 4.0.1 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ package ru.yandex.catboost.spark.catboost4j_spark.core.src.native_impl; public class SWIGTYPE_p_bool { private transient long swigCPtr; protected SWIGTYPE_p_bool(long cPtr, @SuppressWarnings("unused") boolean futureUse) { swigCPtr = cPtr; } protected SWIGTYPE_p_bool() { swigCPtr = 0; } protected static long getCPtr(SWIGTYPE_p_bool obj) { return (obj == null) ? 0 : obj.swigCPtr; } }