-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
80 changed files
with
3,003 additions
and
760 deletions.
There are no files selected for viewing
64 changes: 5 additions & 59 deletions
64
...rch-client-java-2/algoliasearch-core/com/algolia/model/BatchDictionaryEntriesRequest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
57 changes: 57 additions & 0 deletions
57
...ts/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/DictionaryAction.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
package com.algolia.model; | ||
|
||
import com.google.gson.TypeAdapter; | ||
import com.google.gson.annotations.JsonAdapter; | ||
import com.google.gson.stream.JsonReader; | ||
import com.google.gson.stream.JsonWriter; | ||
import java.io.IOException; | ||
|
||
/** Actions to perform. */ | ||
@JsonAdapter(DictionaryAction.Adapter.class) | ||
public enum DictionaryAction { | ||
ADDENTRY("addEntry"), | ||
|
||
DELETEENTRY("deleteEntry"); | ||
|
||
private String value; | ||
|
||
DictionaryAction(String value) { | ||
this.value = value; | ||
} | ||
|
||
public String getValue() { | ||
return value; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return String.valueOf(value); | ||
} | ||
|
||
public static DictionaryAction fromValue(String value) { | ||
for (DictionaryAction b : DictionaryAction.values()) { | ||
if (b.value.equals(value)) { | ||
return b; | ||
} | ||
} | ||
throw new IllegalArgumentException("Unexpected value '" + value + "'"); | ||
} | ||
|
||
public static class Adapter extends TypeAdapter<DictionaryAction> { | ||
|
||
@Override | ||
public void write( | ||
final JsonWriter jsonWriter, | ||
final DictionaryAction enumeration | ||
) throws IOException { | ||
jsonWriter.value(enumeration.getValue()); | ||
} | ||
|
||
@Override | ||
public DictionaryAction read(final JsonReader jsonReader) | ||
throws IOException { | ||
String value = jsonReader.nextString(); | ||
return DictionaryAction.fromValue(value); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
57 changes: 57 additions & 0 deletions
57
...lgoliasearch-client-java-2/algoliasearch-core/com/algolia/model/DictionaryEntryState.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
package com.algolia.model; | ||
|
||
import com.google.gson.TypeAdapter; | ||
import com.google.gson.annotations.JsonAdapter; | ||
import com.google.gson.stream.JsonReader; | ||
import com.google.gson.stream.JsonWriter; | ||
import java.io.IOException; | ||
|
||
/** The state of the dictionary entry. */ | ||
@JsonAdapter(DictionaryEntryState.Adapter.class) | ||
public enum DictionaryEntryState { | ||
ENABLED("enabled"), | ||
|
||
DISABLED("disabled"); | ||
|
||
private String value; | ||
|
||
DictionaryEntryState(String value) { | ||
this.value = value; | ||
} | ||
|
||
public String getValue() { | ||
return value; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return String.valueOf(value); | ||
} | ||
|
||
public static DictionaryEntryState fromValue(String value) { | ||
for (DictionaryEntryState b : DictionaryEntryState.values()) { | ||
if (b.value.equals(value)) { | ||
return b; | ||
} | ||
} | ||
throw new IllegalArgumentException("Unexpected value '" + value + "'"); | ||
} | ||
|
||
public static class Adapter extends TypeAdapter<DictionaryEntryState> { | ||
|
||
@Override | ||
public void write( | ||
final JsonWriter jsonWriter, | ||
final DictionaryEntryState enumeration | ||
) throws IOException { | ||
jsonWriter.value(enumeration.getValue()); | ||
} | ||
|
||
@Override | ||
public DictionaryEntryState read(final JsonReader jsonReader) | ||
throws IOException { | ||
String value = jsonReader.nextString(); | ||
return DictionaryEntryState.fromValue(value); | ||
} | ||
} | ||
} |
Oops, something went wrong.