本文整理了Java中com.squareup.moshi.Json.<init>()
方法的一些代码示例,展示了Json.<init>()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Json.<init>()
方法的具体详情如下:
包路径:com.squareup.moshi.Json
类名称:Json
方法名:<init>
暂无
代码示例来源:origin: square/moshi
public final class Player {
public final String username;
public final @Json(name = "lucky number") int luckyNumber;
public Player(String username, int luckyNumber) {
this.username = username;
this.luckyNumber = luckyNumber;
}
@Override public String toString() {
return username + " gets lucky with " + luckyNumber;
}
}
代码示例来源:origin: square/moshi
@Json(name = "not-started") NOT_STARTED,
@Json(name = "in-progress") IN_PROGRESS,
@Json(name = "rejected") REJECTED,
@Json(name = "completed") COMPLETED
代码示例来源:origin: square/osstrich
static final class Select {
@Json(name = "response") Response response;
static final class Response {
@Json(name = "docs") List<Artifact> artifacts;
}
}
}
代码示例来源:origin: CoinbaseWallet/toshi-headless-client
public class Balance {
@Json(name = "confirmed_balance")
private String confirmedBalanceAsHex;
@Json(name = "unconfirmed_balance")
private String unconfirmedBalanceAsHex;
public BigInteger getConfirmedBalance() {
return TypeConverter.StringHexToBigInteger(confirmedBalanceAsHex);
}
public BigInteger getUnconfirmedBalance() {
return TypeConverter.StringHexToBigInteger(unconfirmedBalanceAsHex);
}
}
代码示例来源:origin: square/osstrich
static final class Response {
@Json(name = "docs") List<Artifact> artifacts;
}
}
代码示例来源:origin: CodeDex/CodeDex
/**
* Representation of repository json object, sample: https://api.github.com/users/fabianterhorst/repos
*/
public class Repo {
private int id;
private String name;
@Json(name = "full_name")
private String fullName;
public int getId() {
return id;
}
public String getName() {
return name;
}
public String getFullName() {
return fullName;
}
}
代码示例来源:origin: xing/xing-android-sdk
/** Reason for the profile visit. */
public static class Reason implements Serializable {
private static final long serialVersionUID = 1L;
@Json(name = "text")
private final String text;
public Reason(String text) {
this.text = text;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Reason reason = (Reason) o;
return text != null ? text.equals(reason.text) : reason.text == null;
}
@Override
public int hashCode() {
return text != null ? text.hashCode() : 0;
}
@Override
public String toString() {
return text;
}
public String text() {
return text;
}
}
代码示例来源:origin: square/osstrich
private static final String JAVADOC_EXTENSION = "-javadoc.jar";
@Json(name = "g") String groupId;
@Json(name = "a") String artifactId;
String latestVersion;
@Json(name = "p") String packaging;
long timestamp;
@Json(name = "ec") Set<String> extensions;
代码示例来源:origin: xing/xing-android-sdk
private static final long serialVersionUID = 1L;
@Json(name = "content")
private String content;
代码示例来源:origin: xing/xing-android-sdk
private static final long serialVersionUID = 1L;
@Json(name = "preview_content")
private String previewContent;
代码示例来源:origin: xing/xing-android-sdk
public class CompanyLinks implements Serializable {
private static final long serialVersionUID = 1L;
@Json(name = "xing")
private final String xing;
@Json(name = "thumbnail")
private final String thumbnail;
@Json(name = "logo")
private final String logo;
代码示例来源:origin: xing/xing-android-sdk
@Json(name = "name")
private final String name;
@Json(name = "utc_offset")
private final double utcOffset;
代码示例来源:origin: xing/xing-android-sdk
@Json(name = "updated_at")
private final SafeCalendar updatedAt;
@Json(name = "message")
private final String message;
代码示例来源:origin: xing/xing-android-sdk
public static class JobContact implements Serializable {
private static final long serialVersionUID = 1L;
@Json(name = "company")
private final JobCompany jobCompany;
@Json(name = "user")
private final XingUser user;
代码示例来源:origin: serj-lotutovici/moshi-lazy-adapters
private static class Data3 {
@AlwaysElementAtIndexOne
@Json(name = "obj") String str;
}
}
代码示例来源:origin: xing/xing-android-sdk
ROCK,
PAPER,
@Json(name = "scr")SCISSORS
代码示例来源:origin: serj-lotutovici/moshi-lazy-adapters
private static class Data {
@ElementAt(index = 1)
@Json(name = "obj") String str;
}
代码示例来源:origin: serj-lotutovici/moshi-lazy-adapters
static class Nested {
@Json(name = "item") @Wrapped(path = "foo") String foo;
@Json(name = "item2") @Wrapped(path = "bar") int bar;
int foobar;
}
}
代码示例来源:origin: serj-lotutovici/moshi-lazy-adapters
private static class Data {
@LastElement
@Json(name = "obj") String str;
}
代码示例来源:origin: serj-lotutovici/moshi-lazy-adapters
private static class Data {
@FirstElement
@Json(name = "obj") String str;
}
内容来源于网络,如有侵权,请联系作者删除!