Tabnine Logo
Assert
Code IndexAdd Tabnine to your IDE (free)

How to use
Assert
in
ru.javatalks.utils.general

Best Java code snippets using ru.javatalks.utils.general.Assert (Showing top 5 results out of 315)

origin: jtalks-org/jcommune

/**
 * Throws exception if permission name is not valid.
 *
 * @param name a textual representation of the permission (usually the same as the constant name)
 */
private void throwIfNameNotValid(String name) {
  Assert.throwIfNull(name, "The name can't be null");
}
origin: jtalks-org/jcommune

private void throwIfNameNotValid(String name) {
  Assert.throwIfNull(name, "The name can't be null");
}
origin: jtalks-org/jcommune

/**
 * {@inheritDoc}
 */
@Override
public List<Group> getGroupsOfUser(User user) {
  Assert.throwIfNull(user, "user");
  Query query = session().getNamedQuery("findGroupsOfUser");
  query.setParameter(0, "%" + user + "%");
  return query.list();
}
origin: jtalks-org/jcommune

/**
 * {@inheritDoc}
 */
@Override
public void saveGroup(Group group) {
  Assert.throwIfNull(group, "group");
  group.setName(group.getName().trim());
  dao.saveOrUpdate(group);
}
origin: jtalks-org/jcommune

/**
 * {@inheritDoc}
 */
@Override
public void deleteGroup(Group group) throws NotFoundException {
  Assert.throwIfNull(group, "group");
  if (!isGroupEditable(group.getName())) {
    logger.warn("Attempt to delete pre-defined usergoup {}", group.getName());
    throw new OperationIsNotAllowedException("Pre-defined usergoup " + group.getName() + " cannot be deleted");
  }
  for (User user : group.getUsers()) {
    user.getGroups().remove(group);
    userDao.saveOrUpdate((JCUser) user);
  }
  dao.delete(group);
  UserInfo currentUser = securityService.getCurrentUserBasicInfo();
  UserGroupSid sid = new UserGroupSid(group);
  UserSid sidHeier = new UserSid(currentUser);
  try {
    manager.deleteSid(sid, sidHeier);
  } catch (EmptyResultDataAccessException noSidError) {
    throw new NotFoundException();
  }
}
ru.javatalks.utils.generalAssert

Most used methods

  • throwIfNull

Popular in Java

  • Making http post requests using okhttp
  • getSupportFragmentManager (FragmentActivity)
  • onCreateOptionsMenu (Activity)
  • requestLocationUpdates (LocationManager)
  • File (java.io)
    An "abstract" representation of a file system entity identified by a pathname. The pathname may be a
  • URLEncoder (java.net)
    This class is used to encode a string using the format required by application/x-www-form-urlencoded
  • MessageDigest (java.security)
    Uses a one-way hash function to turn an arbitrary number of bytes into a fixed-length byte sequence.
  • Queue (java.util)
    A collection designed for holding elements prior to processing. Besides basic java.util.Collection o
  • BasicDataSource (org.apache.commons.dbcp)
    Basic implementation of javax.sql.DataSource that is configured via JavaBeans properties. This is no
  • Scheduler (org.quartz)
    This is the main interface of a Quartz Scheduler. A Scheduler maintains a registry of org.quartz.Job
  • Best IntelliJ plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now