本文整理汇总了Java中com.esotericsoftware.kryo.NotNull类的典型用法代码示例。如果您正苦于以下问题:Java NotNull类的具体用法?Java NotNull怎么用?Java NotNull使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
NotNull类属于com.esotericsoftware.kryo包,在下文中一共展示了NotNull类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initializeS3Client
import com.esotericsoftware.kryo.NotNull; //导入依赖的package包/类
/**
* Initialize the AmazonS3 client using the accessKey, secretAccessKey, sets
* endpoint for the s3Client if provided
*
* @param accessKey
* @param secretAccessKey
* @param endPoint
*/
public void initializeS3Client(@javax.validation.constraints.NotNull String accessKey,
@javax.validation.constraints.NotNull String secretAccessKey, String endPoint)
{
Preconditions.checkNotNull(accessKey);
Preconditions.checkNotNull(secretAccessKey);
s3Client = new AmazonS3Client(new BasicAWSCredentials(accessKey, secretAccessKey));
if (endPoint != null) {
s3Client.setEndpoint(endPoint);
}
}
示例2: newCachedField
import com.esotericsoftware.kryo.NotNull; //导入依赖的package包/类
CachedField newCachedField (Field field, int fieldIndex, int accessIndex) {
Class[] fieldClass = new Class[] {field.getType()};
Type fieldGenericType = field.getGenericType();
CachedField cachedField;
if (fieldGenericType == fieldClass[0]) {
// This is a field without generic type parameters
if (TRACE) trace("kryo", "Field " + field.getName() + ": " + fieldClass[0]);
cachedField = newMatchingCachedField(field, accessIndex, fieldClass[0], fieldGenericType, null);
} else {
cachedField = genericsUtil.newCachedFieldOfGenericType(field, accessIndex, fieldClass, fieldGenericType);
}
if (cachedField instanceof ObjectField) {
hasObjectFields = true;
}
cachedField.field = field;
cachedField.varIntsEnabled = varIntsEnabled;
if (!useAsmEnabled) {
cachedField.offset = unsafeUtil.getObjectFieldOffset(field);
}
cachedField.access = (FieldAccess)access;
cachedField.accessIndex = accessIndex;
cachedField.canBeNull = fieldsCanBeNull && !fieldClass[0].isPrimitive() && !field.isAnnotationPresent(NotNull.class);
// Always use the same serializer for this field if the field's class is final.
if (kryo.isFinal(fieldClass[0]) || fixedFieldTypes) cachedField.valueClass = fieldClass[0];
return cachedField;
}
示例3: newCachedField
import com.esotericsoftware.kryo.NotNull; //导入依赖的package包/类
CachedField newCachedField (Field field, int fieldIndex, int accessIndex) {
Class[] fieldClass = new Class[] { field.getType() };
Type fieldGenericType = field.getGenericType();
CachedField cachedField;
if (fieldGenericType == fieldClass[0]) {
// This is a field without generic type parameters
if (TRACE) {
trace("kryo", "Field '" + field.getName() + "' of type " + fieldClass[0]);
}
cachedField = newMatchingCachedField(field, accessIndex, fieldClass[0], fieldGenericType, null);
} else {
cachedField = genericsUtil.newCachedFieldOfGenericType(field, accessIndex, fieldClass, fieldGenericType);
}
if (cachedField instanceof ObjectField) {
hasObjectFields = true;
}
cachedField.field = field;
cachedField.varIntsEnabled = varIntsEnabled;
if (!useAsmEnabled) {
cachedField.offset = unsafeUtil.getObjectFieldOffset(field);
}
cachedField.access = (FieldAccess)access;
cachedField.accessIndex = accessIndex;
cachedField.canBeNull = fieldsCanBeNull && !fieldClass[0].isPrimitive() && !field.isAnnotationPresent(NotNull.class);
// Always use the same serializer for this field if the field's class is final.
if (kryo.isFinal(fieldClass[0]) || fixedFieldTypes) cachedField.valueClass = fieldClass[0];
return cachedField;
}
示例4: setS3Client
import com.esotericsoftware.kryo.NotNull; //导入依赖的package包/类
/**
* Set the AmazonS3 service
*
* @param s3Client
* given s3Client
*/
public void setS3Client(@javax.validation.constraints.NotNull AmazonS3 s3Client)
{
Preconditions.checkNotNull(s3Client);
this.s3Client = s3Client;
}
示例5: setBucketName
import com.esotericsoftware.kryo.NotNull; //导入依赖的package包/类
/**
* Set the bucket name
*
* @param bucketName
* given bucketName
*/
public void setBucketName(@javax.validation.constraints.NotNull String bucketName)
{
Preconditions.checkNotNull(bucketName);
this.bucketName = bucketName;
}
示例6: setAccessKey
import com.esotericsoftware.kryo.NotNull; //导入依赖的package包/类
/**
* Set the access key
*
* @param accessKey
* given accessKey
*/
public void setAccessKey(@javax.validation.constraints.NotNull String accessKey)
{
Preconditions.checkNotNull(accessKey);
this.accessKey = accessKey;
}
示例7: setSecretAccessKey
import com.esotericsoftware.kryo.NotNull; //导入依赖的package包/类
/**
* Set the secretAccessKey
*
* @param secretAccessKey
* secretAccessKey
*/
public void setSecretAccessKey(@javax.validation.constraints.NotNull String secretAccessKey)
{
Preconditions.checkNotNull(secretAccessKey);
this.secretAccessKey = secretAccessKey;
}