com.stormpath.sdk.lang.Assert.notNull()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(6.3k)|赞(0)|评价(0)|浏览(168)

本文整理了Java中com.stormpath.sdk.lang.Assert.notNull()方法的一些代码示例,展示了Assert.notNull()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Assert.notNull()方法的具体详情如下:
包路径:com.stormpath.sdk.lang.Assert
类名称:Assert
方法名:notNull

Assert.notNull介绍

[英]Assert that an object is not null .

Assert.notNull(clazz);

[中]断言对象不是null

Assert.notNull(clazz);

代码示例

代码示例来源:origin: stormpath/stormpath-sdk-java

@Override
public CreateChallengeRequestBuilder withResponseOptions(ChallengeOptions options) throws IllegalArgumentException {
  Assert.notNull(options, "options can't be null.");
  this.options = options;
  return this;
}

代码示例来源:origin: stormpath/stormpath-sdk-java

@Override
public OAuthPasswordGrantRequestAuthenticationBuilder setAccountStore(AccountStore accountStore) {
  Assert.notNull(accountStore, "accountStore cannot be null or empty.");
  this.accountStore = accountStore;
  return this;
}

代码示例来源:origin: stormpath/stormpath-sdk-java

DefaultResourceRequestAuthenticator(HttpServletRequest httpServletRequest, Application application) {
  Assert.notNull(httpServletRequest);
  Assert.notNull(application, "application cannot be null.");
  this.httpServletRequest = httpServletRequest;
  this.application = application;
}

代码示例来源:origin: stormpath/stormpath-sdk-java

public DefaultOAuthRefreshTokenRequestAuthentication(String refreshToken) {
  Assert.notNull(refreshToken, "refreshToken argument cannot be null.");
  this.refresh_token = refreshToken;
}
@Override

代码示例来源:origin: stormpath/stormpath-sdk-java

public DefaultCreateChallengeRequest(Challenge challenge, ChallengeOptions options) {
  Assert.notNull(challenge, "challenge cannot be null.");
  this.challenge = challenge;
  this.options = options;
}

代码示例来源:origin: stormpath/stormpath-sdk-java

public T add(Criterion criterion) {
  Assert.notNull(criterion, "criterion cannot be null.");
  this.criterionEntries.add(criterion);
  return (T) this;
}

代码示例来源:origin: stormpath/stormpath-sdk-java

private boolean isError(Map jsonMap) {
  Assert.notNull(jsonMap, "jsonMap cannot be null.");
  Object error = getOptionalValue(jsonMap, ERROR);
  return error != null;
}

代码示例来源:origin: stormpath/stormpath-sdk-java

@Override
public void setRefreshToken(String refreshToken) {
  Assert.notNull(refreshToken, "refreshToken is required and cannot be null.");
  setProperty(REFRESH_TOKEN, refreshToken);
}

代码示例来源:origin: stormpath/stormpath-sdk-java

/**
 * @since 1.2.0
 */
public ClientBuilder setBaseUrlResolver(BaseUrlResolver baseUrlResolver) {
  Assert.notNull(baseUrlResolver, "baseUrlResolver must not be null");
  this.clientConfig.setBaseUrlResolver(baseUrlResolver);
  return this;
}

代码示例来源:origin: stormpath/stormpath-sdk-java

@Override
public void setSsoLoginUrl(String ssoLoginUrl) {
  Assert.notNull(ssoLoginUrl, "ssoLoginUrl cannot be null or empty.");
  setProperty(SSO_LOGIN_URL, ssoLoginUrl);
}

代码示例来源:origin: stormpath/stormpath-sdk-java

@Override
public AccountCreationPolicy setVerificationSuccessEmailStatus(EmailStatus accountVerificationSuccessEmailStatus) {
  Assert.notNull(accountVerificationSuccessEmailStatus, "accountVerificationSuccessEmailStatus cannot be null.");
  setProperty(ACCOUNT_VERIFICATION_SUCCESS_EMAIL_STATUS, accountVerificationSuccessEmailStatus.name());
  return this;
}

代码示例来源:origin: stormpath/stormpath-sdk-java

@Override
public <T extends Resource, O extends Options> T getResource(String href, Class<T> clazz, O options) {
  Assert.hasText(href, "href argument cannot be null or empty.");
  Assert.notNull(clazz, "Resource class argument cannot be null.");
  Assert.isInstanceOf(DefaultOptions.class, options, "The " + getClass().getName() + " implementation only functions with " +
      DefaultOptions.class.getName() + " instances.");
  DefaultOptions defaultOptions = (DefaultOptions) options;
  QueryString qs = queryStringFactory.createQueryString(defaultOptions);
  return (T) getResource(href, clazz, (Map) qs);
}

代码示例来源:origin: stormpath/stormpath-sdk-java

@Override
public Map<String, Object> convert(AbstractResource resource) {
  Assert.notNull(resource, "resource cannot be null.");
  boolean updateBoth = false;
  if (resource.getHref() != null && resource.getHref().matches(".*\\/api\\/v1\\/users\\/\\w*$")) {
    updateBoth = true;
  }
  return toMap(resource, true, updateBoth);
}

代码示例来源:origin: stormpath/stormpath-sdk-java

/**
 * @since 1.0.RC4.6
 */
@Override
public Directory saveWithResponseOptions(DirectoryOptions responseOptions) {
  Assert.notNull(responseOptions, "responseOptions can't be null.");
  applyCustomDataUpdatesIfNecessary();
  getDataStore().save(this, responseOptions);
  return this;
}

代码示例来源:origin: stormpath/stormpath-sdk-java

@Override
public Directory createDirectory(Directory directory) {
  Assert.notNull(directory, "Directory instance cannot be null.");
  return getDataStore().create("/" + DIRECTORIES.getName(), directory);
}

代码示例来源:origin: stormpath/stormpath-sdk-java

protected T expand(CollectionReference property, int limit, int offset) {
  Assert.notNull(property, "property argument cannot be null.");
  int sLimit = Pagination.sanitizeLimit(limit);
  int sOffset = Pagination.sanitizeOffset(offset);
  this.expansions.add(new CollectionExpansion(property.getName(), sLimit, sOffset));
  return (T) this;
}

代码示例来源:origin: stormpath/stormpath-sdk-java

public Account createAccount(Account account) {
  Assert.notNull(account, "Account instance cannot be null.");
  CreateAccountRequest request = Accounts.newCreateRequestFor(account).build();
  return createAccount(request);
}

代码示例来源:origin: stormpath/stormpath-sdk-java

@Override
public SmsFactor challenge() {
  String href = getHref();
  href += "/challenges";
  Assert.notNull(href, "SmsFactor hast to be materialized and have an href.");
  return getDataStore().create(href, this);
}

代码示例来源:origin: stormpath/stormpath-sdk-java

@Override
public T createChallenge(CreateChallengeRequest request) throws ResourceException {
  Assert.notNull(request, "Request cannot be null.");
  final Challenge challenge = request.getChallenge();
  String href = getChallenges().getHref();
  if (request.hasChallengeOptions()) {
    return (T) getDataStore().create(href, challenge, request.getChallengeOptions());
  }
  return (T) getDataStore().create(href, challenge);
}

代码示例来源:origin: stormpath/stormpath-sdk-java

@Override
public Group createGroup(CreateGroupRequest request) {
  Assert.notNull(request, "Request cannot be null.");
  final Group group = request.getGroup();
  String href = getGroups().getHref();
  if (request.isGroupOptionsSpecified()) {
    return getDataStore().create(href, group, request.getGroupOptions());
  }
  return getDataStore().create(href, group);
}

相关文章