本文整理汇总了Java中org.springframework.lang.Nullable类的典型用法代码示例。如果您正苦于以下问题:Java Nullable类的具体用法?Java Nullable怎么用?Java Nullable使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Nullable类属于org.springframework.lang包,在下文中一共展示了Nullable类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: acquireToken
import org.springframework.lang.Nullable; //导入依赖的package包/类
public Token acquireToken(YggdrasilUser user, @Nullable String clientToken, @Nullable YggdrasilCharacter selectedCharacter) {
Token token = new Token();
token.accessToken = randomUnsignedUUID();
if (selectedCharacter == null) {
if (user.getCharacters().size() == 1) {
token.boundCharacter = of(user.getCharacters().get(0));
} else {
token.boundCharacter = empty();
}
} else {
if (!user.getCharacters().contains(selectedCharacter)) {
throw newForbiddenOperationException(m_access_denied);
}
token.boundCharacter = of(selectedCharacter);
}
token.clientToken = clientToken == null ? randomUnsignedUUID() : clientToken;
token.createdAt = System.currentTimeMillis();
token.revoked = false;
token.user = user;
accessToken2token.put(token.accessToken, token);
return token;
}
示例2: IdentityProviderFactory
import org.springframework.lang.Nullable; //导入依赖的package包/类
@Autowired
public IdentityProviderFactory(
final NiFiRegistryProperties properties,
final ExtensionManager extensionManager,
@Nullable final SensitivePropertyProvider sensitivePropertyProvider) {
this.properties = properties;
this.extensionManager = extensionManager;
this.sensitivePropertyProvider = sensitivePropertyProvider;
if (this.properties == null) {
throw new IllegalStateException("NiFiRegistryProperties cannot be null");
}
if (this.extensionManager == null) {
throw new IllegalStateException("ExtensionManager cannot be null");
}
}
示例3: PublishMessage
import org.springframework.lang.Nullable; //导入依赖的package包/类
private PublishMessage(long requestId, String topic, @Nullable List<Object> arguments,
@Nullable Map<String, Object> argumentsKw, boolean acknowledge,
boolean excludeMe, boolean discloseMe, boolean retain,
@Nullable Set<Number> exclude, @Nullable Set<Number> eligible) {
super(CODE);
this.requestId = requestId;
this.topic = topic;
this.arguments = arguments;
this.argumentsKw = argumentsKw;
this.acknowledge = acknowledge;
this.excludeMe = excludeMe;
this.discloseMe = discloseMe;
this.retain = retain;
this.exclude = exclude;
this.eligible = eligible;
}
示例4: removeInvocationCall
import org.springframework.lang.Nullable; //导入依赖的package包/类
@Nullable
CallMessage removeInvocationCall(WampMessage yieldOrErrorMessage) {
long requestId;
if (yieldOrErrorMessage instanceof YieldMessage) {
requestId = ((YieldMessage) yieldOrErrorMessage).getRequestId();
}
else if (yieldOrErrorMessage instanceof ErrorMessage) {
requestId = ((ErrorMessage) yieldOrErrorMessage).getRequestId();
}
else {
return null;
}
CallProc callProc = this.pendingInvocations.remove(requestId);
if (callProc != null) {
callProc.procedure.removePendingInvocation(requestId);
return callProc.callMessage;
}
return null;
}
示例5: convertListElements
import org.springframework.lang.Nullable; //导入依赖的package包/类
@SuppressWarnings("unchecked")
@Nullable
private Object convertListElements(TypeDescriptor td,
@Nullable Object convertedValue) {
if (convertedValue != null) {
if (List.class.isAssignableFrom(convertedValue.getClass())
&& td.isCollection() && td.getElementTypeDescriptor() != null) {
Class<?> elementType = td.getElementTypeDescriptor().getType();
Collection<Object> convertedList = new ArrayList<>();
for (Object record : (List<Object>) convertedValue) {
Object convertedObject = this.objectMapper.convertValue(record,
elementType);
convertedList.add(convertedObject);
}
return convertedList;
}
}
return convertedValue;
}
示例6: mapRow
import org.springframework.lang.Nullable; //导入依赖的package包/类
@Nullable
@Override
public KeyEntity mapRow(ResultSet rs, int rowNum) throws SQLException {
final KeyEntity keyEntity = new KeyEntity();
keyEntity.setId(rs.getString("ID"));
keyEntity.setTenantIdentity(rs.getString("TENANT_IDENTITY"));
keyEntity.setKeyValue(rs.getString("KEY_VALUE"));
return keyEntity;
}
示例7: logRequest
import org.springframework.lang.Nullable; //导入依赖的package包/类
public void logRequest(ServerRequest request, @Nullable String body) {
if (configHolder.getConfig().getLogging().isHeaders()) {
logRequestHeaders(request);
}
if (configHolder.getConfig().getLogging().isBody()) {
if (body != null) {
Arrays.stream(body.split("\r\n|\r|\n")).forEach(line ->
log.info("{} {}", RECEIVED, line));
}
}
}
示例8: logResponse
import org.springframework.lang.Nullable; //导入依赖的package包/类
public void logResponse(ServerResponse response, @Nullable String body) {
if (configHolder.getConfig().getLogging().isHeaders()) {
val status = response.statusCode();
log.info("{} {} {}", SENT, status.value(), status.getReasonPhrase());
response.headers().forEach((key, values) ->
values.forEach(value -> log.info("{} {}: {}", SENT, key, value)));
log.info(SENT);
}
if (configHolder.getConfig().getLogging().isBody()) {
if (body != null) {
Arrays.stream(body.split("\r\n|\r|\n")).forEach(line ->
log.info("{} {}", SENT, line));
}
}
}
示例9: DateTimeParameterObject
import org.springframework.lang.Nullable; //导入依赖的package包/类
DateTimeParameterObject(final LocalDateTime localDateTime, @Nullable final String pattern) {
this.localDateTime = localDateTime;
this.pattern = Optional.ofNullable(pattern);
this.dayOfMonth = localDateTime.getDayOfMonth();
this.month = localDateTime.getMonthValue();
this.year = localDateTime.getYear();
this.hour = localDateTime.getHour();
this.minute = localDateTime.getMinute();
this.second = localDateTime.getSecond();
this.instant = localDateTime.atZone(ZoneId.systemDefault()).toEpochSecond();
}
示例10: ErrorMessage
import org.springframework.lang.Nullable; //导入依赖的package包/类
public ErrorMessage(int type, long requestId, String error,
@Nullable List<Object> arguments, @Nullable Map<String, Object> argumentsKw) {
super(CODE);
this.type = type;
this.requestId = requestId;
this.error = error;
this.arguments = arguments;
this.argumentsKw = argumentsKw;
}
示例11: UnsubscribedMessage
import org.springframework.lang.Nullable; //导入依赖的package包/类
public UnsubscribedMessage(long requestId, @Nullable Long subscriptionId,
@Nullable String reason) {
super(CODE);
this.requestId = requestId;
this.subscriptionId = subscriptionId;
this.reason = reason;
}
示例12: CallMessage
import org.springframework.lang.Nullable; //导入依赖的package包/类
public CallMessage(long requestId, String procedure, @Nullable List<Object> arguments,
@Nullable Map<String, Object> argumentsKw, boolean discloseMe) {
super(CODE);
this.requestId = requestId;
this.procedure = procedure;
this.arguments = arguments;
this.argumentsKw = argumentsKw;
this.discloseMe = discloseMe;
}
示例13: ResultMessage
import org.springframework.lang.Nullable; //导入依赖的package包/类
public ResultMessage(long requestId, @Nullable List<Object> arguments,
@Nullable Map<String, Object> argumentsKw) {
super(CODE);
this.requestId = requestId;
this.arguments = arguments;
this.argumentsKw = argumentsKw;
}
示例14: EventMessage
import org.springframework.lang.Nullable; //导入依赖的package包/类
public EventMessage(long subscriptionId, long publicationId, @Nullable String topic,
@Nullable Number publisher, boolean retained,
@Nullable List<Object> arguments, @Nullable Map<String, Object> argumentsKw) {
super(CODE);
this.subscriptionId = subscriptionId;
this.publicationId = publicationId;
this.topic = topic;
this.publisher = publisher;
this.retained = retained;
this.arguments = arguments;
this.argumentsKw = argumentsKw;
}
示例15: mapRow
import org.springframework.lang.Nullable; //导入依赖的package包/类
@Nullable
@Override
public BucketItemEntity mapRow(ResultSet rs, int rowNum) throws SQLException {
final BucketItemEntityType type = BucketItemEntityType.valueOf(rs.getString("ITEM_TYPE"));
// Create the appropriate type of sub-class, eventually populate specific data for each type
final BucketItemEntity item;
switch (type) {
case FLOW:
item = new FlowEntity();
break;
default:
// should never happen
item = new BucketItemEntity();
break;
}
// populate fields common to all bucket items
item.setId(rs.getString("ID"));
item.setName(rs.getString("NAME"));
item.setDescription(rs.getString("DESCRIPTION"));
item.setCreated(rs.getTimestamp("CREATED"));
item.setModified(rs.getTimestamp("MODIFIED"));
item.setBucketId(rs.getString("BUCKET_ID"));
item.setBucketName(rs.getString("BUCKET_NAME"));
item.setType(type);
return item;
}