List of usage examples for org.springframework.util Assert notNull
public static void notNull(@Nullable Object object, Supplier<String> messageSupplier)
From source file:com.frank.search.solr.core.query.DefaultValueFunction.java
/** * Creates new {@link DefaultValueFunction} representing {@code def(field.getName(), defaultValue))} * * @param field must not be null/* w ww .j a va 2 s . com*/ * @param defaultValue must not be null * @return */ public static DefaultValueFunction defaultValue(Field field, Object defaultValue) { Assert.notNull(field, "Field must not be 'null' for default value operation."); return defaultValue(field.getName(), defaultValue); }
From source file:de.hybris.platform.mpintgordermanagement.converters.AddressPopulator.java
@Override public void populate(final AddressModel source, final AddressData target) { Assert.notNull(source, "Parameter source cannot be null."); Assert.notNull(target, "Parameter target cannot be null."); if (source.getCountry() != null) { target.setCountryCode(source.getCountry().getIsocode()); }//from www .j a v a2 s.co m target.setCity(source.getDistrict()); target.setStreet(source.getStreetname()); target.setZip(source.getPostalcode()); }
From source file:com.vmware.demo.sgf.lucene.LuceneIndexFactory.java
@PostConstruct public void setup() throws Throwable { Assert.notNull(this.indexDirectory, "The indexDirectory cannot be null."); }
From source file:com.devnexus.ting.model.SponsorLevel.java
public static SponsorLevel fromId(Long sponsorLevelId) { Assert.notNull(sponsorLevelId, "Parameter sponsorLevelId, must not be null."); for (SponsorLevel sponsorLevel : SponsorLevel.values()) { if (sponsorLevel.getId().equals(sponsorLevelId)) { return sponsorLevel; }/* w w w .jav a2s. com*/ } return null; }
From source file:org.esnm.server.data.jpa.service.PersonSearchCriteria.java
public PersonSearchCriteria(String firstName, String lastName) { Assert.notNull(firstName, "FirstName must not be null"); Assert.notNull(lastName, "LastName must not be null"); this.firstName = firstName; this.lastName = lastName; }
From source file:org.personal.mason.addressbook.app.command.RemoveAddressCommand.java
public RemoveAddressCommand(ContactId contactId, AddressType addressType) { super(contactId); Assert.notNull(addressType, "The address type cannot be null"); this.addressType = addressType; }
From source file:demo.service.VehicleDetails.java
@JsonCreator public VehicleDetails(@JsonProperty("make") String make, @JsonProperty("model") String model) { Assert.notNull(make, "Make must not be null"); Assert.notNull(model, "Model must not be null"); this.make = make; this.model = model; }
From source file:curly.commons.web.hateoas.PageProcessor.java
public static <T> List<T> fromPage(Page<T> page) { Assert.notNull(page, "Page element must be not null"); return page.getContent(); }
From source file:org.axonframework.sample.app.api.RemoveAddressCommand.java
public void setAddressType(AddressType addressType) { Assert.notNull(addressType, "The address type cannot be null"); this.addressType = addressType; }
From source file:org.eclipse.swordfish.core.util.xml.StringSource.java
public StringSource(String text) { Assert.notNull(text, "text can not be null"); this.text = text; }