-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
6 changed files
with
1,216 additions
and
0 deletions.
There are no files selected for viewing
146 changes: 146 additions & 0 deletions
146
AnkiDroid/src/main/java/com/ichi2/libanki/json/model/Field.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,146 @@ | ||
|
||
package com.ichi2.libanki.json.model; | ||
|
||
import java.util.ArrayList; | ||
import java.util.HashMap; | ||
import java.util.List; | ||
import java.util.Map; | ||
import com.fasterxml.jackson.annotation.JsonAnyGetter; | ||
import com.fasterxml.jackson.annotation.JsonAnySetter; | ||
import com.fasterxml.jackson.annotation.JsonIgnore; | ||
import com.fasterxml.jackson.annotation.JsonInclude; | ||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
|
||
@JsonInclude(JsonInclude.Include.NON_NULL) | ||
public class Field { | ||
|
||
@JsonProperty("name") | ||
private String mName; | ||
@JsonProperty("ord") | ||
private long mOrd; | ||
@JsonProperty("sticky") | ||
private boolean mSticky; | ||
@JsonProperty("rtl") | ||
private boolean mRtl; | ||
@JsonProperty("font") | ||
private String mFont; | ||
@JsonProperty("size") | ||
private long mSize; | ||
@JsonProperty("media") | ||
private List<Object> mMedia = new ArrayList<Object>(); | ||
@JsonProperty("single line") | ||
private boolean mSingleLine; | ||
@JsonIgnore | ||
private final Map<String, Object> mAdditionalProperties = new HashMap<>(); | ||
|
||
/** | ||
* No args constructor for use in serialization | ||
* | ||
*/ | ||
public Field() { | ||
} | ||
|
||
|
||
public Field(String name, long ord, boolean sticky, boolean rtl, String font, long size, List<Object> media, boolean singleLine) { | ||
super(); | ||
this.mName = name; | ||
this.mOrd = ord; | ||
this.mSticky = sticky; | ||
this.mRtl = rtl; | ||
this.mFont = font; | ||
this.mSize = size; | ||
this.mMedia = media; | ||
this.mSingleLine = singleLine; | ||
} | ||
|
||
@JsonProperty("name") | ||
public String getName() { | ||
return mName; | ||
} | ||
|
||
@JsonProperty("name") | ||
public void setName(String name) { | ||
this.mName = name; | ||
} | ||
|
||
@JsonProperty("ord") | ||
public long getOrd() { | ||
return mOrd; | ||
} | ||
|
||
@JsonProperty("ord") | ||
public void setOrd(long ord) { | ||
this.mOrd = ord; | ||
} | ||
|
||
@JsonProperty("sticky") | ||
public boolean isSticky() { | ||
return mSticky; | ||
} | ||
|
||
@JsonProperty("sticky") | ||
public void setSticky(boolean sticky) { | ||
this.mSticky = sticky; | ||
} | ||
|
||
@JsonProperty("rtl") | ||
public boolean isRtl() { | ||
return mRtl; | ||
} | ||
|
||
@JsonProperty("rtl") | ||
public void setRtl(boolean rtl) { | ||
this.mRtl = rtl; | ||
} | ||
|
||
@JsonProperty("font") | ||
public String getFont() { | ||
return mFont; | ||
} | ||
|
||
@JsonProperty("font") | ||
public void setFont(String font) { | ||
this.mFont = font; | ||
} | ||
|
||
@JsonProperty("size") | ||
public long getSize() { | ||
return mSize; | ||
} | ||
|
||
@JsonProperty("size") | ||
public void setSize(long size) { | ||
this.mSize = size; | ||
} | ||
|
||
@JsonProperty("media") | ||
public List<Object> getMedia() { | ||
return mMedia; | ||
} | ||
|
||
@JsonProperty("media") | ||
public void setMedia(List<Object> media) { | ||
this.mMedia = media; | ||
} | ||
|
||
@JsonProperty("single line") | ||
public boolean isSingleLine() { | ||
return mSingleLine; | ||
} | ||
|
||
@JsonProperty("single line") | ||
public void setSingleLine(boolean singleLine) { | ||
this.mSingleLine = singleLine; | ||
} | ||
|
||
@JsonAnyGetter | ||
public Map<String, Object> getAdditionalProperties() { | ||
return this.mAdditionalProperties; | ||
} | ||
|
||
@JsonAnySetter | ||
public void setAdditionalProperty(String name, Object value) { | ||
this.mAdditionalProperties.put(name, value); | ||
} | ||
|
||
} |
Oops, something went wrong.