Skip to content

Commit

Permalink
Add aliases to stay compatible with older Backup exports
Browse files Browse the repository at this point in the history
  • Loading branch information
Florianisme committed Jan 27, 2023
1 parent c3c1708 commit fe09bbd
Showing 1 changed file with 19 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,28 +5,47 @@
import androidx.room.Ignore;
import androidx.room.PrimaryKey;

import com.fasterxml.jackson.annotation.JsonAlias;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;

@Entity(tableName = "Devices")
@JsonIgnoreProperties(ignoreUnknown = true)
public class Device {

@PrimaryKey(autoGenerate = true)
@JsonProperty("id")
@JsonAlias("a")
public int id;

@ColumnInfo(name = "name")
@JsonProperty("name")
@JsonAlias("b")
public String name;

@ColumnInfo(name = "mac_address")
@JsonProperty("mac_address")
@JsonAlias("c")
public String macAddress;

@ColumnInfo(name = "broadcast_address")
@JsonProperty("broadcast_address")
@JsonAlias("d")
public String broadcastAddress;

@ColumnInfo(name = "port")
@JsonProperty("port")
@JsonAlias("e")
public int port;

@ColumnInfo(name = "status_ip")
@JsonProperty("status_ip")
@JsonAlias("f")
public String statusIp;

@ColumnInfo(name = "secure_on_password")
@JsonProperty("secure_on_password")
@JsonAlias("g")
public String secureOnPassword;

@Ignore
Expand Down

0 comments on commit fe09bbd

Please sign in to comment.