当前位置: 首页>>代码示例>>Java>>正文


Java NotNull类代码示例

本文整理汇总了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);
  }
}
 
开发者ID:apache,项目名称:apex-malhar,代码行数:19,代码来源:S3RecordReader.java

示例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;
}
 
开发者ID:HoratiusTang,项目名称:EsperDist,代码行数:34,代码来源:FieldSerializer.java

示例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;
}
 
开发者ID:HoratiusTang,项目名称:EsperDist,代码行数:36,代码来源:FieldSerializer.java

示例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;
}
 
开发者ID:apache,项目名称:apex-malhar,代码行数:12,代码来源:S3RecordReader.java

示例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;
}
 
开发者ID:apache,项目名称:apex-malhar,代码行数:12,代码来源:S3RecordReader.java

示例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;
}
 
开发者ID:apache,项目名称:apex-malhar,代码行数:12,代码来源:S3RecordReader.java

示例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;
}
 
开发者ID:apache,项目名称:apex-malhar,代码行数:12,代码来源:S3RecordReader.java


注:本文中的com.esotericsoftware.kryo.NotNull类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。