Java源码示例:com.sun.istack.NotNull
示例1
private JavaType getFieldType(IField field, boolean search, @NotNull Set<String> pendingFields) {
if (!search) {
return field.getType();
}
if (field.getReference() != null) {
if (pendingFields.add(field.getReference().getId())) {
try {
return getFieldType(field.getReference(), true, pendingFields);
} finally {
pendingFields.remove(field.getReference().getId());
}
} else {
StringBuilder builder = new StringBuilder("Recursive reference for fields with ids: [");
pendingFields.stream().sorted(String::compareTo).forEach(id -> {
builder.append(StringUtils.join(id, ","));
});
builder.setCharAt(builder.length() - 1, ']');
pendingFields.clear();
throw new EPSCommonException(builder.toString());
}
} else
return field.getType();
}
示例2
public PTableStatsImpl(@NotNull SortedMap<byte[], GuidePostsInfo> guidePosts, long timeStamp) {
this.guidePosts = guidePosts;
this.timeStamp = timeStamp;
int estimatedSize = SizedUtil.OBJECT_SIZE + SizedUtil.INT_SIZE + SizedUtil.sizeOfTreeMap(guidePosts.size());
for (Map.Entry<byte[], GuidePostsInfo> entry : guidePosts.entrySet()) {
byte[] cf = entry.getKey();
estimatedSize += SizedUtil.ARRAY_SIZE + cf.length;
List<byte[]> keys = entry.getValue().getGuidePosts();
estimatedSize += SizedUtil.sizeOfArrayList(keys.size());
for (byte[] key : keys) {
estimatedSize += SizedUtil.ARRAY_SIZE + key.length;
}
estimatedSize += SizedUtil.LONG_SIZE;
}
this.estimatedSize = estimatedSize;
}
示例3
public static List<CreateInstanceRequest.DataDisk> getDataDiskList(@NotNull final List<String> dataDisksSizeListImp,
@NotNull final List<String> dataDisksCategoryListImp,
@NotNull final List<String> dataDisksSnapshotIdListImp,
@NotNull final List<String> dataDisksNameListImp,
@NotNull final List<String> dataDisksDescriptionListImp,
@NotNull final List<String> dataDisksDeleteWithInstanceListImp,
@NotNull final List<String> dataDisksEncryptedListImp) {
final List<CreateInstanceRequest.DataDisk> dataDiskList = new ArrayList<>();
for (int i = 0; i < dataDisksNameListImp.size(); i++) {
CreateInstanceRequest.DataDisk dataDisk = new CreateInstanceRequest.DataDisk();
dataDisk.setCategory(dataDisksCategoryListImp.get(i));
dataDisk.setDeleteWithInstance(valueOf(dataDisksDeleteWithInstanceListImp.get(i)));
dataDisk.setDescription(dataDisksDescriptionListImp.get(i));
dataDisk.setDiskName(dataDisksNameListImp.get(i));
dataDisk.setEncrypted(valueOf(dataDisksEncryptedListImp.get(i)));
dataDisk.setSize(Integer.valueOf(dataDisksSizeListImp.get(i)));
dataDisk.setSnapshotId(dataDisksSnapshotIdListImp.get(i));
dataDiskList.add(dataDisk);
}
return dataDiskList;
}
示例4
private static void addCustomAnnotationsToSpan(@Nullable Span span, @NotNull PhoenixConnection conn) {
Preconditions.checkNotNull(conn);
if (span == null) {
return;
}
Map<String, String> annotations = conn.getCustomTracingAnnotations();
// copy over the annotations as bytes
for (Map.Entry<String, String> annotation : annotations.entrySet()) {
span.addKVAnnotation(toBytes(annotation.getKey()), toBytes(annotation.getValue()));
}
}
示例5
public static Map<String, String> getAnnotations(@NotNull String url, @NotNull Properties info) {
Preconditions.checkNotNull(url);
Preconditions.checkNotNull(info);
Map<String, String> combinedProperties = getCombinedConnectionProperties(url, info);
Map<String, String> result = newHashMapWithExpectedSize(combinedProperties.size());
for (Map.Entry<String, String> prop : combinedProperties.entrySet()) {
if (prop.getKey().startsWith(ANNOTATION_ATTRIB_PREFIX) &&
prop.getKey().length() > ANNOTATION_ATTRIB_PREFIX.length()) {
result.put(prop.getKey().substring(ANNOTATION_ATTRIB_PREFIX.length()), prop.getValue());
}
}
return result;
}
示例6
public static PTableImpl makePTable(PName tenantId, PName schemaName, PName tableName, PTableType type,
PIndexState state, long timeStamp, long sequenceNumber, PName pkName, Integer bucketNum,
List<PColumn> columns, PName dataSchemaName, PName dataTableName, List<PTable> indexes,
boolean isImmutableRows, List<PName> physicalNames, PName defaultFamilyName, String viewExpression,
boolean disableWAL, boolean multiTenant, boolean storeNulls, ViewType viewType, Short viewIndexId, IndexType indexType, @NotNull PTableStats stats)
throws SQLException {
return new PTableImpl(tenantId, schemaName, tableName, type, state, timeStamp, sequenceNumber, pkName,
bucketNum, columns, dataSchemaName, dataTableName, indexes, isImmutableRows, physicalNames,
defaultFamilyName, viewExpression, disableWAL, multiTenant, storeNulls, viewType, viewIndexId, indexType, stats);
}
示例7
public MultiDeleteMutationPlan(@NotNull List<MutationPlan> plans) {
Preconditions.checkArgument(!plans.isEmpty());
this.plans = plans;
this.firstPlan = plans.get(0);
}
示例8
public UpdateStatisticsStatement(NamedTableNode table, @NotNull StatisticsCollectionScope scope) {
super(table, 0);
this.scope = scope;
}
示例9
@NotNull
public Options getOptions() {
return opts;
}