本文整理匯總了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;
}