java 类似xamarin_C#相当于Xamarin.Android的Java代码段

我试图将使用ORMLite的Android代码转换为与使用SQLite-net PCL nuget包的Xamarin.Android相当的C#。

Java:

public abstract class DTAbstractEntity {

}

import entities.DTAbstractEntity;

import com.j256.ormlite.field.DatabaseField;

public abstract class DTAbstractModelEntity extends DTAbstractEntity {

public final static String ID_FIELD_NAME = "uuid";

@DatabaseField(id = true, canBeNull = false, columnName = ID_FIELD_NAME)

protected String uuid;

@DatabaseField

protected String name;

@DatabaseField

protected String path;

@DatabaseField

protected boolean completeResponse;

/* GETTERS */

public String getUuid() { return uuid; }

public String getName() {

return name;

}

public String getPath() {

return path;

}

public boolean isCompleteResponse() {

return completeResponse;

}

}

import com.j256.ormlite.field.DatabaseField;

import com.j256.ormlite.table.DatabaseTable;

@DatabaseTable

public class DTProfile extends DTAbstractModelEntity {

@DatabaseField

private int unreadCount;

@DatabaseField

private boolean linkedInAuthorised;

@DatabaseField

private boolean hasSubscriptions;

@DatabaseField(foreign=true, foreignAutoCreate = true, foreignAutoRefresh = true)

private DTLocale localePreference;

@DatabaseField

private String loginType; //email or social login provider ie twitter, google, facebook etc

/* CONSTRUCTOR */

public DTProfile() {

//constructor stub - needed by ORMLite

}

/* GETTERS */

public int getUnreadCount() {

return unreadCount;

}

public boolean isLinkedInAuthorised() {

return linkedInAuthorised;

}

public boolean isHasSubscriptions() {

return hasSubscriptions;

}

public DTLocale getLocalePreference() {

return localePreference;

}

public String getLoginType() { return loginType; }

}任何人都可以在这里提供他们的指导,将Java代码迁移到它的C#等价物

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值