List of usage examples for org.springframework.util Assert notNull
public static void notNull(@Nullable Object object, Supplier<String> messageSupplier)
From source file:com.senacor.wbs.web.project.SortableListDataProvider.java
public SortableListDataProvider(final List<E> data) { Assert.notNull(data, "argument [list] cannot be null"); this.data = data; }
From source file:com.acme.PayloadValueCounterHandler.java
public PayloadValueCounterHandler(FieldValueCounterRepository fieldValueCounterRepository, String name) { Assert.hasText(name, "must have a name"); Assert.notNull(fieldValueCounterRepository, "cannot be null"); this.name = name; this.fieldValueCounterRepository = fieldValueCounterRepository; }
From source file:org.hdiv.config.annotation.RuleRegistry.java
public RuleRegistration addRule(String name) { Assert.notNull(name, "Rule name is required"); RuleRegistration registration = new RuleRegistration(name); registrations.add(registration);//from ww w. jav a 2s . c om return registration; }
From source file:com._4dconcept.springframework.data.marklogic.datasource.SimpleSessionHandle.java
/** * Create a new SimpleSessionHandle for the given Session. * @param session the XDBC Session//w w w.j a v a 2 s . c om */ public SimpleSessionHandle(Session session) { Assert.notNull(session, "Session must not be null"); this.session = session; }
From source file:org.cloudfoundry.identity.uaa.authentication.event.UserAuthenticationSuccessEvent.java
@Override public AuditEvent getAuditEvent() { Assert.notNull(user, "UaaUser cannot be null"); return createAuditRecord(user.getId(), AuditEventType.UserAuthenticationSuccess, getOrigin(getAuthenticationDetails()), user.getUsername()); }
From source file:org.hdiv.config.annotation.UrlExclusionRegistration.java
public void method(String method) { Assert.notNull(method, "Method is required"); this.method = method; }
From source file:com.athena.peacock.common.core.util.ZipUtil.java
/** * <pre>/* w w w.jav a 2 s . com*/ * ? ? ? . * </pre> * @param baseDir * @param destFile * @return * @throws IOException * @throws ManifestException */ public static String compress(String baseDir, String destFile) throws IOException, ManifestException { Assert.notNull(baseDir, "baseDir cannot be null."); Project project = new Project(); File filesetDir = new File(baseDir); File archiveFile = null; Assert.isTrue(filesetDir.exists(), baseDir + " does not exist."); Assert.isTrue(filesetDir.isDirectory(), baseDir + " is not a directory."); if (StringUtils.isEmpty(destFile)) { archiveFile = new File(filesetDir.getParent(), new StringBuilder(filesetDir.getName()).append(".zip").toString()); } else { archiveFile = new File(destFile); } FileSet fileSet = new FileSet(); fileSet.setDir(filesetDir); fileSet.setProject(project); // project ? DirectoryScanner ? Excption? ?. Zip zip = new Zip(); zip.setProject(project); // project ? destFile Exception ?. zip.setDestfile(archiveFile); zip.add(fileSet); zip.execute(); return archiveFile.getAbsolutePath(); }
From source file:com.appdynamics.cloudfoundry.appdservicebroker.catalog.DashboardClient.java
String getId() { synchronized (this.monitor) { Assert.notNull(this.id, "Dashboard Clients must specify an id"); return this.id; }/*from w w w. j av a 2 s. co m*/ }
From source file:de.itsvs.cwtrpc.controller.PreparedCacheControlUriConfig.java
public PreparedCacheControlUriConfig(Pattern value, RequestMethod method, String cacheControl, Integer expires, boolean pragmaNoCache) { Assert.notNull(value, "'value' must not be null"); if (cacheControl != null) { Assert.hasText(cacheControl, "'cacheControl' must not be an empty string"); }//from w w w. j a v a 2 s.com this.value = value; this.method = method; this.cacheControl = cacheControl; this.expires = expires; this.pragmaNoCache = pragmaNoCache; }
From source file:com.acc.validator.FieldNotEmptyValidator.java
@Override public void validate(final Object object, final Errors errors) { Assert.notNull(errors, "Errors object must not be null"); final String fieldValue = (String) errors.getFieldValue(fieldPath); if (StringUtils.isBlank(fieldValue)) { errors.rejectValue(fieldPath, FIELD_REQUIRED_MESSAGE_ID, new String[] { fieldPath }, null); }/*ww w. ja v a 2 s . co m*/ }