本文整理汇总了Java中com.googlecode.objectify.annotation.Id类的典型用法代码示例。如果您正苦于以下问题:Java Id类的具体用法?Java Id怎么用?Java Id使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Id类属于com.googlecode.objectify.annotation包,在下文中一共展示了Id类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: OnlineVerification
import com.googlecode.objectify.annotation.Id; //导入依赖的package包/类
public OnlineVerification(PGPPublicKeyData pgpPublicKeyData) {
this.Id = pgpPublicKeyData.getFingerprint(); // (@Id for PGPPublicKeyData is 'fingerprint'
this.pgpPublicKeyDataUrlSafeKey = pgpPublicKeyData.getWebSafeString();
this.userEmail = pgpPublicKeyData.getUserEmail();
this.lastName = pgpPublicKeyData.getLastName();
this.firstName = pgpPublicKeyData.getFirstName();
this.keyID = pgpPublicKeyData.getKeyID();
this.cryptonomicaUserId = pgpPublicKeyData.getCryptonomicaUserId();
// old PGPPublicKeyData entities (created before 22.05.17) do not have this property
// Birthday was stored in CryptonomicaUser entity only
this.birthday = pgpPublicKeyData.getUserBirthday();
//
this.entityCreated = new Date(); // <<< ---
this.allowedUsers = new ArrayList<>();
this.verificationDocumentsArray = new ArrayList<>();
this.termsAccepted = false;
this.nationality = pgpPublicKeyData.getNationality();
}
示例2: VideoUploadKey
import com.googlecode.objectify.annotation.Id; //导入依赖的package包/类
public VideoUploadKey(User googleUser, String videoUploadKey) {
this.Id = videoUploadKey;
this.googleUser = googleUser;
this.entityCreated = new Date();
this.videoUploadKey = videoUploadKey;
this.uploadedVideoId = null;
}
示例3: VerificationVideo
import com.googlecode.objectify.annotation.Id; //导入依赖的package包/类
public VerificationVideo(String id,
User googleUser,
String bucketName,
String objectName,
String videoUploadKey) {
this.Id = id;
this.googleUser = googleUser;
this.entityCreated = new Date();
this.bucketName = bucketName;
this.objectName = objectName;
this.videoUploadKey = videoUploadKey;
}
示例4: VerificationDocumentsUploadKey
import com.googlecode.objectify.annotation.Id; //导入依赖的package包/类
public VerificationDocumentsUploadKey(User googleUser, String documentsUploadKey) {
this.Id = documentsUploadKey;
this.googleUser = googleUser;
this.entityCreated = new Date();
this.documentsUploadKey = documentsUploadKey;
this.uploadedDocumentIds = null;
}
示例5: VerificationDocument
import com.googlecode.objectify.annotation.Id; //导入依赖的package包/类
public VerificationDocument(String id,
User googleUser,
String bucketName,
String objectName,
String documentsUploadKey,
String fingerprint) {
this.Id = id;
this.googleUser = googleUser;
this.entityCreated = new Date();
this.bucketName = bucketName;
this.objectName = objectName;
this.documentsUploadKey = documentsUploadKey;
this.fingerprint = fingerprint;
this.hidden = false;
}
示例6: getSchema
import com.googlecode.objectify.annotation.Id; //导入依赖的package包/类
/** Return a string representing the persisted schema of a type or enum. */
static String getSchema(Class<?> clazz) {
StringBuilder stringBuilder = new StringBuilder();
Stream<?> body;
if (clazz.isEnum()) {
stringBuilder.append("enum ");
body = Arrays.stream(clazz.getEnumConstants());
} else {
stringBuilder.append("class ");
body =
getAllFields(clazz)
.values()
.stream()
.filter(field -> !field.isAnnotationPresent(Ignore.class))
.map(
field -> {
String annotation =
field.isAnnotationPresent(Id.class)
? "@Id "
: field.isAnnotationPresent(Parent.class) ? "@Parent " : "";
String type =
field.getType().isArray()
? field.getType().getComponentType().getName() + "[]"
: field.getGenericType().toString().replaceFirst("class ", "");
return String.format("%s%s %s", annotation, type, field.getName());
});
}
return stringBuilder
.append(clazz.getName())
.append(" {\n ")
.append(body.map(Object::toString).sorted().collect(Collectors.joining(";\n ")))
.append(";\n}")
.toString();
}
示例7: key
import com.googlecode.objectify.annotation.Id; //导入依赖的package包/类
private static <T> Field key (Class<T> c) {
Field k = null;
Field[] fs = c.getDeclaredFields();
for (Field field : fs) {
Annotation[] as = field.getAnnotations();
for (Annotation annotation : as) {
if (annotation instanceof Id) {
try {
k = field;
} catch (IllegalArgumentException ex) {
throw new RuntimeException(ex);
}
break;
}
}
if (k != null) {
break;
}
}
if (k == null && c.getSuperclass() != Object.class) {
k = key(c.getSuperclass());
}
return k;
}
示例8: getId
import com.googlecode.objectify.annotation.Id; //导入依赖的package包/类
public String getId() {
return Id;
}
示例9: getId
import com.googlecode.objectify.annotation.Id; //导入依赖的package包/类
public Long getId() {
return Id;
}
示例10: setId
import com.googlecode.objectify.annotation.Id; //导入依赖的package包/类
public void setId(Long id) {
Id = id;
}
示例11: setId
import com.googlecode.objectify.annotation.Id; //导入依赖的package包/类
public void setId(String id) {
Id = id;
}